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 Management Center 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 Management Center from [gatewayIPAddress]:8251
- Go to Remove Server Nodes through NCache Management Center 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
# Operator Deployment
- Open ncache.yaml in a Notepad and update
Execute the following command on the Azure Cloud Shell to decrease the number of cache replicas in your deployment.
kubectl scale --clusterSize=number_of_remaining_servers ncache/ncache
- Replica count can also be decreased manually by modifying ncache_custom_resource.yaml file.
- Access ncache_custom_resource.yaml file by executing the following command:
bathcfile kubectl edit ncache ncache
- Modify
clusterSize
under thespec
tag according to your requirement.
- Access ncache_custom_resource.yaml file by executing the following command:
After required cache servers have been removed from the cache cluster, you can view these changes from the NCache Management Center. 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