Create Gateway Service for NCache Management in AKS
Gateway service is used to access, manage, and monitor NCache from outside the network. It mainly defines the port that needs to be made accessible to the public. As we aim to use NCache deployment in the Azure Kubernetes cluster, we provide a load balancer as the gateway service to bring traffic down to a collection of pods and create Client-IP based persistent connections.
Create Gateway Service YAML File
After the cache discovery file has been created and deployed successfully, create a YAML file for the gateway service. Let's call this file gatewayservice.yaml.
Here's a snippet of what your gatewayservice.yaml file should look like,
Note
The parameters required to create this YAML file ready to be deployed are mentioned in the Properties table.
kind: Service
apiVersion: v1 # it depends on the underlying Kubernetes version
metadata:
name: gateway
spec:
selector:
app: ncache # same label as provided in the ncache YAML file
type: LoadBalancer
sessionAffinity: ClientIP
ports:
- name: management-http
port: 9801
targetPort: 9801
Create Gateway Service
To create a gateway service for NCache management, run the following command in Azure Cloud Shell.
kubectl create -f [dir]/gatewayservice.yaml
The next step after creating gateway service is to create NCache client deployment, explained in the next chapter.
See Also
Create NCache Deployment in AKS
Create Discovery Service in AKS
Create NCache Client Deployment in AKS
Create Cache Cluster in AKS