从 Kubernetes 的私有注册表中拉取镜像 [英] Pulling images from private registry in Kubernetes
问题描述
我已经构建了一个 4 节点的 kubernetes 集群,运行多容器 pod,所有 pod 都在 CoreOS 上运行.图像来自公共和私人存储库.现在我必须登录每个节点并在每次更新图像时手动拉下图像.我希望能够自动拉动它们.
I have built a 4 node kubernetes cluster running multi-container pods all running on CoreOS. The images come from public and private repositories. Right now I have to log into each node and manually pull down the images each time I update them. I would like be able to pull them automatically.
- 我尝试在每台服务器上运行 docker login 并将 .dockercfg 文件放在/root 和/core 中
- 我也使用 .docker/config.json 完成了上述操作
- 我已经向 kube master 添加了 secret 并添加了 imagePullSecrets:
- 名称:docker.io 到 Pod 配置文件.
当我创建 pod 时,我收到错误消息 Error:
When I create the pod i get the error message Error:
image <user/image>:latest not found
如果我登录并运行 docker pull 它将拉取图像.我已经尝试过使用 docker.io 和 quay.io.
If I log in and run docker pull it will pull the image. I have tried this using docker.io and quay.io.
推荐答案
Kubernetes 支持一种特殊类型的机密,您可以创建它来为您的 Pod 获取图像.更多细节 这里.
Kubernetes supports a special type of secret that you can create that will be used to fetch images for your pods. More details here.
这篇关于从 Kubernetes 的私有注册表中拉取镜像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!