I have an on-premise installation of gitlab with an enabled gitlab registry on the same host. So, both gitlab server and gitlab registry are under the same hostname.
The gitlab ci runner is on kubernetes and was installed with the official helm chart.
According to this documentation I can add a certificate as secret in k8s and pass it to gitlab-runner. This works fine to gitlab runner access the gitlab server and download the repo to build but gives me the error
Error logging in to v2 endpoint ... Get https://mygtilab.domain.com/v2: x509 certificate signed by unknown authority
when trying to login to registry
docker login $CI_REGISTRY -u $CI_DEPLOY_USER -p $CI_DEPLOY_PASSWORD
Steps to reproduce:
1 - Create a secret in k8s with the certificate of the gitlab server (I'm not using auto signed)
kubectl create secret generic gitlab-cert --from-file=mygtilab.domain.com -n gitlab-managed-apps
2 - Add the secret name in a values.yml file (
3 - Install gitlab-runner with helm
helm install --namespace gitlab-managed-apps gitlab-runner -f values gitlab/gitlab-runner
--insecure-registries in the gitlab-ci.yml did not help.