【问题标题】:i deleted the core dns using kubectl delete deployment coredns -n kube-system我使用 kubectl delete deployment coredns -n kube-system 删除了核心 dns
【发布时间】:2020-12-07 10:11:29
【问题描述】:

我使用 kubectl delete deployment coredns -n kube-system 不小心删除了核心 DNS 如何让 coredns pod 再次运行....

I recreated the coredns using kubectl create deployment coredns -n kube-system --image=k8s.gcr.io/coredns:1.7.0 but nslookup is failing is there any way to correct it. root@km1:~# kubectl get pods --all-namespaces -o wide
NAMESPACE     NAME                                       READY   STATUS    RESTARTS   AGE   IP              NODE   NOMINATED NODE   READINESS GATES
default       dnsutils                                   2/2     Running   9          22h   10.10.159.72    kw1    <none>           <none>
kube-system   calico-kube-controllers-5c6f6b67db-mp9jg   1/1     Running   2          26h   10.10.132.201   km1    <none>           <none>
kube-system   calico-node-fscgw                          1/1     Running   2          26h   192.168.0.215   km1    <none>           <none>
kube-system   calico-node-m78kx                          1/1     Running   1          25h   192.168.0.204   kw1    <none>           <none>
kube-system   coredns-5646d5bb85-77pxl                   1/1     Running   0          12m   10.10.159.74    kw1    <none>           <none>
kube-system   etcd-km1                                   1/1     Running   2          26h   192.168.0.215   km1    <none>           <none>
kube-system   kube-apiserver-km1                         1/1     Running   2          26h   192.168.0.215   km1    <none>           <none>
kube-system   kube-controller-manager-km1                1/1     Running   3          26h   192.168.0.215   km1    <none>           <none>
kube-system   kube-proxy-h5pz5                           1/1     Running   1          25h   192.168.0.204   kw1    <none>           <none>
kube-system   kube-proxy-qdp4w                           1/1     Running   2          26h   192.168.0.215   km1    <none>           <none>
kube-system   kube-scheduler-km1                         1/1     Running   3          26h   192.168.0.215   km1    <none>           <none>

【问题讨论】:

    标签: kubernetes coredns


    【解决方案1】:

    github 上的官方 coredns repo 提供了生成 coredns yaml 文件的 deploy.sh 脚本。 Checkout this link.

    您需要做的就是克隆 repo,进入 deployment/kubernetes 目录并运行:

    $ ./deploy.sh | kubectl apply -f -
    

    【讨论】:

      猜你喜欢
      • 2021-01-01
      • 2017-09-17
      • 2017-08-30
      • 2018-03-30
      • 1970-01-01
      • 2018-12-18
      • 2019-07-06
      • 2019-03-16
      • 1970-01-01
      相关资源
      最近更新 更多