我正在从官方 jetstack
运行 GitLab 实例我在 Google Cloud 中的 GKE 集群上的 helm 图表。
我想将一个 Windows 虚拟机添加到我的 VPC 网络中,该网络只能访问内部网络。
通常,您必须针对 GitLab 的 https 地址注册 GitLab 运行器,这在内部网络中是不可能的。有没有办法通过内部网络向 GitLab 实例注册 GitLab 运行器?
GitLab 实例通过 nginx-ingress
发布其 https 资源也在该 GKE 集群上运行的 Controller 。
有没有办法注册 gitlab-unicorn pod,其内部 IP 正在监听端口 8080
?
提前致谢!
最佳答案
有两种选择:
clone_url
如果 runner 可以访问 Gitlab
实例,但它的名称不同于解析名称 ssh-tunnel
如果运行者不能直接访问 Gitlab
实例 clone_url
如果您的
gitlab
可以从内网访问,可以使用clone_url
选项见 documentation :
How
clone_url
worksIn cases where the GitLab instance is exposed to an URL which can’t be used by the runner, a
clone_url
can be configured. For example; GitLab is exposed tohttps://gitlab.example.com
, but the runner can’t reach that because of a firewall setup. If the runner can reach the node on192.168.1.23
, theclone_url
should be set to"http://192.168.1.23
.Only if the
clone_url
is set, the runner will construct a clone URL in the form ofhttp://gitlab-ci-token:s3cr3tt0k3n@192.168.1.23/namespace/project.git
ssh-tunnel
如果您的 Gitlab 实例没有任何可用地址,您可以设置
ssh-tunnel
给它。SSH Tunneling is a method of transporting arbitrary networking data over an encrypted SSH connection. It can be used to add encryption to legacy applications. It can also be used to implement VPNs (Virtual Private Networks) and access intranet services across firewalls.
ssh -L 8080:gitlab.yourinstance.com:80 gw.yourgateway.com
然后你可以使用
gw.yourgateway.com:8080
作为你的clone_url
关于kubernetes - 仅具有内部网络的 VM 上的 GitLab Runner,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59422571/