<p>I have created a deployment yaml file with an image name with my private docker repository.
when running the command :</p>
<pre><code> kubectl get pods
</code></pre>
<p>I see that the status of the created pod from that deployment file is ImagePullBackOff. from what I have read it is because I am pulling the image from a private registry without imagePullSecret.</p>
<p>how do I create &quot;imagePullSecret&quot; as a yaml file to work with the deployment.yaml file which contains an image from the private repository? or is it a feild which should be part of the deployment file?</p>

Ohad
<p>There is a field in spec of the pod called <code>imagePullSecrets</code>, whichi you could define with your deployment yaml:</p>
<pre class="lang-yaml prettyprint-override"><code>imagePullSecrets:
- name: registry-secret
</code></pre>
<p>Then you can define the missing  &quot;imagePullSecret&quot; as a yaml file:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Secret
metadata:
  name: registry-secret
  namespace: xxx-namespace
data:
  .dockerconfigjson: UmVhbGx5IHJlYWxseSByZWVlZWVlZWVlZWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGxsbGx5eXl5eXl5eXl5eXl5eXl5eXl5eSBsbGxsbGxsbGxsbGxsbG9vb29vb29vb29vb29vb29vb29vb29vb29vb25ubm5ubm5ubm5ubm5ubm5ubm5ubm5ubmdnZ2dnZ2dnZ2dnZ2dnZ2dnZ2cgYXV0aCBrZXlzCg==
type: kubernetes.io/dockerconfigjson
</code></pre>
<p>The data field <code>.dockerconfigjson</code> can be created from this <a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/#registry-secret-existing-credentials" rel="nofollow noreferrer">docs</a>.</p>
