gitlab-runner register 注册报错

ERROR: Registering runner... failed                 runner=yeN77YKp status=couldn't execute POST against https://gitlab.xxx.com/api/v4/runners: Post https://gitlab.xxx.com/api/v4/runners: x509: certificate signed by unknown authority (possibly because of "x509: invalid signature: parent certificate cannot sign this kind of certificate" while trying to verify candidate authority certificate "gitlab.xxx.com")
PANIC: Failed to register this runner. Perhaps you are having network problems

这个报错是在 gitlab 有http 改成https时 才出现的,与ca 证书有关。

需要gitlabserver 端 的证书 cp 到gitlab-runner 上,

再进行注册

[root@test-gitlab-runner ~]# gitlab-runner register -n \
--tls-ca-file=/root/key/server.crt \
--url=https://gitlab.sxw.com/ \
--registration-token=yeN77YKpPHVPgsWkJMhj \
--name=test1 \
--run-untagged=true \
--locked=true \
--executor=shell 
Runtime platform                                    arch=amd64 os=linux pid=11003 revision=4745a6f3 version=11.8.0
Running in system-mode.                            
                                                   
Registering runner... succeeded                     runner=yeN77YKp
Runner registered successfully. Feel free to start it, but if it's running already the config should be automatically reloaded! 
[root@test-gitlab-runner ~]# 

这次注册成功了^_^ ^_^ ^_^ !

你可能感兴趣的:(Git)