4

我正在尝试从私有注册表中提取图像。但是 pod 的状态是 'ImagePullBackOff',这意味着我需要向 pod 添加一个秘密。

Events:
  Type     Reason   Age                  From                                          Message
  ----     ------   ----                 ----                                          -------
  Normal   Pulling  52m (x255 over 22h)  kubelet, cn-huhehaote.i-hp3fkfzlcf1u9cigq2h7  pulling image "xxx/fcp"
  Normal   BackOff  8m (x5597 over 22h)  kubelet, cn-huhehaote.i-hp3fkfzlcf1u9cigq2h7  Back-off pulling image "xxx/fcp"
  Warning  Failed   3m (x5618 over 22h)  kubelet, cn-huhehaote.i-hp3fkfzlcf1u9cigq2h7  Error: ImagePullBackOff

所以我在 pod yaml 中添加了以下代码。

spec:
      containers:
      - name: private-reg-container
        image: <your-private-image>
      imagePullSecrets:
      - name: my-secret

然后我得到了

error: map: map[] does not contain declared merge key: name

我搜索到的解决方案是删除'imagePullSecret',这对我不起作用。我想知道如何修复错误。谁能帮我?

kubectl 版本是

 kubectl version
Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.5", GitCommit:"753b2dbc622f5cc417845f0ff8a77f539a4213ea", GitTreeState:"clean", BuildDate:"2018-11-26T14:41:50Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.5", GitCommit:"753b2dbc622f5cc417845f0ff8a77f539a4213ea", GitTreeState:"clean", BuildDate:"2018-11-26T14:31:35Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}

4

2 回答 2

4

我偶然发现了同样的问题(使用 helm),我发现,不允许编辑imagePullSecret部署中的部分......

解决方案是删除部署并重新创建它。

于 2019-11-20T10:45:35.163 回答
-2

正如@fiunchinho 在评论中提到的以及根据与 Kubefed的联合一样- 集群联合已被弃用。

强烈建议不要使用 Federation v1。Federation V1 从未达到 GA 状态,并且不再处于积极开发中。文档仅用于历史目的。

解决方案是使用 Kubernetes Federation v2。有关更多详细信息,您可以参考Federation v2 用户指南Federation v 开发指南

于 2019-04-24T10:05:52.590 回答