k8s——排错指南

一般的k8s排错步骤:查看node状态→查看pod状态→查看kubelet系统日志

一、常用命令:

1、查看各节点状态:kubectl get node <node - name>

2、查看node事件:kubectl describe node <node - name>

3、查看Pod状态:kubectl get pod -o wide

4、查看Pod事件:kubectl describe pod <pod - name>

5、查看Pod日志文件:kubectl logs -f <pod - name>

6、进入pod内部:kubectl exec -it <pod - name> /bin/bash

7、查看系统Kubelet 日志: journalctl -l -u kubelet -n 1000

8、查询副本编辑器:kubectl get rc <pod - name>

9、修改rc环境变量: kubectl edit pod | grep <pod - name>

二、常见错误:

1、The connection to the server localhost:8080 was refused - did you specify the right host or port?


 1. echo "export KUBECONFIG=/etc/kubernetes/admin.conf" >> ~/.bash_profile
 2. source ~/.bash_profile

2、#failed to read pod IP from plugin/docker: NetworkPlugin cni failed on the status hook for pod “nginx-ingress-controller-7bff4d7c6-n7g62_default”: CNI failed to retrieve network namespace path: cannot find network namespace for the terminated container

重启docker服务

systemctl restart docker

k8s pod排除指南

  • 1
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值