kube-proxy CrashLoopBackOff

问题如下:

kubectl get pods -A -owide
NAMESPACE     NAME                                  READY   STATUS             RESTARTS         AGE    IP              NODE          NOMINATED NODE   READINESS GATES
default       my-nginx                              1/1     Running            84 (6m55s ago)   24h    10.244.1.10     k8s-node1     <none>           <none>
kube-system   coredns-857d9ff4c9-9vw86              1/1     Running            3 (13h ago)      5d6h   10.244.0.9      k8s-master2   <none>           <none>
kube-system   coredns-857d9ff4c9-fxglw              1/1     Running            3 (13h ago)      5d6h   10.244.0.8      k8s-master2   <none>           <none>
kube-system   etcd-k8s-master2                      1/1     Running            7 (13h ago)      5d6h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-apiserver-k8s-master2            1/1     Running            9 (13h ago)      5d6h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-controller-manager-k8s-master2   1/1     Running            3 (13h ago)      5d6h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-proxy-hxq4l                      0/1     CrashLoopBackOff   10 (4m54s ago)   46m    192.168.56.12   k8s-node2     <none>           <none>
kube-system   kube-proxy-s8d7t                      0/1     CrashLoopBackOff   10 (53s ago)     46m    192.168.56.11   k8s-node1     <none>           <none>
kube-system   kube-proxy-vckjv                      1/1     Running            3 (13h ago)      5d6h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-scheduler-k8s-master2            1/1     Running            8 (13h ago)      5d6h   192.168.1.100   k8s-master2   <none>           <none>

一番查找问题后,发现是犹豫master有2个默认网关导致的。估计是混淆了。

ip route show default
default via 192.168.56.1 dev enp0s3 proto static
default via 192.168.1.1 dev enp0s8 proto static

于时删除一个就好了:sudo ip route del default via 192.168.1.1

kubectl get pods -A -owide
NAMESPACE     NAME                                  READY   STATUS             RESTARTS        AGE    IP              NODE          NOMINATED NODE   READINESS GATES
default       my-nginx                              0/1     CrashLoopBackOff   84 (64s ago)    24h    10.244.1.11     k8s-node1     <none>           <none>
kube-system   coredns-857d9ff4c9-9vw86              1/1     Running            3 (13h ago)     5d6h   10.244.0.9      k8s-master2   <none>           <none>
kube-system   coredns-857d9ff4c9-fxglw              1/1     Running            3 (13h ago)     5d6h   10.244.0.8      k8s-master2   <none>           <none>
kube-system   etcd-k8s-master2                      1/1     Running            7 (13h ago)     5d7h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-apiserver-k8s-master2            1/1     Running            9 (13h ago)     5d7h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-controller-manager-k8s-master2   1/1     Running            3 (13h ago)     5d7h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-proxy-rw4p4                      1/1     Running            0               7s     192.168.56.12   k8s-node2     <none>           <none>
kube-system   kube-proxy-s8d7t                      1/1     Running            11 (5m7s ago)   50m    192.168.56.11   k8s-node1     <none>           <none>
kube-system   kube-proxy-vckjv                      1/1     Running            3 (13h ago)     5d6h   192.168.1.100   k8s-master2   <none>           <none>
kube-system   kube-scheduler-k8s-master2            1/1     Running            8 (13h ago)     5d7h   192.168.1.100   k8s-master2   <none>           <none>
posted on 2024-05-26 11:00  iTrice  阅读(7)  评论(0编辑  收藏  举报