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
Failed to pull image "ip:port/repository/ydocker-repo/apps:tag": rpc error: code = Unknown desc = Error response from daemon: Get http://ip:port/v2/repository/docker/app/manifests/1.0: no basic auth credentials
I have setup service account and again i am getting same error.
What's wrong i am doing here.
below is my deployment 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: "Always"
stdin: true
tty: true
ports:
- containerPort: port-number
imagePullPolicy: Always
imagePullSecrets:
- name: myregistrykey
restartPolicy: Always
serviceAccountName: default
Does someone have any idea how to setup registery secrets for clusterIP ?
I usually follow this k8s doc to config push/pull on a private docker registry.
Creating a secret:
Referencing secret on deployment:
To check if the secret info is right, decode the secret
.dockerconfigjson:
value. Should be something similar to this: