谁能指导如何从Kubernetes中提取私有图像? [英] Can anyone please guide how to pull private images from Kubernetes?
问题描述
kubectl创建秘密docker-registry私有注册表密钥--docker-username ="devopsrecipes" --docker-password ="xxxxxx" --docker-email ="username@example.com" --docker-server="https://index.docker.io/v1/"秘密的私人注册表密钥"创建
kubectl create secret docker-registry private-registry-key --docker-username="devopsrecipes" --docker-password="xxxxxx" --docker-email="username@example.com" --docker-server="https://index.docker.io/v1/" secret "private-registry-key" created
此命令用于访问私有docker仓库.
This command is used for accessing private docker repos.
引用如下: http://blog.shippable.com/kubernetes-tutorial-how-to-pull-private-docker-image-pod
但是,无法拉出图像.
当尝试访问="https://index.docker.io/v1/"时它给出了页面未找到错误.
When tried to access ="https://index.docker.io/v1/" It is giving page not found error.
请指导我.
推荐答案
您还需要在创建的pod/部署规范中引用 imagePullSecrets :
You also need to refer the imagePullSecrets in the pod / deployment spec you create:
apiVersion: v1
kind: Pod
metadata:
name: private-reg
spec:
containers:
- name: private-reg-container
image: <your-private-image>
imagePullSecrets:
- name: private-registry-key
了解有关 imagePullSecrets 的更多信息 查看全文