我有一个k8s gitRunner部署,该部署应访问私有注册表。但是访问总是失败:
Waiting for pod default/runner-6f15beb6-project-3046-concurrent-0xswl6 to be running, status is Pending
ERROR: Job failed: image pull failed: rpc error: code = Unknown desc = Error response from daemon: Get https://docker-registry/v2/image: unknown: Authentication is required
我创建了秘密:
kubectl create secret docker-private ...
kubectl describe secrets docker-private
Name: docker-private
Namespace: default
Labels: <none>
Annotations: <none>
Type: kubernetes.io/dockerconfigjson
Data
====
.dockerconfigjson: 184 bytes
在gitlab的values.yml
中使用秘密:
runners:
...
imagePullSecrets:
- name: docker-private
并已验证它实际上是gitlab版本的一部分:
helm get sandbox | grep -C 5 docker
imagePullSecrets:
- name: docker-private
注册表访问失败的原因还有哪些?