Search code examples
kubernetesgitlabgitlab-ci

Gitlab runner on kubernetes with tls: handshake failure


I have bare-metal kubernetes cluster with 1 master and 2 worker nodes. Also I installed helm. And then I tried to set up gitlab runner using helm according to guide, set runnerToken, gitlabUrl. And ran it. But pod has not been run. And in the logs of pod I can see following:

Registration attempt 30 of 30
Runtime platform arch=amd64 os=linux pid=333 revision=8ec04662 version=16.3.0
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: Verifying runner... failed runner=<runner>
status=couldn't execute POST against https://gitlab.com/api/v4/runners/verify:
Post "https://gitlab.com/api/v4/runners/verify": remote error: tls: handshake failure
PANIC: Failed to verify the runner.

What is reason this behavior?

UPD: I got deep and realized that it had not been related to giltab runner. I cannot request curl -v https://gitlab.com from any pod in my cluster. Log is below:

root@k8s-pod:/# curl -v https://gitlab.com
*   Trying 13.33.243.53:443...
* Connected to gitlab.com (13.33.243.53) port 443 (#0)
* ALPN: offers h2,http/1.1
* TLSv1.3 (OUT), TLS handshake, Client hello (1):
*  CAfile: /etc/ssl/certs/ca-certificates.crt
*  CApath: /etc/ssl/certs
* TLSv1.3 (IN), TLS alert, handshake failure (552):
* OpenSSL/3.0.9: error:0A000410:SSL routines::sslv3 alert handshake failure
* Closing connection 0
curl: (35) OpenSSL/3.0.9: error:0A000410:SSL routines::sslv3 alert handshake failure

Solution

  • I realized that it caused by known issue and not related to gitab in my case