couldn't execute POST against https://gitlab.local/api/v4/runners: Post "https://gitlab.local/api/v4/runners": x509: certificate relies on legacy Common Name field, use SANs instead - gitlab runner in helm chart
Summary
After reading all docs that explain how to deploy a runner using helm chart, I've created a new values file and tried to register the new runner using the helm chart install.
A new pod was created but it's return an error: Registration attempt 1 of 30 Runtime platform arch=amd64 os=linux pid=13 revision=defc7017 version=15.4.0~beta.5.gdefc7017 WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing: WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...Merging configuration from template file "/configmaps/config.template.toml" ERROR: Registering runner... failed runner=QUVPa1zf status=couldn't execute POST against https://gitlab.local/api/v4/runners: Post "https://gitlab.local/api/v4/runners": x509: certificate relies on legacy Common Name field, use SANs instead PANIC: Failed to register the runner.
After that, did some research and found that maybe we missing 'crt' or 'pem' file for TLS/SSL connection, so I've added the 'pem' as a secret to the cluster (in all other normal runner { not k8s } we used 'pem'), and then told in the values the secret name:
The secret was added using the next command:
kubectl create secret generic gitlab-ca --from-file=gitlab.local.pem
and values.yml I've changed only those:
gitlabUrl: https://gitlab.dc.local/
runnerRegistrationToken: "IDontWantToShareTheToken"
certsSecretName: gitlab-ca
all other values are kept as they are.
Steps to reproduce
download the helm chart of GitLab runner and customize the values with a custom URL for GitLab (gitlab.local in this example).
Actual behavior
The pod status: Failed this is looping:
Registration attempt 16 of 30 Runtime platform arch=amd64 os=linux pid=127 revision=defc7017 version=15.4.0~beta.5.gdefc7017 WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing: WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...Merging configuration from template file "/configmaps/config.template.toml" ERROR: Registering runner... failed runner=QUVPa1zf status=couldn't execute POST against https://gitlab.local/api/v4/runners: Post "https://gitlab.local/api/v4/runners": x509: certificate relies on legacy Common Name field, use SANs instead PANIC: Failed to register the runner.
Expected behavior
see runner is registered fine.
Environment description
kubectl version --short
Flag --short has been deprecated, and will be removed in the future. The --short output will become the default.
Client Version: v1.25.0
Kustomize Version: v4.5.7
Server Version: v1.24.4
docker version
Client: Docker Engine - Community
Version: 20.10.18
API version: 1.41
Go version: go1.18.6
Git commit: b40c2f6
Built: Thu Sep 8 23:11:45 2022
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.18
API version: 1.41 (minimum version 1.12)
Go version: go1.18.6
Git commit: e42327a
Gitlab: GitLab Enterprise Edition 14.6.1-ee
Used GitLab Runner version
in the values I can see this:
image:
registry: registry.gitlab.com
image: gitlab-org/gitlab-runner
# tag: alpine-v11.6.0
from deployment I see image tag is: alpine-bleeding