<p>I've k8s deployment yaml which I need to pull image
from private registry
where should I put the</p>
<pre><code>host 
user 
password 
</code></pre>
<p>deployment.yml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: tra
  namespace: ba
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tra
  template:
    metadata:
      labels:
        app: tra
    spec:
      containers:
        - name: tra
          image: de/sec:0.0.10
          imagePullPolicy: Always
          ports:
            - containerPort: 5000
</code></pre>
<p>I found this but it doesnt really helps</p>
<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/</a></p>

NSS
<p>The doc contains detailed about pulling secrets from private registry.</p>
<p>Summary is,</p>
<ol>
<li>Create secret using following command</li>
</ol>
<pre><code>kubectl create secret docker-registry regcred --docker-server=&lt;your-registry-server&gt; --docker-username=&lt;your-name&gt; --docker-password=&lt;your-pword&gt; --docker-email=&lt;your-email&gt;
</code></pre>
<ol start="2">
<li>Than specify the secret name in your deployment file by adding following line</li>
</ol>
<pre><code>imagePullSecrets:
  - name: regcred
</code></pre>
<p>So, Create a secret and modify your deployment like</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: tra
  namespace: ba
spec:
  replicas: 1
  selector:
    matchLabels:
      app: tra
  template:
    metadata:
      labels:
        app: tra
    spec:
      containers:
        - name: tra
          image: de/sec:0.0.10
          imagePullPolicy: Always
          ports:
            - containerPort: 5000
      imagePullSecrets:
        - name: regcred
</code></pre>
<p>If you want to create secret from file then update following file into secret.yaml</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: regcred
  namespace: &lt;namespace&gt;
data:
  .dockerconfigjson: &lt; add here output of cat ~/.docker/config.json| base64 -w 0 &gt;
type: kubernetes.io/dockerconfigjson
</code></pre>
<p>then run <code>kubectl apply -f secret.yaml</code></p>
