【问题标题】:k3d: local repository not foundk3d:未找到本地存储库
【发布时间】:2020-09-22 13:13:05
【问题描述】:

我已经创建了我的本地注册表:

$ docker container run -d 
  --name registry.localhost
  --restart always
  -p 5000:5000
  registry:2

它已启动并运行:

$ curl -s registry.localhost:5000/v2/_catalog | jq
{
  "repositories": [
   "greenplum-for-kubernetes",
   "greenplum-operator"
  ]
}

我正在尝试创建部署。但是我得到了:

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 响应

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

$ k3d cluster create --agents 2 --k3s-server-arg --disable=traefik
  --volume $HOME/.k3d/registries.yaml:/etc/rancher/k3s/my-registries.yaml

如你所见:

$ cat ${HOME}/.k3d/registries.yaml
mirrors:
  "registry.localhost:5000":
    endpoint:
      - "http://registry.localhost:5000"

有什么想法吗?

【问题讨论】:

    标签: kubernetes rancher k3s


    【解决方案1】:

    做你的工人

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

    { "insecure-registries":["registry.localhost:5000"] }
    

    重启 docker 守护进程

    sudo service docker restart
    

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

    【讨论】:

      【解决方案2】:

      这个问题与k3s 有关,我误写了。

      k3s 需要访问/etc/rancher/k3s/registries.yaml 文件,如您所见here。

      问题是推送my-registries.yaml 文件而不是registries.yaml:

      $ k3d cluster create --agents 2 --k3s-server-arg --disable=traefik
        --volume $HOME/.k3d/registries.yaml:/etc/rancher/k3s/my-registries.yaml
      

      问题解决了:

      $ k3d cluster create --agents 2 --k3s-server-arg --disable=traefik
        --volume $HOME/.k3d/registries.yaml:/etc/rancher/k3s/registries.yaml
      

      【讨论】:

        猜你喜欢
        • 2017-07-23
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-11-03
        • 2018-11-25
        相关资源
        最近更新 更多