创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。
发帖前请点击 发表主题 右边的 预览(👀) 按钮,确保帖子格式正确。

操作系统信息
3台同配置的物理机,Ubuntu,4C8G100GB

Kubernetes版本信息
v1.23.10,1个master,2个node

容器运行时
root@node1:~# docker –version

Docker version 24.0.6, build ed223bc

KubeSphere版本信息
v3.4.1。 在线安装。 全套安装。

问题是什么
部署启动后,停留在下述界面很久,请问我该如何评估部署剩余时间,我该如何判断部署是否正常进行,我该如何确认部署卡在什么问题。

经过长时间等待,出现以下报错信息,请问,这种情况该如何排查和处理

12:05:12 CST failed: [master]
error: Pipeline[CreateClusterPipeline] execute failed: Module[CheckResultModule] exec failed:
failed: [master] execute task timeout, Timeout=2h

发现获取镜像失败,当前环境在中国网络。

root@master:~# kubectl get pod -A -n kubesphere-system
NAMESPACE           NAME                                           READY   STATUS             RESTARTS      AGE
kube-system         calico-kube-controllers-67fbf89557-xg2rq       1/1     Running            1 (68m ago)   4h13m
kube-system         calico-node-2pxmg                              1/1     Running            1 (68m ago)   4h13m
kube-system         calico-node-5sf66                              1/1     Running            1 (68m ago)   4h13m
kube-system         calico-node-65w8r                              1/1     Running            1 (68m ago)   4h13m
kube-system         coredns-757cd945b-brsvd                        1/1     Running            1 (68m ago)   4h14m
kube-system         coredns-757cd945b-kkbkh                        1/1     Running            1 (68m ago)   4h14m
kube-system         kube-apiserver-master                          1/1     Running            1 (68m ago)   4h14m
kube-system         kube-controller-manager-master                 1/1     Running            1 (68m ago)   4h14m
kube-system         kube-proxy-2npgd                               1/1     Running            1 (68m ago)   4h13m
kube-system         kube-proxy-l6sm9                               1/1     Running            1 (68m ago)   4h13m
kube-system         kube-proxy-ztvbg                               1/1     Running            1 (68m ago)   4h14m
kube-system         kube-scheduler-master                          1/1     Running            1 (68m ago)   4h14m
kube-system         nodelocaldns-2g789                             1/1     Running            1 (68m ago)   4h13m
kube-system         nodelocaldns-dh7lh                             1/1     Running            1 (68m ago)   4h14m
kube-system         nodelocaldns-rsrqb                             1/1     Running            1 (68m ago)   4h13m
kube-system         openebs-localpv-provisioner-7bbcf865cd-2g9tp   1/1     Running            1 (68m ago)   4h13m
kube-system         snapshot-controller-0                          0/1     ImagePullBackOff   0             48s
kubesphere-system   ks-installer-ddbcf44f8-mkfgr                   1/1     Running            0             18m
kubesphere-system   minio-7879c5dd65-gk6ms                         0/1     ImagePullBackOff   0             84s
kubesphere-system   openldap-0                                     0/1     ImagePullBackOff   0             24s

网络异常

root@master:~# kubectl get pod -A
NAMESPACE           NAME                                           READY   STATUS             RESTARTS        AGE
kube-system         calico-kube-controllers-67fbf89557-sx2vl       1/1     Running            0               3m12s
kube-system         calico-node-477tr                              1/1     Running            0               3m12s
kube-system         calico-node-cwkx6                              1/1     Running            0               3m12s
kube-system         calico-node-qn2mk                              1/1     Running            0               3m12s
kube-system         coredns-757cd945b-cxsv9                        1/1     Running            0               3m24s
kube-system         coredns-757cd945b-f7247                        1/1     Running            0               3m24s
kube-system         kube-apiserver-master                          1/1     Running            2 (4m31s ago)   3m37s
kube-system         kube-controller-manager-master                 1/1     Running            2 (25m ago)     3m39s
kube-system         kube-proxy-bmxz7                               1/1     Running            0               3m23s
kube-system         kube-proxy-gg62v                               1/1     Running            0               3m17s
kube-system         kube-proxy-hrlhp                               1/1     Running            0               3m18s
kube-system         kube-scheduler-master                          1/1     Running            0               3m37s
kube-system         nodelocaldns-g6frv                             1/1     Running            0               3m18s
kube-system         nodelocaldns-j5pnc                             1/1     Running            0               3m23s
kube-system         nodelocaldns-qjz68                             1/1     Running            0               3m17s
kube-system         openebs-localpv-provisioner-7bbcf865cd-wwrbb   1/1     Running            0               3m9s
kube-system         snapshot-controller-0                          0/1     ImagePullBackOff   0               72s
kubesphere-system   ks-installer-ddbcf44f8-dpchh                   1/1     Running            0               3m8s
kubesphere-system   minio-7879c5dd65-z66x7                         0/1     ErrImagePull       0               36s
kubesphere-system   openldap-0                                     1/1     Running            1 (41s ago)     52s

如上所示,镜像无法正确获取。前面已经配置了中国地区部署,请问后面部署过程中依旧获取镜像失败。是必须自己做网络加速吗

查看pod日志

Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  6m10s                  default-scheduler  Successfully assigned kubesphere-system/minio-7879c5dd65-fpbpj to node1
  Normal   Pulling    3m50s (x4 over 6m8s)   kubelet            Pulling image "minio/minio:RELEASE.2019-08-07T01-59-21Z"
  Warning  Failed     3m35s (x4 over 5m53s)  kubelet            Failed to pull image "minio/minio:RELEASE.2019-08-07T01-59-21Z": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed     3m35s (x4 over 5m53s)  kubelet            Error: ErrImagePull
  Warning  Failed     3m20s (x6 over 5m52s)  kubelet            Error: ImagePullBackOff
  Normal   BackOff    67s (x14 over 5m52s)   kubelet            Back-off pulling image "minio/minio:RELEASE.2019-08-07T01-59-21Z"

查看镜像文件,已经有镜像文件

root@master:/data# docker images
REPOSITORY                                                              TAG                            IMAGE ID       CREATED         SIZE
registry.cn-beijing.aliyuncs.com/kubesphereio/ks-installer              v3.4.1                         d6ce52546e1c   18 months ago   439MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controllers          v3.26.1                        1919f2787fa7   22 months ago   75.1MB
registry.cn-beijing.aliyuncs.com/kubesphereio/cni                       v3.26.1                        9dee260ef7f5   22 months ago   210MB
registry.cn-beijing.aliyuncs.com/kubesphereio/pod2daemon-flexvol        v3.26.1                        092a973bb20e   22 months ago   14.8MB
registry.cn-beijing.aliyuncs.com/kubesphereio/node                      v3.26.1                        8065b798a4d6   22 months ago   246MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-apiserver            v1.23.10                       9ca5fafbe8dc   2 years ago     135MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-scheduler            v1.23.10                       d5c0efb802d9   2 years ago     53.5MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-proxy                v1.23.10                       71b9bf9750e1   2 years ago     112MB
registry.cn-beijing.aliyuncs.com/kubesphereio/kube-controller-manager   v1.23.10                       91a4a0d5de4e   2 years ago     125MB
registry.cn-beijing.aliyuncs.com/kubesphereio/provisioner-localpv       3.3.0                          739e82fed8b2   2 years ago     70.3MB
registry.cn-beijing.aliyuncs.com/kubesphereio/linux-utils               3.3.0                          e88cfb3a763b   2 years ago     72.4MB
registry.cn-beijing.aliyuncs.com/kubesphereio/coredns                   1.8.6                          a4ca41631cc7   3 years ago     46.8MB
registry.cn-beijing.aliyuncs.com/kubesphereio/pause                     3.6                            6270bb605e12   3 years ago     683kB
csiplugin/snapshot-controller                                           v4.0.0                         f1d8a00ae690   4 years ago     46.6MB
osixia/openldap                                                         1.3.0                          faac9bb59f83   4 years ago     260MB
registry.cn-beijing.aliyuncs.com/kubesphereio/k8s-dns-node-cache        1.15.12                        5340ba194ec9   5 years ago     107MB
minio/minio                                                             RELEASE.2019-08-07T01-59-21Z   29c267893b04   5 years ago     61.3MB
root@master:/data#

deployment使用的是已经获取的镜像

root@master:/data# kubectl describe deployments.apps -A | grep Image | grep minio
    Image:      minio/minio:RELEASE.2019-08-07T01-59-21Z
root@master:/data#

编辑deployment查看

 image: minio/minio:RELEASE.2019-08-07T01-59-21Z
        imagePullPolicy: IfNotPresent

实际运行pod时并未优先使用本地镜像

问题已解决,处理方法是在所有的node都配置docker镜像加速。所有node。在部署中,即便是配置了中国地区的仓库,部分pod也会强制拉取海外镜像,不知道是否是自动部署脚本配置的问题。