返回顶部
首页 > 资讯 > 服务器 >【水文】calico-node 启动失败 Init:CrashLoopBackOff
  • 697
分享到

【水文】calico-node 启动失败 Init:CrashLoopBackOff

服务器linuxcalico 2023-09-01 09:09:38 697人浏览 泡泡鱼
摘要

查看日志报错如下  Defaulted container "calico-node" out of: calico-node, upgrade-ipam (init), install-cni (init), mount-bpffs (i

查看日志报错如下 

Defaulted container "calico-node" out of: calico-node, upgrade-ipam (init), install-cni (init), mount-bpffs (init)
Error from server (BadRequest): container "calico-node" in pod "calico-node-4j7td" is waiting to start: PodInitializing

结果:kube-proxy没启动,每个人的环境不同,需要具体排查看日志。下面是分析过程。

一直没看懂上面第一条啥意思,之前搞calico遇到过各种问题,潜意识觉得calico难搞就无脑搜啊搜,以为是疑难杂症,后来网上看到几个相同第一条报错的,才知道没啥价值,浪费了好多时间。

具体错误如下:

[root@k8s-master01 ~]# kubectl logs -n kube-system calico-node-4j7tdDefaulted container "calico-node" out of: calico-node, upgrade-ipam (init), install-cni (init), mount-bpffs (init)Error from server (BadRequest): container "calico-node" in pod "calico-node-4j7td" is waiting to start: PodInitializing[root@k8s-master01 ~]# kubectl get po -A -owideNAMESPACE     NAME           READY   STATUS                  RESTARTS         AGE   IP                NODE           NOMINATED NODE   READINESS GATESkube-system   calico-kube-controllers-6747f75cdc-pzhhj   1/1     Running                 0                52m   172.27.14.194     k8s-node02                kube-system   calico-node-4j7td                          0/1     Init:CrashLoopBackOff   16 (3m58s aGo)   43m   192.168.145.161   k8s-master01              kube-system   calico-node-hwttj                          1/1     Running                 0                52m   192.168.145.162   k8s-master02              

【精要】在这个启动失败的节点上,查看容器的日志,如果看不到运行中的容器,就查看exited的容器,如下:

[root@k8s-master01 ~]# crictl psCONTAINER           IMAGE               CREATED             STATE               NAME                ATTEMPT             POD ID              POD[root@k8s-master01 ~]# crictl ps -aCONTAINER           IMAGE               CREATED             STATE               NAME                ATTEMPT             POD ID              POD6e2c272bcbd41       8479c67f450d3       4 minutes ago       Exited              install-cni         17                  0b0d02f6ac576       calico-node-4j7td5c5f54bbda5db       8479c67f450d3       50 minutes ago      Exited              upgrade-ipam        1                   0b0d02f6ac576       calico-node-4j7td[root@k8s-master01 ~]# crictl logs 6e2c272bcbd41time="2022-12-01T15:36:27Z" level=info msg="Running as a kubernetes pod" source="install.go:145"2022-12-01 15:36:28.196 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/bandwidth"2022-12-01 15:36:28.197 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/bandwidth2022-12-01 15:36:28.297 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/calico"2022-12-01 15:36:28.297 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/calico2022-12-01 15:36:28.373 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/calico-ipam"2022-12-01 15:36:28.373 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/calico-ipam2022-12-01 15:36:28.376 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/flannel"2022-12-01 15:36:28.376 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/flannel2022-12-01 15:36:28.381 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/host-local"2022-12-01 15:36:28.381 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/host-local2022-12-01 15:36:28.447 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/install"2022-12-01 15:36:28.447 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/install2022-12-01 15:36:28.451 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/loopback"2022-12-01 15:36:28.451 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/loopback2022-12-01 15:36:28.455 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/portmap"2022-12-01 15:36:28.455 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/portmap2022-12-01 15:36:28.459 [INFO][1] cni-installer/ : File is already up to date, skipping file="/host/opt/cni/bin/tuning"2022-12-01 15:36:28.459 [INFO][1] cni-installer/ : Installed /host/opt/cni/bin/tuning2022-12-01 15:36:28.459 [INFO][1] cni-installer/ : Wrote Calico CNI binaries to /host/opt/cni/bin2022-12-01 15:36:28.494 [INFO][1] cni-installer/ : CNI plugin version: v3.25.0-0.dev-519-g2fee4ee0153D2022-12-01 15:36:28.494 [INFO][1] cni-installer/ : /host/secondary-bin-dir is not writeable, skippingW1201 15:36:28.494754       1 client_config.go:617] Neither --kubeconfig nor --master was specified.  Using the inClusterConfig.  This might not work.2022-12-01 15:36:49.499 [ERROR][1] cni-installer/ : Unable to create token for CNI kubeconfig error=Post "https://10.96.0.1:443/api/v1/namespaces/kube-system/serviceaccounts/calico-node/token": dial tcp 10.96.0.1:443: connect: connection refused2022-12-01 15:36:49.499 [FATAL][1] cni-installer/ : Unable to create token for CNI kubeconfig error=Post "Https://10.96.0.1:443/api/v1/namespaces/kube-system/serviceaccounts/calico-node/token": dial tcp 10.96.0.1:443: connect: connection refused[root@k8s-master01 ~]#[root@k8s-master01 ~]#[root@k8s-master01 ~]#[root@k8s-master01 ~]#[root@k8s-master01 ~]# kubectl get svcNAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGEkubernetes   ClusterIP   10.96.0.1            443/TCP   2d16h[root@k8s-master01 ~]# kubectl get svc  -ANAMESPACE     NAME           TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)    AGEdefault       kubernetes     ClusterIP   10.96.0.1               443/TCP    2d16hkube-system   calico-typha   ClusterIP   10.107.84.250           5473/TCP   64m[root@k8s-master01 ~]#[root@k8s-master01 ~]#[root@k8s-master01 ~]# telnet 10.96.0.1 443Trying 10.96.0.1...^C[root@k8s-master01 ~]# ping 10.96.0.1PING 10.96.0.1 (10.96.0.1) 56(84) bytes of data.^C--- 10.96.0.1 ping statistics ---1 packets transmitted, 0 received, 100% packet loss, time 0ms

上面发现10.96.0.1不通,去其他节点查看是通的

[root@k8s-node02 ~]#[root@k8s-node02 ~]# telnet 10.96.0.1 443Trying 10.96.0.1...Connected to 10.96.0.1.Escape character is '^]'.^CConnection closed by foreign host.[root@k8s-node02 ~]# ping 10.96.0.1PING 10.96.0.1 (10.96.0.1) 56(84) bytes of data.64 bytes from 10.96.0.1: icmp_seq=1 ttl=64 time=0.061 ms64 bytes from 10.96.0.1: icmp_seq=2 ttl=64 time=0.073 ms^C--- 10.96.0.1 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1057msrtt min/avg/max/mdev = 0.061/0.067/0.073/0.006 ms[root@k8s-node02 ~]# ping 10.96.0.1PING 10.96.0.1 (10.96.0.1) 56(84) bytes of data.64 bytes from 10.96.0.1: icmp_seq=1 ttl=64 time=0.056 ms64 bytes from 10.96.0.1: icmp_seq=2 ttl=64 time=0.067 ms^C--- 10.96.0.1 ping statistics ---2 packets transmitted, 2 received, 0% packet loss, time 1003msrtt min/avg/max/mdev = 0.056/0.061/0.067/0.009 ms

查看问题节点的代理服务kube-proxy,果然,这个居然是disable,郁闷,启动后,delete掉失败的pod,瞬间好了

[root@k8s-master01 ~]# systemctl status kube-proxy● kube-proxy.service - Kubernetes Kube Proxy   Loaded: loaded (/usr/lib/systemd/system/kube-proxy.service; disabled; vendor preset: disabled)   Active: inactive (dead)     Docs: https://GitHub.com/kubernetes/kubernetes[root@k8s-master01 ~]# systemctl enable --now kube-proxyCreated symlink from /etc/systemd/system/multi-user.target.wants/kube-proxy.service to /usr/lib/systemd/system/kube-proxy.service.[root@k8s-master01 ~]# systemctl status kube-proxy● kube-proxy.service - Kubernetes Kube Proxy   Loaded: loaded (/usr/lib/systemd/system/kube-proxy.service; enabled; vendor preset: disabled)   Active: active (running) since Thu 2022-12-01 23:43:25 CST; 2s ago     Docs: https://github.com/kubernetes/kubernetes Main PID: 20930 (kube-proxy)    Tasks: 7   Memory: 52.7M   CGroup: /system.slice/kube-proxy.service           └─20930 /usr/local/bin/kube-proxy --config=/etc/kubernetes/kube-proxy.yaml --v=2[root@k8s-master01 ~]# kubectl get po -A -owide -wNAMESPACE     NAME           READY   STATUS                  RESTARTS         AGE   IP                NODE           NOMINATED NODE   READINESS GATESkube-system   calico-kube-controllers-6747f75cdc-pzhhj   1/1     Running                 0                68m   172.27.14.194     k8s-node02                kube-system   calico-node-4j7td                          0/1     Init:CrashLoopBackOff   19 (3m27s ago)   58m   192.168.145.161   k8s-master01              kube-system   calico-node-hwttj                          1/1     Running                 0                68m   192.168.145.162   k8s-master02              kube-system   calico-node-rjbz8                          1/1     Running                 0                68m   192.168.145.163   k8s-master03              kube-system   calico-node-rmjqj                          1/1     Running                 1 (55m ago)      68m   192.168.145.165   k8s-node02                kube-system   calico-node-vd7w2                          1/1     Running                 0                68m   192.168.145.164   k8s-node01                kube-system   calico-typha-6cdc4b4fbc-sb85z              1/1     Running                 0                68m   192.168.145.164   k8s-node01                ^C[root@k8s-master01 ~]# kubectl delete po -n kube-system calico-node-4j7tdpod "calico-node-4j7td" deleted[root@k8s-master01 ~]# kubectl get po -A -owide -wNAMESPACE     NAME           READY   STATUS     RESTARTS      AGE   IP                NODE           NOMINATED NODE   READINESS GATESkube-system   calico-kube-controllers-6747f75cdc-pzhhj   1/1     Running    0             68m   172.27.14.194     k8s-node02                kube-system   calico-node-hwttj                          1/1     Running    0             68m   192.168.145.162   k8s-master02              kube-system   calico-node-jbvlc                          0/1     Init:1/3   0             2s    192.168.145.161   k8s-master01              kube-system   calico-node-rjbz8                          1/1     Running    0             68m   192.168.145.163   k8s-master03              kube-system   calico-node-rmjqj                          1/1     Running    1 (55m ago)   68m   192.168.145.165   k8s-node02                kube-system   calico-node-vd7w2                          1/1     Running    0             68m   192.168.145.164   k8s-node01                kube-system   calico-typha-6cdc4b4fbc-sb85z              1/1     Running    0             68m   192.168.145.164   k8s-node01                kube-system   calico-node-jbvlc                          0/1     Init:1/3   0             2s    192.168.145.161   k8s-master01              kube-system   calico-node-jbvlc                          0/1     Init:2/3   0             3s    192.168.145.161   k8s-master01              kube-system   calico-node-jbvlc                          0/1     PodInitializing   0             4s    192.168.145.161   k8s-master01              kube-system   calico-node-jbvlc                          0/1     Running           0             5s    192.168.145.161   k8s-master01              ^C[root@k8s-master01 ~]#

世上无难事,只怕有心人还不够,要有脑子,不要浪费不该浪费的时间。

来源地址:https://blog.csdn.net/womenrendeme/article/details/128140831

--结束END--

本文标题: 【水文】calico-node 启动失败 Init:CrashLoopBackOff

本文链接: https://www.lsjlt.com/news/387928.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
  • 【水文】calico-node 启动失败 Init:CrashLoopBackOff
    查看日志报错如下  Defaulted container "calico-node" out of: calico-node, upgrade-ipam (init), install-cni (init), mount-bpffs (i...
    99+
    2023-09-01
    服务器 linux calico
  • pm2启动node服务失败怎么办
    本教程操作环境:Windows10系统、node v14.15.5版、Dell G3电脑。pm2启动node服务失败怎么办?解决宝塔PM2启动node服务始终off无法映射问题翻了网上的很多资料,众说纷纭,官方没有给出明确的解决方案。在多次...
    99+
    2023-05-14
    pm2 node
  • pm2启动node服务失败如何解决
    这篇文章主要介绍“pm2启动node服务失败如何解决”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“pm2启动node服务失败如何解决”文章能帮助大家解决问题。pm2启动node服务失败的解决办法:1...
    99+
    2023-07-04
  • MySQL启动失败
    一、错误日志: [mysql@host-172-24-115-217 ~]$ service mysql restart Shutting down MySQL.. SUCCESS!  Start...
    99+
    2024-04-02
  • ORACLE OMS启动失败之BEA-300040 I/O error while writing node manager status
            今天处理一个oracle优化管理工具oms启动异常的问题。oms问题处理之前,oms所在服务器上的一套asm和db所用的审计目录文件系统inode耗尽导致asm和db异常宕机,经清理审...
    99+
    2023-06-05
  • oracle服务OracleDBConsoleorcl启动失败
    今天想访问oracle的em服务,但是死活进不去,百度告知说是没有启动OracleDBConsoleorcl服务,进入服务,右击启动,提示错误,百度很久,最终解决方案如下:1:cmd命令行运行emctl s...
    99+
    2024-04-02
  • redis配置文件启动失败如何解决
    如果 Redis 配置文件启动失败,可以尝试以下方法解决:1. 检查配置文件路径是否正确:确保配置文件的路径是正确的,可以使用绝对路...
    99+
    2023-09-11
    redis
  • Android studio模拟器启动失败
    我自己在使用的过程中遇见的问题,百度找了很久才找到合适的方法。 报错如下: Emulator: emulator: ERROR: Unknown...
    99+
    2022-06-06
    Android Studio studio 启动 Android
  • hbase 0.90.4 + zookeeper 3.3.3 hbase 启动失败
    报错:Couldnt start ZK at requested address of 2181, instead got: 2182. Aborting. Why Because clients (eg ...
    99+
    2024-04-02
  • mongoDB启动失败问题解决
    system :centOS 5.5  View Log:...
    99+
    2024-04-02
  • Oracle RAC启动失败(DNS故障)
    问题: 数据库启动报错:ORA-00119、ORA-00132等 环境: DB:Oracle 11.2.0.4.0 OS:Redhat 6.5 问题现象: 启动数据库报错: [g...
    99+
    2024-04-02
  • DockerDesktop启动失败的解决(DockerfailedtoinitializeDockerDesktopisshuttingdown)
    目录问题记录:解决方法:问题记录: 有一段时间没有使用docker了,突然要用到结果发现docker desktop都打不开了,会弹出如下错误: 一开始考虑的是会不会是docker...
    99+
    2024-04-02
  • ubuntu启动mysql失败怎么办
    ubuntu中启动mysql失败的解决方法当mysql无法启动时,可以通过dpkg-reconfigure方式对MySQL进行修改,即可解决,步骤如下:首先,ubuntu命令行中执行dpkg-reconfigure命令,对MySQL进行修复...
    99+
    2024-04-02
  • mysql启动失败怎么回事
    mysql启动失败的原因有以下几种原因一:mysql服务名无效导致启动失败解决方法:首先,使用组合键“win+R”运行cmd,进入命令提示符窗口;进入到命令提示符窗口后,在命令行中执行以下命令将mysql服务删除;mysqld –remov...
    99+
    2024-04-02
  • mysql服务怎么启动失败
    启动mysql服务失败的原因有以下几点一、缺乏data文件,导致无法启动解决方法:使用组合键“win+R”运行cmd,进入DOS窗口;进入DOS窗口后,在DOS查看中使用以下命令进行恢复data文件;mysqld --initialize ...
    99+
    2024-04-02
  • nginx启动失败如何解决
    这篇文章主要介绍了nginx启动失败如何解决的相关知识,内容详细易懂,操作简单快捷,具有一定借鉴价值,相信大家阅读完这篇nginx启动失败如何解决文章都会有所收获,下面我们一起来看看吧。操作首先nginx不是自己部署,要先启动一下docke...
    99+
    2023-06-29
  • lower_case_table_names=1 mysql启动失败问题
    1先停掉mysql数据库 2删除mysql数据,在初始话时,数据所在的位置 3修改/etc/my.cnf配置,添加lower_case_table_names=1 4重新初始化 ./mysqld ...
    99+
    2023-08-31
    mysql 数据库 java
  • TOMCAT 启动失败 using catalina_opts为空
    环境 Tomcat版本:10.1.6 jdk版本:jdk-19.0.2 电脑系统:win10 具体情况 已经配置TomCat环境,JAVA_HOME已经配置,java-version测试成功 双击startup_bat闪退或在c...
    99+
    2023-09-01
    tomcat java Powered by 金山文档
  • Keepalived 启动失败解决方案
    启动Keepalived服务时发现启动失败,于是查看了日志 (/var/log/messages)如图所示   这条信息--WARNING - interface eth0 for vrrp_instance VI_1 doesn't ex...
    99+
    2023-09-07
    linux 服务器 运维
  • wsa启动失败如何解决
    这篇文章主要介绍“wsa启动失败如何解决”的相关知识,小编通过实际案例向大家展示操作过程,操作方法简单快捷,实用性强,希望这篇“wsa启动失败如何解决”文章能帮助大家解决问题。方法一: 首先打开“设置”接着进入左边栏的“应用”然后进入右上角...
    99+
    2023-07-02
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作