请稍等 ...
×

采纳答案成功!

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

flannel网络插件安装(ARM64)

我的笔记本是mac m2,使用的是VMware Fusion,虚拟机使用的是CentIOS 7 Arm64
因此未使用kubectl apply -f kubeblog/docs/Chapter4/flannel.yaml,使用的是kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml,输出如下:

namespace/kube-flannel created
clusterrole.rbac.authorization.k8s.io/flannel created
clusterrolebinding.rbac.authorization.k8s.io/flannel created
serviceaccount/flannel created
configmap/kube-flannel-cfg created
daemonset.apps/kube-flannel-ds created

使用docker images查看镜像,如下:

REPOSITORY                                                        TAG        IMAGE ID       CREATED        SIZE
flannel/flannel-cni-plugin                                        v1.1.2     b45062ceea49   6 months ago   7.76MB
registry.aliyuncs.com/google_containers/kube-proxy                v1.19.3    9fdc62aa33d0   2 years ago    116MB
registry.aliyuncs.com/google_containers/kube-apiserver            v1.19.3    0e7c54b13941   2 years ago    110MB
registry.aliyuncs.com/google_containers/kube-controller-manager   v1.19.3    ef1814513b01   2 years ago    103MB
registry.aliyuncs.com/google_containers/kube-scheduler            v1.19.3    8b97cd6f6089   2 years ago    42.6MB
registry.aliyuncs.com/google_containers/etcd                      3.4.13-0   05b738aa1bc6   2 years ago    312MB
registry.aliyuncs.com/google_containers/coredns                   1.7.0      db91994f4ee8   3 years ago    42.8MB
registry.aliyuncs.com/google_containers/pause                     3.2        2a060e2e7101   3 years ago    484kB

使用ifconfig | grep flan输出如下:

flannel.1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1450

使用kubectl get node输出如下:

NAME     STATUS   ROLES    AGE   VERSION
master   Ready    master   40m   v1.19.3

使用kubectl get pod -n kube-system输出如下:

NAME                             READY   STATUS    RESTARTS   AGE
coredns-6d56c8448f-49dcc         1/1     Running   0          31m
coredns-6d56c8448f-qvqx4         1/1     Running   0          31m
etcd-master                      1/1     Running   0          31m
kube-apiserver-master            1/1     Running   0          31m
kube-controller-manager-master   1/1     Running   0          31m
kube-proxy-gkd72                 1/1     Running   0          31m
kube-scheduler-master            1/1     Running   0          31m

未看到kube-flannel-ds-XXXXX这个pod,请问是什么原因?是不是代表flannel网络插件安装失败?

注:
使用docker ps -a | grep Exited输出如下:

cfa54d293942   flannel/flannel                                     "cp -f /etc/kube-fla…"   13 minutes ago   Exited (0) 13 minutes ago             k8s_install-cni_kube-flannel-ds-pjt79_kube-flannel_1d40447d-9dcc-46d2-916c-8787984476cb_0
dca0e0e2e02a   flannel/flannel-cni-plugin                          "cp -f /flannel /opt…"   14 minutes ago   Exited (0) 14 minutes ago             k8s_install-cni-plugin_kube-flannel-ds-pjt79_kube-flannel_1d40447d-9dcc-46d2-916c-8787984476cb_0

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

1回答

清风 2023-06-30 13:13:22

能否看看flannel 的日志?

0 回复 有任何疑惑可以回复我~
  • 清风 #1
    如果重启后发现flannel 无法启动,可以手动启动 flannel
    
    kubectl apply -f https://github.com/flannel-io/flannel/blob/629cd70d816e56853aac967f92ed3dade7275baf/Documentation/kube-flannel.yml
    回复 有任何疑惑可以回复我~ 2023-07-01 11:37:13
  • 提问者 Victory_Liu 回复 清风 #2
    kubectl get pod -A
    NAMESPACE      NAME                             READY   STATUS    RESTARTS   AGE
    kube-flannel   kube-flannel-ds-pjt79            1/1     Running   0          47m
    kube-system    coredns-6d56c8448f-49dcc         1/1     Running   0          77m
    kube-system    coredns-6d56c8448f-qvqx4         1/1     Running   0          77m
    kube-system    etcd-master                      1/1     Running   0          77m
    kube-system    kube-apiserver-master            1/1     Running   0          77m
    kube-system    kube-controller-manager-master   1/1     Running   0          77m
    kube-system    kube-proxy-gkd72                 1/1     Running   0          77m
    kube-system    kube-scheduler-master            1/1     Running   0          77m
    回复 有任何疑惑可以回复我~ 2023-07-05 10:02:27
  • 提问者 Victory_Liu #3
    kubectl logs -f -n `(kubectl get pod -A | grep "kube-flannel-ds" | awk '{print $1" "$2}' | head -1 )`
    I0628 19:15:26.554535       1 main.go:212] CLI flags config: {etcdEndpoints:http://127.0.0.1:4001,http://127.0.0.1:2379 etcdPrefix:/coreos.com/network etcdKeyfile: etcdCertfile: etcdCAFile: etcdUsername: etcdPassword: version:false kubeSubnetMgr:true kubeApiUrl: kubeAnnotationPrefix:flannel.alpha.coreos.com kubeConfigFile: iface:[] ifaceRegex:[] ipMasq:true ifaceCanReach: subnetFile:/run/flannel/subnet.env publicIP: publicIPv6: subnetLeaseRenewMargin:60 healthzIP:0.0.0.0 healthzPort:0 iptablesResyncSeconds:5 iptablesForwardRules:true netConfPath:/etc/kube-flannel/net-conf.json setNodeNetworkUnavailable:true useMultiClusterCidr:false}
    W0628 19:15:26.554566       1 client_config.go:617] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.
    回复 有任何疑惑可以回复我~ 2023-07-05 10:05:14
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信