Kubernetes 故障修复
初始化报错
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: E1115 15:55:45.917967 13996 remote_runtime.go:948] “Status from runtime service failed” err=”rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”
time=”2022-11-15T15:55:45+08:00” level=fatal msg=”getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService”
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with--ignore-preflight-errors=...
To see the stack trace of this error execute with —v=5 or higher
1 | rm /etc/containerd/config.toml |
CoreDNS 报错
CoreDNS 一直处于创建(ContainerCreating)状态
1 |
|
cni0 网桥配置了一个不同网段的 IP 地址所导致的,做法是删除 cni0,让网络插件重新自动创建。
由于 cni0 是作为 Docker 的网桥,因此需要暂停 Docker 和 K8s。
1 | kubeadm reset |
然后重新初始化,添加 Flannel 组件
1 | systemctl start kubelet & systemctl start docker |
重启后查询 node 报错
The connection to the server 192.168.254.101:6443 was refused - did you specify the right host or port?
journalctl -xefu kubelet
1 | failed to run Kubelet: running with swap on is not supported, please disable swap! or set --fail-swap-on flag to false. /proc/swaps contain |
看报错是 SWAP 没有永久关闭
1 | swapoff -a |