我是靠谱客的博主 重要小丸子,最近开发中收集的这篇文章主要介绍解决 calico-node 无法启动问题,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

参考

  • Calico node failed to start
  • Calico 问题排障
  • Kubernetes集群之清除集群
  • 【K8S】集群卸载清理
  • K8S问题解决

calico 打印日志问题太少解决

至此,问题原因仍毫无头绪。只好找来 calico node的启动代码 来看看。

期间发现,calico node启动时是依据CALICO_STARTUP_LOGLEVEL环境变量来设置log级别。考虑到出问题的calico node输出的log实在是太少,修改calico node的daemonset配置,将log等级设置成最低的DEBUG级别:

spec:
  containers:
  - env:
    - name: CALICO_STARTUP_LOGLEVEL
      value: DEBUG

重启问题节点的calico-node,果然输出了更多的log:

2022-07-31 13:24:50.867 [DEBUG][9] startup/interfaces.go 78: Querying interface addresses Interface="ens192"
2022-07-31 13:24:50.867 [DEBUG][9] startup/interfaces.go 98: Found valid IP address and network CIDR=fe80::250:56ff:fe91:4143/64
2022-07-31 13:24:50.867 [DEBUG][9] startup/filtered.go 42: Check interface Name="ens192"
2022-07-31 13:24:50.867 [DEBUG][9] startup/filtered.go 44: Check address CIDR=fe80::250:56ff:fe91:4143/64
2022-07-31 13:24:50.867 [WARNING][9] startup/startup.go 709: Unable to auto-detect an IPv6 address: no valid IPv6 addresses found on the host interfaces
2022-07-31 13:24:50.867 [WARNING][9] startup/startup.go 509: Couldn't autodetect an IPv6 address. If auto-detecting, choose a different autodetection method. Otherwise provide an explicit address.
2022-07-31 13:24:50.867 [INFO][9] startup/startup.go 360: Clearing out-of-date IPv4 address from this node IP="10.10.32.23/24"
2022-07-31 13:24:50.867 [INFO][9] startup/startup.go 364: Clearing out-of-date IPv6 address from this node IP=""
2022-07-31 13:24:50.867 [DEBUG][9] startup/k8s.go 533: Performing 'Update' for &{Key:Node(node01) Value:0xc0000cfa00 Revision:12283 UID:<nil> TTL:0s}
2022-07-31 13:24:50.867 [DEBUG][9] startup/node.go 75: Received Update request on Node type
2022-07-31 13:24:50.869 [DEBUG][9] startup/node.go 471: Loaded label annotations k8s=map[string]string{"beta.kubernetes.io/arch":"amd64", "beta.kubernetes.io/os":"linux", "kubernetes.io/arch":"amd64", "kubernetes.io/hostname":"node01", "kubernetes.io/os":"linux"}

解决方法

从上面错误日志可以看出:

  • 虽然网卡有 ipv6 地址,但是 calico-node 无法获取到,目前不清楚原因
  • 因此尝试关闭对 ipv6 的支持,calico-node 变为正常
# 6. 关键点:调整部署参数,支持ipv6:
# !!! cluster-1 开启 ipv6 没问题,cluster-2 开启 ipv6 有问题,此处建议「先不开启 ipv6 也就是 false」
# !!! 待排查原因
# 采用 kubespray 1.18 版本
vi inventory/mizarcluster(此处名字替换为自己的)/group_vars/k8s_cluster/k8s-cluster.yml
enable_dual_stack_networks: false

最后

以上就是重要小丸子为你收集整理的解决 calico-node 无法启动问题的全部内容,希望文章能够帮你解决解决 calico-node 无法启动问题所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(78)

评论列表共有 0 条评论

立即
投稿
返回
顶部