Gitlab CI runners connection to Kubernetes cluster in private AWS subnet

4/6/2020

I'm going to set up the Gitlab CI pipeline to deploy containers in AWS EKS cluster deployed in private AWS subnets. For sure I'd prefer Gitlab SaaS server, so it's managed by the Gitlab team and I shouldn't care about its maintenance. However, I have some questions:

  1. Can shared runners managed by Gitlab connect to the Kubernetes cluster deployed in AWS private subnets (with no public IPs)? I think no, but maybe there are some options.

  2. If I spin up my own Gitlab runners in private subnets, can I add them to the Gitlab SaaS?

In general, is there any recommendation on how to setup Gitlab runners so they can be joined Gitlab SaaS and talk to Kubernetes cluster by private IP?

Thanks!

-- jumpy
amazon-eks
gitlab-ci
gitlab-ci-runner
kubernetes

1 Answer

5/7/2020

GitLab runner can be in a private or public subnet. You can set up the GitLab runner as a pod inside your EKS cluster, the GitLab runner will keep pings your GitLab server for a new job.

This will help you to set up GitLab runner inside your Kubernetes cluster GitLab Runner Helm Chart

The GitLab server can be the SasS or it may be hosted on your organization server. So your GitLab server needs to be internet accessible.

-- Sriram G
Source: StackOverflow