gpt4 book ai didi

json - Kubernetes:拉取镜像失败。服务器向 HTTPS 客户端提供 HTTP 响应

转载 作者:行者123 更新时间:2023-12-03 17:12:31 28 4
gpt4 key购买 nike

我正在尝试使用 KubernetesDocker .我的图像与 Docker 一起运行。我有一个主节点和两个工作节点。我还创建了一个这样的本地注册表 $ docker run -d -p 5000:5000 --restart=always --name registry registry:2并将我的形象插入其中。到目前为止一切正常。

我加了 { "insecure-registries":["xxx.xxx.xxx.xxx:5000"] }daemon.json文件位于 /etc/docker .而且我还改变了docker-file的内容在 /etc/default/DOCKER_OPTS="--config-file=/etc/docker/daemon.json" .我在所有节点上进行了更改,然后我重新启动了 docker 守护进程。

我可以使用以下命令从每个节点提取我的图像:
sudo docker pull xxx.xxx.xxx.xxx:5000/helloworldimage
我尝试使用以下命令从主节点创建我的容器:
sudo kubectl run test --image xxx.xxx.xxx.xxx:5000/helloworldimage
比我收到以下错误:

Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled <unknown> default-scheduler Successfully assigned default/test-775f99f57-m9r4b to rpi-2
Normal BackOff 18s (x2 over 44s) kubelet, rpi-2 Back-off pulling image "xxx.xxx.xxx.xxx:5000/helloworldimage"
Warning Failed 18s (x2 over 44s) kubelet, rpi-2 Error: ImagePullBackOff
Normal Pulling 3s (x3 over 45s) kubelet, rpi-2 Pulling image "xxx.xxx.xxx.xxx:5000/helloworldimage"
Warning Failed 3s (x3 over 45s) kubelet, rpi-2 Failed to pull image "xxx.xxx.xxx.xxx:5000/helloworldimage": rpc error: code = Unknown desc = failed to pull and unpack image "xxx.xxx.xxx.xxx:5000/helloworldimage:latest": failed to resolve reference "xxx.xxx.xxx.xxx:5000/helloworldimage:latest": failed to do request: Head https://xxx.xxx.xxx.xxx:5000/v2/helloworldimage/manifests/latest: http: server gave HTTP response to HTTPS client
Warning Failed 3s (x3 over 45s) kubelet, rpi-2 Error: ErrImagePull

这是 docker我使用的版本:
Client: Docker Engine - Community
Version: 19.03.5
API version: 1.40
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:37:22 2019
OS/Arch: linux/arm
Experimental: false

Server: Docker Engine - Community
Engine:
Version: 19.03.5
API version: 1.40 (minimum version 1.12)
Go version: go1.12.12
Git commit: 633a0ea
Built: Wed Nov 13 07:31:17 2019
OS/Arch: linux/arm
Experimental: false
containerd:
Version: 1.2.10
GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339
runc:
Version: 1.0.0-rc8+dev
GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657
docker-init:
Version: 0.18.0
GitCommit: fec3683

这是 Kubernetes我使用的版本:
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0+k3s.1", GitCommit:"0f644650f5d8e9f091629f860b342f221c46f6d7", GitTreeState:"clean", BuildDate:"2020-01-06T23:20:30Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/arm"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0+k3s.1", GitCommit:"0f644650f5d8e9f091629f860b342f221c46f6d7", GitTreeState:"clean", BuildDate:"2020-01-06T23:20:30Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/arm"}```

最佳答案

Kubernetes: Failed to pull image. Server gave HTTP response to HTTPS client.

{ "insecure-registries":["xxx.xxx.xxx.xxx:5000"] }
daemon.json文件位于 /etc/docker .
我通过在 上配置它解决了这个问题所有 kubernetes 节点 .

关于json - Kubernetes:拉取镜像失败。服务器向 HTTPS 客户端提供 HTTP 响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59844553/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com