我有一个清单,可以在默认名称空间中正常工作。该图像已缓存在我的笔记本电脑docker注册表中,并且我已将清单拉取策略设置为IfNotPresent
。
一切正常,但是当我切换到非默认名称空间时,由于拉出错误,无法显示pod:
message: Back-off pulling image "myprivaterepo/myapp:latest"
reason: ImagePullBackOff
该图像在我的本地docker注册表中具有相同的路径。
仅想知道为什么它可以在默认名称空间中工作,而在非默认名称空间中工作?
答案 0 :(得分:0)
简单,您需要在每个命名空间中添加注册表
看看文档https://kubernetes.io/docs/concepts/containers/images/
Note: Pods can only reference image pull secrets in their own namespace, so this process needs to be done one time per namespace