简体   繁体   English

如何在 GKE 上禁用 Kube-DNS

[英]How to disable Kube-DNS on GKE

I have a CoreDNS running in our cluster that uses the Kube DNS service.我有一个在我们的集群中运行的 CoreDNS,它使用 Kube DNS 服务。 I want to disable the AutoScaler and the Kube-DNS deployment or scale it to 0.我想禁用 AutoScaler 和 Kube-DNS 部署或将其缩放为 0。

As soon as I do this, however, it is always automatically scaled up to 2. What can I do?但是,一旦我这样做,它总是自动放大到 2。我该怎么办?

The scenario you are going through is described by the official documentation . 官方文档描述了您正在经历的场景。

  • Make sure that you created your custom CoreDNS as described here .确保您已按照此处所述创建自定义 CoreDNS。

  • Disable the kube-dns managed by GKE by scaling the kube-dns Deployment and autoscaler to zero using the following command:通过使用以下命令将 kube-dns Deployment 和 autoscaler 缩放为零来禁用由 GKE 管理的 kube-dns:


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 .请记住指定namespace

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM