Flush CoreDNS Cache on Kubernetes Cluster Flush CoreDNS Cache on Kubernetes Cluster kubernetes kubernetes

Flush CoreDNS Cache on Kubernetes Cluster


@coollinuxoid's answer is not suitable for production environment, it will have temporary downtime because the commands will terminate all pods at the same time. Instead, you should use kubernetes deployment's rolling update mechanism by setting an environment variable to avoid the downtime with command:

kubectl -n kube-system set env deployment.apps/coredns FOO="BAR"


The best way, as you said, would be restarting coredns pods. This can be done easily, by scaling the coredns deployment to "0" and then, scale it back to the desired number.Like in the sample command below:

kubectl scale deployment.apps/coredns -n kube-system --replicas=0kubectl scale deployment.apps/coredns -n kube-system --replicas=2


execute this in each rabbitmq pod to remove mnesia, then restart pods

rm -rf /bitnami/rabbitmq/mnesia