k8s问题收集

时间:2024-07-28 14:05:44
问题 解决
failed: rpc error: code = Unknown desc = NetworkPlugin cni failed to set up 
pod "*****" network: f
ailed to set bridge addr: "cni0" already has an IP address different from 10.244.2.1/24
12252 cni.go:227] Error while adding to cni network:
failed to set bridge addr: "cni0" already
kubeadm reset
systemctl stop kubelet
systemctl stop docker
rm -rf /var/lib/cni/
rm -rf /var/lib/kubelet/*
rm -rf /etc/cni/
ifconfig cni0 down
ifconfig flannel.1 down
ifconfig docker0 down
ip link delete cni0
ip link delete flannel.1
systemctl start docker
 kubectl label nodes <node-name> <label-key>=<label-value>   label-value不能为数字

kubernetes启动Pod遇到CrashLoopBackOff的解决思路

查看对应容器日志内容

kubectl logs

Error from server (BadRequest): a container name must be specified

for pod redis-ha-server-0, choose one of: [redis sentinel]
or one of the init containers: [config-init]

kubectl logs pod名字 容器名字

eg:kubectl logs redis config-init