<p>We have setup private registery using nexus on kubernetes cluster. we expose our registery on cluster ip for dedicated ip and we are able to pull push using docker. when i setup docker credentials for private registery using secrets, i am getting error as below</p>
<p><code>Failed to pull image &quot;ip:port/repository/ydocker-repo/apps:tag&quot;: rpc error: code = Unknown desc = Error response from daemon: Get http://ip:port/v2/repository/docker/app/manifests/1.0: no basic auth credentials</code></p>
<p>I have setup service account and again i am getting same error.</p>
<p>What's wrong i am doing here.</p>
<p>below is my deployment code</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: xyz
spec:
  selector:
    matchLabels:
      app: xyz
  replicas: 3
  template:
    metadata:
      labels:
        app: xyz
    spec:
     containers:
     - name: yuwee-app-server
       image: ip:port/repository/ydocker-repo/apps:tag
       imagePullPolicy: &quot;Always&quot;
       stdin: true
       tty: true
       ports:
       - containerPort: port-number
       imagePullPolicy: Always
     imagePullSecrets:
     - name: myregistrykey
     restartPolicy: Always
     serviceAccountName: default
</code></pre>
<p>Does someone have any idea how to setup registery secrets for clusterIP ?</p>

Dharmendra Jha
<p>so i found out issue. my deployment is inside a namespace and i have created secrets inside default namespace, which should be inside that namespace. now it's working what i expected.</p>
