<p>has anyone tried having the image for an init container in a private repo when using the imagePullSecret to access the registry?  Below is a sample for a private registry with image pull secrets.  </p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: private-reg
spec:
   containers:
     - name: private-reg-container
       image: privatereg:5000/private-image-name
  imagePullSecrets:
    - name: regsecret
</code></pre>

<p>When you define the init containers, the secrets cannot be included with the init-container since its not part of the container spec.</p>

<p>So will it still work using init containers?  I see in the example <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/</a> that they have a volume created in the spec and its available in the init.  </p>

<p>You can add it via annotations:</p>

<pre><code>annotations:
  pod.beta.kubernetes.io/init-containers: '[
    {
      "name": "install",
       "image": "my-init-container",
       "imagePullSecrets": "something"
     }
    ]'
</code></pre>
