kubectl无法从私有存储库中提取图像 [英] kubectl not able to pull the image from private repository
问题描述
我正在运行kubeadm alpha版本来设置我的kubernates集群. 从kubernates,我正在尝试拉取在nexus存储库中托管的docker映像. 每当我尝试创建Pod时,每次都会给出"ImagePullBackOff".有人可以帮我吗?
I am running kubeadm alpha version to set up my kubernates cluster. From kubernates , I am trying to pull docker images which is hosted in nexus repository. When ever I am trying to create a pods , It is giving "ImagePullBackOff" every time. Can anybody help me on this ?
有关详细信息,请参见 https://github.com/kubernetes/kubernetes/issues/41536
Detail for this are present in https://github.com/kubernetes/kubernetes/issues/41536
Pod定义:
apiVersion: v1
kind: Pod
metadata:
name: test-pod
labels:
name: test
spec:
containers:
- image: 123.456.789.0:9595/test
name: test
ports:
- containerPort: 8443
imagePullSecrets:
- name: my-secret
推荐答案
When you create the secret with kubectl create secret docker-registry my-secret --docker-server=123.456.789.0 ...
the server must exactly match what's in your Pod definition - including the port number (and if it's a secure one then it also must match up with the docker command line in systemd).
此外,机密必须在创建Pod的相同命名空间中,但这似乎是有序的.
Also, the secret must be in the same namespace where you are creating your Pod, but that seems to be in order.
这篇关于kubectl无法从私有存储库中提取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!