Removing Cache Server(s) in AKS at Runtime
In case you need to remove a cache server from the cache cluster at runtime, you can do so by using NCache management tools and NCache deployment in AKS cluster.
Follow the steps provided below to remove cache servers in your Azure Kubernetes cluster at runtime.
Important
Stop cache on the node(s) that needs to be removed. You can stop cache on any node through NCache Web Manager or NCache PowerShell Tool.
Removing cache server(s) from NCache cluster
Cache servers can be removed from an NCache cluster through the following ways:
Follow these steps to remove cache servers through NCache Web Manager.
- Access NCache Web Manager from [gatewayIPAddress]:8251
- Go to Remove Server Nodes through Web Manager and follow the steps mentioned there to remove cache servers from the cluster.
To remove cache servers through PowerShell, follow the steps mentioned in Remove Server Nodes through PowerShell.
Removing cache server(s) from deployment
After you have removed the required node(s) from the cluster, you need to decrease the replica count in the NCache deployment pod so that the changes made are in sync with each other.
Follow these steps to decrease replica count in the deployment file.
Execute the following command in the Azure Cloud Shell to decrease the number of replicas in the deployment.
kubectl scale --replicas=number_of_remaining_server_nodes deployment/ncache
You can also decrease the number of replicas from the created YAML file ncache.yaml.
- Open ncache.yaml in a Notepad and update
replicas
count under thespec
tag according to your requirement. - After the YAML file has been modified, run the following command in Azure Cloud Shell to apply the changes made to the deployment.
batchfile kubectl apply -f [dir]/ncache.yaml
- Open ncache.yaml in a Notepad and update
After required cache servers have been removed from the cache cluster, you can view these changes from the NCache Web Manager. You can also monitor the cluster and checks its stats. See Monitor NCache Cluster and Clients
See Also
Create Cache Cluster in AKS
Monitor NCache Cluster and Clients in AKS
Adding Cache Servers in AKS at Runtime