<p>I 'm trying to pull an image from a private registry. But the status of pod is 'ImagePullBackOff', which means I need to add a secret to the pod. </p>

<pre><code>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
</code></pre>

<p>So I added the following code in pod yaml.</p>

<pre><code>spec:
      containers:
      - name: private-reg-container
        image: &lt;your-private-image&gt;
      imagePullSecrets:
      - name: my-secret
</code></pre>

<p>Then I got </p>

<pre><code>error: map: map[] does not contain declared merge key: name
</code></pre>

<p>The solution I searched out is to delete 'imagePullSecret', which doesn't work for me. I wonder how to fix the error. Can anyone help me?</p>

<p>kubectl version is</p>

<pre><code> 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"}

</code></pre>

<p>I've stumbled with the same problem (using helm) and I've found out, that it is not allowed to edit the <code>imagePullSecret</code> section in the deployment... </p>

<p>The solution was to delete the deployment and recreate it. </p>
