我正在尝试从私有注册表连接中提取图像。
nexus是nginx的幕后推手,它使用docker命令创建了很少repo推出的映像,没有任何问题。
现在,我想要通过pod对象将其拖到kuberenetes集群上,但是它在x509:由未知权威机构签名的证书中失败。
第一步
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"insecure-registries": ["nginx_ip"]
}
kubectl create secret docker-registry registry-secret --docker-server=<nginx-ip> --docker-username=user --docker-password=password --docker-email=not-needed@example.com
apiVersion: v1
kind: Pod
metadata:
name: foo
spec:
containers:
- name: foo
image: nginx-ip/nginx
imagePullSecrets:
- name: registry-secret
但失败时出现以下错误
Normal Scheduled 12m default-scheduler Successfully assigned default/foo to k-node-1
Warning Failed 11m (x6 over 12m) kubelet Error: ImagePullBackOff
Normal Pulling 11m (x4 over 12m) kubelet Pulling image "x.x.x.204"
Warning Failed 11m (x4 over 12m) kubelet Failed to pull image "x.x.x.204/nginx": rpc error: code = Unknown desc = failed to pull and unpack image "x.x.x.204/nginx:latest": failed to resolve reference "x.x.x.204/nginx:latest": failed to do request: Head "https://x.x.x.204/v2/nginx/manifests/latest": x509: certificate signed by unknown authority
Warning Failed 11m (x4 over 12m) kubelet Error: ErrImagePull
Normal BackOff 2m53s (x42 over 12m) kubelet Back-off pulling image "x.x.x.204/nginx"
但我手动到节点,在那里我的吊舱被安排,试图通过码头命令拉图像。没有任何问题,我能够提取图像。
我做错什么了吗??
跟踪https://docs.docker.com/registry/insecure/,但即使是这样也没有结果。
https://stackoverflow.com/questions/73004190
复制相似问题