Kubernetes: ignores the secret in helm and shows `certificate signed by unknown authority`

7/27/2021

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 ?

-- McLan
docker-registry
kubernetes

0 Answers