0

我在 GitLab 上设置了容器注册表,我的图像就在那里。此外,我使用 kubespray 设置 Kubernetes 并使用 Containerd 而不是 Docker。当我想拉图像时,它给了我错误:

ctr: failed to resolve reference "gitlab.mydomain.local:5050/mehran/store-user:production": failed to do request: Head https://gitlab.mydomain.local:5050/v2/mehran/store-user/manifests/production: x509: certificate signed by unknown authority

这是我的 config.toml

   [grpc]
  max_recv_message_size = 16777216
  max_send_message_size = 16777216

[debug]
  level = "info"

[metrics]
  address = ""
  grpc_histogram = false

[plugins]
  [plugins."io.containerd.grpc.v1.cri"]
    sandbox_image = "k8s.gcr.io/pause:3.3"
    max_container_log_line_size = -1
    [plugins."io.containerd.grpc.v1.cri".containerd]
      default_runtime_name = "runc"
      snapshotter = "overlayfs"
      [plugins."io.containerd.grpc.v1.cri".containerd.runtimes]
        [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
          runtime_type = "io.containerd.runc.v2"
          runtime_engine = ""
          runtime_root = ""
          [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
            systemdCgroup = true
    [plugins."io.containerd.grpc.v1.cri".registry]
      [plugins."io.containerd.grpc.v1.cri".registry.mirrors]
        [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"]
          endpoint = ["https://registry-1.docker.io"]
        [plugin."io.containerd.grpc.v1.cri".registry.mirrors."mydomain.local"]
          endpoint = ["https://gitlab.mydomain.local:5050"]
      [plugins."io.containerd.grpc.v1.cri".registry.configs]
        [plugin."io.containerd.grpc.v1.cri".registry.configs."mydomain.local".auth]
          username = "k8s-user"
          password = "A-KR9GYcWzungwVenzGh"
        [plugin."io.containerd.grpc.v1.cri".registry.configs."mydomain.local".tls]
          insecure_skip_verify = true

我在 config.toml 中设置了“insecure_skip_verify”,但它不起作用。我知道它与容器有关,但不知道必须做什么。希望有人可以帮助我并指导我如何解决它。

谢谢梅兰

4

0 回答 0