操作

系统信息

例如:物理机,Centos8 512G 内存 / INTEL CPU

Kubernetes版本信息

Client Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.17”, GitCommit:“953be8927218ec8067e1af2641e540238ffd7576”, GitTreeState:“clean”, BuildDate:“2023-02-22T13:34:27Z”, GoVersion:“go1.19.6”, Compiler:“gc”, Platform:“linux/amd64”}

Server Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.17”, GitCommit:“953be8927218ec8067e1af2641e540238ffd7576”, GitTreeState:“clean”, BuildDate:“2023-02-22T13:27:46Z”, GoVersion:“go1.19.6”, Compiler:“gc”, Platform:“linux/amd64”}

容器运行时

[root@ipspur01 k8s]# docker version

Client:

Version: 24.0.9

API version: 1.43

Go version: go1.20.13

Git commit: 2936816

Built: Thu Feb 1 00:47:46 2024

OS/Arch: linux/amd64

Context: default

Server: Docker Engine - Community

Engine:

Version: 24.0.9

API version: 1.43 (minimum version 1.12)

Go version: go1.20.13

Git commit: fca702d

Built: Thu Feb 1 00:49:16 2024

OS/Arch: linux/amd64

Experimental: false

containerd:

Version: v1.7.13

GitCommit: 7c3aca7a610df76212171d200ca3811ff6096eb8

runc:

Version: 1.1.12

GitCommit: v1.1.12-0-g51d5e94

docker-init:

Version: 0.19.0

GitCommit: de40ad0

KubeSphere版本信息

通过kk all in one 在线安装 kubesphere 3.4.1版本

[root@ipspur01 k8s]# kubectl get node

NAME STATUS ROLES AGE VERSION

ipspur01 Ready control-plane,master,worker 6d v1.23.17

问题如下:

1、kubesphere中已添加私有harbor仓库,并验证成功。在创建页面能够识别镜像名称。

2、点击创建后,pod界面状态一直处于ImagePullBackOff

NAMESPACE NAME READY STATUS RESTARTS AGE

demo-project mysql-v1-0 0/1 ImagePullBackOff 0 20m

demo-project wordpress-v1-555df9db7-qqcsf 0/1 ImagePullBackOff 0 20m

日志显示:

Events:

Type Reason Age From Message

Warning FailedScheduling 2m17s default-scheduler 0/1 nodes are available: 1 pod has unbound immediate PersistentVolumeClaims.

Normal Scheduled 2m16s default-scheduler Successfully assigned demo-project/mysql-v1-0 to ipspur01

Warning Failed 62s (x6 over 2m15s) kubelet Error: ImagePullBackOff

Normal Pulling 48s (x4 over 2m16s) kubelet Pulling image “ipspur01.cluster.local/library/mysql:v5.6”

Warning Failed 41s (x4 over 2m16s) kubelet Failed to pull image “ipspur01.cluster.local/library/mysql:v5.6”: rpc error: code = Unknown desc = Error response from daemon: Get “https://ipspur01.cluster.local/v2/”: dial tcp 172.18.61.148:443: connect: connection refused

Warning Failed 41s (x4 over 2m16s) kubelet Error: ErrImagePull

Normal BackOff 28s (x7 over 2m15s) kubelet Back-off pulling image “ipspur01.cluster.local/library/mysql:v5.6”

问题1:如何解决呢?

问题2:另外kubesphere文档中(链接如下)提到 添加harbor仓库 需要 改集群中所有节点的 Docker 配置。例如,如果外部 Harbor 仓库的 IP 地址为 http://192.168.0.99,您需要在 /etc/systemd/system/docker.service.d/docker-options.conf 文件中增加 –insecure-registry=192.168.0.99 标签。

我的centos 8 里面 没有docker-options.conf文件? 是否一定需要添加改字段?

https://kubesphere.io/zh/docs/v3.4/project-user-guide/configuration/image-registry/