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?
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
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
.