安装k8s卡住问题排查
·
执行./kk create cluster --with-kubernetes v1.22.12 --with-kubesphere v3.4.1 卡住了,是后台无法下载镜像的原因。可以再开一个窗口,执行。
查看下载到哪个了:
[root@c1 swarm]# kubectl logs -n kubesphere-system deployment/ks-installer -f
Error from server (BadRequest): container "installer" in pod "ks-installer-7796cf7779-jnwfn" is waiting to start: trying and failing to pull image
显示卡在了ks-installer,执行:
kubectl set image deployment/ks-installer -n kubesphere-system \
installer=registry.cn-beijing.aliyuncs.com/kubesphereio/ks-installer:v3.4.1
其他情况,类似。
# 1. 修复 ks-apiserver
kubectl set image deployment/ks-apiserver -n kubesphere-system ks-apiserver=registry.cn-beijing.aliyuncs.com/kubesphereio/ks-apiserver:v3.4.1
# 2. 修复 ks-console
kubectl set image deployment/ks-console -n kubesphere-system ks-console=registry.cn-beijing.aliyuncs.com/kubesphereio/ks-console:v3.4.1
# 3. 修复 ks-controller-manager
kubectl set image deployment/ks-controller-manager -n kubesphere-system ks-controller-manager=registry.cn-beijing.aliyuncs.com/kubesphereio/ks-controller-manager:v3.4.1
安装完之后,有几个镜像没有正常拉取过来,也可以用这个方法。
首先查看哪几个没有拉取成功
[root@c1 ~]# kubectl get pods -A
NAMESPACE NAME READY STATUS RESTARTS AGE
default mysql-deployment-57c56d54bb-xj952 1/1 Running 1 (22h ago) 40h
kube-system calico-kube-controllers-b88484759-h7l24 1/1 Running 10 (22h ago) 42h
kube-system calico-node-4cjd9 1/1 Running 10 (22h ago) 42h
kube-system coredns-5495dd7c88-6vpds 1/1 Running 14 (22h ago) 4d20h
kube-system coredns-5495dd7c88-dcsdr 1/1 Running 14 (22h ago) 4d20h
kube-system kube-apiserver-c1 1/1 Running 14 (22h ago) 4d20h
kube-system kube-controller-manager-c1 1/1 Running 14 (22h ago) 4d20h
kube-system kube-proxy-k2qwp 1/1 Running 14 (22h ago) 4d20h
kube-system kube-scheduler-c1 1/1 Running 14 (22h ago) 4d20h
kube-system nodelocaldns-ph2p2 1/1 Running 10 (22h ago) 42h
kube-system openebs-localpv-provisioner-58d9ff469c-rf4fr 1/1 Running 14 (22h ago) 4d20h
kube-system snapshot-controller-0 1/1 Running 14 (22h ago) 4d20h
kubesphere-controls-system default-http-backend-5bf68ff9b8-w4hgp 1/1 Running 1 (22h ago) 40h
kubesphere-controls-system kubectl-admin-6dbcb94855-s49wv 1/1 Running 1 (22h ago) 40h
kubesphere-monitoring-system alertmanager-main-0 2/2 Running 2 (22h ago) 40h
kubesphere-monitoring-system kube-state-metrics-554c8c5d65-tttkr 3/3 Running 3 (22h ago) 40h
kubesphere-monitoring-system node-exporter-xjg9m 2/2 Running 2 (22h ago) 40h
kubesphere-monitoring-system notification-manager-deployment-566fb6ccf5-t6kpv 2/2 Running 2 (22h ago) 40h
kubesphere-monitoring-system notification-manager-operator-8694799c76-bh5bx 2/2 Running 2 (22h ago) 40h
kubesphere-monitoring-system prometheus-k8s-0 2/2 Running 2 (22h ago) 40h
kubesphere-monitoring-system prometheus-operator-8955bbd98-4rd6r 2/2 Running 2 (22h ago) 40h
kubesphere-system ks-apiserver-7fd66f7885-mdc99 0/1 ErrImagePull 0 7m59s
kubesphere-system ks-console-85c97b6d7d-wbm9d 0/1 ImagePullBackOff 0 7m59s
kubesphere-system ks-controller-manager-798444f496-5xwgg 0/1 ImagePullBackOff 0 7m59s
kubesphere-system ks-installer-5594ffc86d-njw4m 1/1 Running 1 (22h ago) 40h
对应修复命令。
# 1. 修复 ks-apiserver
kubectl set image deployment/ks-apiserver -n kubesphere-system ks-apiserver=registry.cn-beijing.aliyuncs.com/kubesphereio/ks-apiserver:v3.4.1
# 2. 修复 ks-console
kubectl set image deployment/ks-console -n kubesphere-system ks-console=registry.cn-beijing.aliyuncs.com/kubesphereio/ks-console:v3.4.1
# 3. 修复 ks-controller-manager
kubectl set image deployment/ks-controller-manager -n kubesphere-system ks-controller-manager=registry.cn-beijing.aliyuncs.com/kubesphereio/ks-controller-manager:v3.4.1
更多推荐

所有评论(0)