How to disable Kube-DNS on GKE

1k Views Asked by At

I have a CoreDNS running in our cluster that uses the Kube DNS service. I want to disable the AutoScaler and the Kube-DNS deployment or scale it to 0.

As soon as I do this, however, it is always automatically scaled up to 2. What can I do?

1

There are 1 best solutions below

3
Wytrzymały Wiktor On

The scenario you are going through is described by the official documentation.

  • Make sure that you created your custom CoreDNS as described here.

  • Disable the kube-dns managed by GKE by scaling the kube-dns Deployment and autoscaler to zero using the following command:


kubectl scale deployment --replicas=0 kube-dns-autoscaler --namespace=kube-system
kubectl scale deployment --replicas=0 kube-dns --namespace=kube-system

  • If the above command will still not work than try the following one:

kubectl scale --replicas=0 deployment/kube-dns-autoscaler --namespace=kube-system 

kubectl scale --replicas=0 deployment/kube-dns --namespace=kube-system

Remember to specify the namespace.