首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >k3d:找不到本地存储库

k3d:找不到本地存储库
EN

Stack Overflow用户
提问于 2020-09-22 13:13:05
回答 2查看 2.4K关注 0票数 1

我已经创建了我的loca注册表:

代码语言:javascript
复制
$ docker container run -d 
  --name registry.localhost
  --restart always
  -p 5000:5000
  registry:2

它已经启动并运行:

代码语言:javascript
复制
$ curl -s registry.localhost:5000/v2/_catalog | jq
{
  "repositories": [
   "greenplum-for-kubernetes",
   "greenplum-operator"
  ]
}

我在尝试创建一个部署。但我得到的是:

代码语言:javascript
复制
4m7s        Normal    ScalingReplicaSet         deployment/greenplum-operator              Scaled up replica set greenplum-operator-76b544fbb9 to 1
4m7s        Normal    SuccessfulCreate          replicaset/greenplum-operator-76b544fbb9   Created pod: greenplum-operator-76b544fbb9-pm7t2
<unknown>   Normal    Scheduled                 pod/greenplum-operator-76b544fbb9-pm7t2    Successfully assigned default/greenplum-operator-76b544fbb9-pm7t2 to k3d-k3s-default-agent-0
3m23s       Normal    Pulling                   pod/greenplum-operator-76b544fbb9-pm7t2    Pulling image "registry.localhost:5000/greenplum-operator:v2.2.0"
3m23s       Warning   Failed                    pod/greenplum-operator-76b544fbb9-pm7t2    Error: ErrImagePull
3m23s       Warning   Failed                    pod/greenplum-operator-76b544fbb9-pm7t2    Failed to pull image "registry.localhost:5000/greenplum-operator:v2.2.0": rpc error: code = Unknown desc = failed to pull and unpack image "registry.localhost:5000/greenplum-operator:v2.2.0": failed to resolve reference "registry.localhost:5000/greenplum-operator:v2.2.0": failed to do request: Head https://registry.localhost:5000/v2/greenplum-operator/manifests/v2.2.0: http: server gave HTTP response to HTTPS client
3m1s        Warning   Failed                    pod/greenplum-operator-76b544fbb9-pm7t2    Error: ImagePullBackOff
3m1s        Normal    BackOff                   pod/greenplum-operator-76b544fbb9-pm7t2    Back-off pulling image "registry.localhost:5000/greenplum-operator:v2.2.0"

简言之:

http:服务器向HTTPS客户端提供HTTP响应

我的集群也已启动并运行:

代码语言:javascript
复制
$ k3d cluster create --agents 2 --k3s-server-arg --disable=traefik
  --volume $HOME/.k3d/registries.yaml:/etc/rancher/k3s/my-registries.yaml

如你所见:

代码语言:javascript
复制
$ cat ${HOME}/.k3d/registries.yaml
mirrors:
  "registry.localhost:5000":
    endpoint:
      - "http://registry.localhost:5000"

有什么想法吗?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2020-09-23 07:18:01

这个问题与k3s和我的错写有关。

k3s需要访问/etc/rancher/k3s/registries.yaml文件,因为您可以看到这里

问题是推一个my-registries.yaml文件而不是registries.yaml

代码语言:javascript
复制
$ k3d cluster create --agents 2 --k3s-server-arg --disable=traefik
  --volume $HOME/.k3d/registries.yaml:/etc/rancher/k3s/my-registries.yaml

问题得到了解决:

代码语言:javascript
复制
$ k3d cluster create --agents 2 --k3s-server-arg --disable=traefik
  --volume $HOME/.k3d/registries.yaml:/etc/rancher/k3s/registries.yaml
票数 0
EN

Stack Overflow用户

发布于 2020-09-22 13:44:59

做这个你的工人

创建或修改/etc/docker/daemon.json

代码语言:javascript
复制
{ "insecure-registries":["registry.localhost:5000"] }

重新启动码头守护进程

代码语言:javascript
复制
sudo service docker restart

来源:https://github.com/docker/distribution/issues/1874

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64010522

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档