0

I created a secure private-registry with a self-signed certificate. But I can also login to it using username/password. According to the Kubernetes documentation , the secret types of kubernetes.io/dockercfg and kubernetes.io/dockerconfigjson are used in order to:

store the credentials for accessing a Docker registry for images. When you do not have a Docker config file, or you want to use kubectl to create a Docker registry Secret, you can do:

sudo k0s kubectl create secret docker-registry <secret-name> \
--docker-username=<username> \
--docker-password=<password>

which is what I did and then put the secret inside the deployment helm-chart. Notice that I didn't copy the CA of the registry to the host of docker, helm or kubernetes clients.

Now when I deploy the helm-charts, I get the following error:

Failed to pull image "www.private-registry.com/repo/testimage:2": rpc error: code = Unknown desc = Error response from daemon: Get https:// www .private-registry.com/v2/: x509: certificate signed by unknown authority

Why is it complaining about the certificate even though the secret contains the credentials of the docker-private-registry ?

David Maze
  • 130,717
  • 29
  • 175
  • 215
McLan
  • 2,552
  • 9
  • 51
  • 85
  • Maybe duplicate of this? https://stackoverflow.com/questions/53545732/how-do-i-access-a-private-docker-registry-with-a-self-signed-certificate-using-k – whites11 Jul 27 '21 at 14:04
  • Which version of K8s are you using? Are you able to pull this image manually? –  Jul 28 '21 at 10:09

0 Answers0