如何从Kubernetes集群中的Harbourregistry获取Docker镜像?

在一个主机上安装港口(192.168.33.10)。

在其他主机上安装Kubernetes集群。

将docker镜像成功从客户端推送到Harbor主机。 在Kubernets主控主机上,我也可以成功从Harbour主机上取得这个图像:

$ docker pull 192.168.33.10/hello-world/hello-world Using default tag: latest latest: Pulling from hello-world/hello-world 3d19aeb159d4: Pull complete Digest: sha256:d9f41d096c0e1881e7a24756db9b7315d91c8d4bf1537f6eb10c36edeedde59f Status: Downloaded newer image for 192.168.33.10/hello-world/hello-world:latest 

但是我创build了一个Kubernetes部署yaml文件,如下所示:

 apiVersion: extensions/v1beta1 kind: Deployment metadata: name: hello-world spec: template: metadata: labels: app: hello-world spec: containers: - image: 192.168.33.10/hello-world/hello-world name: hello-world imagePullPolicy: Always 

然后运行kubectl create -f deployment.yaml

从Kubernetes仪表板显示:

 Failed to pull image "192.168.33.10/hello-world/hello-world": rpc error: code = 2 desc = Error response from daemon: {"message":"Get https://192.168.33.10/v2/: dial tcp 192.168.33.10:443: getsockopt: connection refused"} Error syncing pod 

在这里输入图像说明

我已经在/etc/docker/daemon.json设置了insecure-registries

 { "insecure-registries":["192.168.33.10"] } 

如何从Kubernetes获得?


编辑

我正在Rancher服务器群集上使用Kubernetes。 即使我设置了Harbour服务器的IP,用户名和密码,也无法访问:

在这里输入图像说明