0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

リバースプロキシ下のGitlabでgitlab-runnerを使う

Posted at

私の環境では、SSL終端したリバースプロキシの下にGitlabを下げてある。
Gitlabにはgitlab-runnerという、CIで使うエージェントプログラムがあって、これを適当なマシンで起動しておくと、Gitlabからそのマシンにリポジトリを送り込んでCIを走らせることができる。

しかし、このgitlab-runnerはリポジトリのチェックアウト時に、外向け(つまりリバースプロキシのURL)を使ってチェックアウトしようとする。ネットワークの設定にもよるものの、私の環境では、内部ネットワークからの外向きURLへのアクセスに対してはリバースプロクシを経由せずに直接アクセスするようにパケットを転送している。このような状態でGitlabにアクセスすると、Gitlabはデフォルトで自己署名された証明書を用いるため、gitlab-runnerはSSL検証に失敗してしまう。
具体的には、リポジトリのチェックアウト時に curl: (60) SSL certificate problem: unable to get local issuer certificate と言われてしまう。

そこでgitlab-runnerに内部向けのURLを教える必要がある。
そのためには、/etc/gitlab-runner/config.tomlに対して

[[runners]]
clone_url = "http://inner-addr-of-server.local"

などと書けば良い。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?