Create Gateway Service for NCache Management
Gateway service is used to access, manage, and monitor NCache from your workstation. It mainly defines the port that needs to be made accessible to the public. Here, because we are aim to use NCache deployment in 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 connection.
Create Gateway Service YAML File
After ncache.yaml 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,
The parameters required to create this YAML file ready to be deployed are mentioned in the Properties table.
kind: Service apiVersion: v1 # 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: 8251 targetPort: 8251
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 cache discovery service, explained in the next chapter.