此环境是有TF(tungstenfabric) 部署的,采用的k8s版本是1.12,coredns是1.2.2
pod就是循环重启
[root@opcontroller ~]# kubectl get pod -n kube-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINAT NODE
coredns-576cbf47c7-v4hkl 0/1 CrashLoopBackOff 36 161m 10.47.255.251 opcompute <none>
coredns-576cbf47c7-xtrfb 0/1 CrashLoopBackOff 36 160m 10.47.255.252 opcompute <none>
[root@opcontroller ~]# kubectl describe pod coredns-576cbf47c7-v4hkl -n kube-system
解决办法:
1 [root@opcontroller ~]# kubectl get cm coredns -o yaml -n kube-system
2 apiVersion: v1
3 data:
4 Corefile: |
5 .:53 {
6 errors
7 health
8 kubernetes cluster.local in-addr.arpa ip6.arpa {
9 pods insecure
10 upstream
11 fallthrough in-addr.arpa ip6.arpa
12 }
13 prometheus :9153
14 proxy . /etc/resolv.conf
15 cache 30
16 loop #删除此处即可
17 reload
18 loadbalance
19 }
20 kind: ConfigMap
21 metadata:
22 creationTimestamp: 2020-01-03T23:56:52Z
23 name: coredns
24 namespace: kube-system
25 resourceVersion: "221"
26 selfLink: /api/v1/namespaces/kube-system/configmaps/coredns
27 uid: b6e7d450-2e84-11ea-ae57-000c2939e87
[root@opcontroller ~]# kubectl delete pods coredns-576cbf47c7-v4hkl -n kube-system
pod "coredns-576cbf47c7-v4hkl" deleted
过一会k8s会自动拉起