Unauthorized error when connecting to a private container registry on kubernetes
Summary
Somehow the k8s runner can't connect to GCR (private container registry).
Steps to reproduce
Having a k8s cluster running and a private container registry. I created a secret as described here and then in the values.yml
I added the secret name to the array of imagePullSecrets
. I also verified that the secret, service account and the runner are all in the same namespace.
Actual behavior
Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
Expected behavior
It should connect succesfully to the GCR.
Relevant logs and/or screenshots
Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
Environment description
k8s: v1.14.8-gke.33
Used GitLab Runner version
Running with gitlab-runner 12.7.1 (003fe500)
Using Kubernetes executor with image docker:dind ...
Edited by Carlos Henrique Guardão Gandarez