kubernetes - Kubernetes 在非默认命名空间中拉取镜像错误
问题描述
我有一个在默认命名空间中运行良好的清单。该图像缓存在我的笔记本电脑 docker 注册表中,并且我已将清单拉取策略设置为IfNotPresent
.
一切正常,但是当我切换到非默认命名空间时,由于拉取错误,pod 无法启动:
message: Back-off pulling image "myprivaterepo/myapp:latest"
reason: ImagePullBackOff
该图像位于我的本地 docker 注册表中,具有相同的路径。
只是想知道为什么它在默认命名空间中工作,但在非默认命名空间中工作?
解决方案
很简单,你需要在每个命名空间中添加注册表
查看文档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
推荐阅读
- java - “无效方法不能返回值” - 在 java 中处理 3
- python - 用单引号将双引号替换为python列表
- css - 当我将 mapbax-gl.css 与 react/typescript 一起使用时出现错误
- javascript - 用javascript中的属性创建数组
- python - 有没有办法将单个 LightGBM 决策树(决策规则)转换为 Python 代码(条件语句)?
- git - 如何限制谁可以合并到 github repo 上?
- android - 在 recyclerview 滚动上自动调整带有子项的框架布局
- excel-formula - 查找完全匹配并返回找到的行号
- wireshark - 如何通过wireshark/dpkt跟踪PCAP文件中的mpeg ts ibp帧
- java - 为 Java 程序分配自己的命令的最简单方法是什么?