请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

flannel安装出现CrashLoopBackOff

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
老师,打扰,部署master节点后报了这个错误,上面那个地址,浏览器都打不开,https://github.com/,https://raw.githubusercontent.com/,访问不通。

[root@master ~]# kubectl get pod -n kube-system
NAME                             READY   STATUS             RESTARTS   AGE
coredns-6d56c8448f-gz8dj         1/1     Running            1          22d
coredns-6d56c8448f-nbbsv         1/1     Running            1          22d
etcd-master                      1/1     Running            1          22d
kube-apiserver-master            1/1     Running            1          22d
kube-controller-manager-master   1/1     Running            2          22d
kube-flannel-ds-6b7x2            0/1     CrashLoopBackOff   7          20d
kube-flannel-ds-9kggt            0/1     CrashLoopBackOff   68         22d
kube-proxy-m69gv                 1/1     Running            0          20d
kube-proxy-wtp7n                 1/1     Running            1          22d
kube-scheduler-master            1/1     Running            3          22d

然后想执行kubectl apply -f kubeblog/docs/Chapter4/flannel.yaml试下。
报了这个错误

podsecuritypolicy.policy/psp.flannel.unprivileged configured
clusterrole.rbac.authorization.k8s.io/flannel unchanged
clusterrolebinding.rbac.authorization.k8s.io/flannel unchanged
serviceaccount/flannel unchanged
configmap/kube-flannel-cfg unchanged
daemonset.apps/kube-flannel-ds unchanged

正在回答 回答被采纳积分+3

1回答

清风 2024-04-18 11:42:00
kubectl logs -f -n `(kubectl get pod -A | grep "kube-flannel-ds" | awk '{print $1" "$2}' | head -1 )`

看下flannel pod的日志

0 回复 有任何疑惑可以回复我~
  • 提问者 慕粉4100485 #1
    E0417 11:44:02.361728       1 reflector.go:140] github.com/flannel-io/flannel/pkg/subnet/kube/kube.go:487: Failed to watch *v1.Node: failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-flannel:flannel" cannot list resource "nodes" in API group "" at the cluster scope
    W0417 11:44:45.311273       1 reflector.go:424] github.com/flannel-io/flannel/pkg/subnet/kube/kube.go:487: failed to list *v1.Node: nodes is forbidden: User "system:serviceaccount:kube-flannel:flannel" cannot list resource "nodes" in API group "" at the cluster scope
    回复 有任何疑惑可以回复我~ 2024-04-22 18:44:50
  • 提问者 慕粉4100485 #2
    老师,报了这个错误
    回复 有任何疑惑可以回复我~ 2024-04-22 18:45:21
  • 提问者 慕粉4100485 #3
    NAME                             READY   STATUS             RESTARTS   AGE
    coredns-6d56c8448f-gz8dj         1/1     Running            1          23d
    coredns-6d56c8448f-nbbsv         1/1     Running            1          23d
    etcd-master                      1/1     Running            1          23d
    kube-apiserver-master            1/1     Running            1          23d
    kube-controller-manager-master   1/1     Running            2          23d
    kube-flannel-ds-6b7x2            0/1     CrashLoopBackOff   7          21d
    kube-flannel-ds-9kggt            1/1     Running            69         23d
    kube-proxy-m69gv                 1/1     Running            0          21d
    kube-proxy-wtp7n                 1/1     Running            1          23d
    kube-scheduler-master            1/1     Running            3          23d
    回复 有任何疑惑可以回复我~ 2024-04-22 18:46:57
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信