尝试从私有注册表进行Kubernetes部署时出错 [英] Error while trying to do a kubernetes deployment from a private registry
本文介绍了尝试从私有注册表进行Kubernetes部署时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试使用Kubernetes从私有存储库部署docker映像,并看到以下错误
I am trying to deploy a docker image from a Private repository using Kubernetes and seeing the below error
Waiting: CrashLoopBackoff
推荐答案
您需要将图像拉密钥传递给kubernetes.
You need to pass image pull secret to kubernetes.
- 获取docker login json
- 使用此json创建一个k8s机密
- 从豆荚中查阅秘密
apiVersion: v1
kind: Pod
metadata:
name: private-reg
spec:
containers:
- name: private-reg-container
image: <your-private-image>
imagePullSecrets:
- name: k8s-secret-name
文档: https://kubernetes. io/docs/tasks/configure-pod-container/pull-image-private-registry/
通常情况下,不良状态是由称为ImagePullBackOff
的图像拉出引起的,因此我建议kubectl get events
检查根本原因.
Usually, the bad state caused by an image pull called ImagePullBackOff
, so I suggest kubectl get events
to check the root cause.
这篇关于尝试从私有注册表进行Kubernetes部署时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文