[k8s]node-local-dns CrashLoopBackOff

1. 修改配置文件

/etc/kubernetes/plugins/dns-cache/nodelocaldns.yaml

sed 's/k8s.gcr.io/gcr.azk8s.cn\/google_containers/g
s/__PILLAR__DNS__SERVER__/192.168.0.10/g
s/__PILLAR__UPSTREAM__SERVERS__/192.168.120.52/g
s/__PILLAR__DNS__DOMAIN__/cluster.local/g' nodelocaldns.yaml |
kubectl apply -n kube-system -f -

2. 查看 DNSUPstream

[root@m1 ~]# kubectl get svc -n kube-system | grep dns
kube-dns            ClusterIP   192.168.0.10     <none>        53/UDP,53/TCP,9153/TCP   6d20h
kube-dns-upstream   ClusterIP   192.168.120.52   <none>        53/UDP,53/TCP            6d20h
node-local-dns      ClusterIP   None             <none>        9253/TCP                 6d20h

3. 删除pod

posted @ 2022-08-25 10:29  LeoShi2020  阅读(436)  评论(0编辑  收藏  举报