Installing GitLab Runner
GitLab Runner.gitlab-ci.yml
. It helps run automated builds in a Managed Service for Kubernetes cluster.
Getting started
-
Make sure that the security groups for the Managed Service for Kubernetes cluster and its node groups are configured correctly. If any rule is missing, add it.
Warning
The configuration of security groups determines the performance and availability of the cluster and the services and applications running in it.
-
Open the GitLab administration panel in your browser:
- If GitLab is deployed on a Yandex Compute Cloud instance, use its public IP.
- If GitLab is deployed in Yandex Managed Service for GitLab, use the instance FQDN.
-
Get a registration token in the administration panel:
- To configure GitLab Runner throughout the GitLab instance (GitLab administrator access required):
- Click Menu and select the Admin option.
- Choose CI/CD → Runners.
- Click Register an instance runner and save the value of the
Registration token
parameter.
- To configure GitLab Runner for a group or project:
- Select a group or project you want to configure.
- On the left-hand side of the window that opens, click Settings and select the CI/CD option.
- Under Runners, click Expand.
- Save the value of the
Registration token
parameter.
- To configure GitLab Runner throughout the GitLab instance (GitLab administrator access required):
Installation using Yandex Cloud Marketplace
- Go to the folder page
and select Managed Service for Kubernetes. - Click the Managed Service for Kubernetes cluster name and select the
Marketplace tab. - Under Applications available for installation, select GitLab Runner and click Use.
- Configure the application:
-
Namespace: Select or create a namespace for GitLab Runner.
-
Application name: Enter a name for the application.
-
GitLab domain name: Enter a domain for your GitLab instance.
-
Registration token: Specify the previously retrieved registration token.
-
(Optional) Privileged mode for running docker:dind: Enable this option if you want to use docker:dind images.
Warning
The privileged mode increases the risk of information security incidents. Please read the documentation
before using it. -
(Optional) List of tags: Provide a list of tags for task distribution across multiple GitLab Runner.
-
- Click Install.
- Wait for the application to change its status to
Deployed
. - Go back to the Runners page of your GitLab instance, reload the page, and make sure you see a new GitLab Runner.
Installation using a Helm chart
-
Install Helm
v3.7.0 or higher. -
Install kubectl
and configure it to work with the created cluster. -
To install a Helm chart
with GitLab Runner, run the following command:export HELM_EXPERIMENTAL_OCI=1 && \ helm pull oci://cr.yandex/yc-marketplace/yandex-cloud/gitlab-org/gitlab-runner/chart/gitlab-runner \ --version 0.54.0-8 \ --untar && \ helm install \ --namespace <namespace> \ --create-namespace \ --set gitlabDomain=<VM_public_IP_or_GitLab_instance_FQDN> \ --set runnerToken=<previously_retrieved_registration_token> \ gitlab-runner ./gitlab-runner/
Use cases
- Continuous deployment of containerized applications using GitLab.
- Scanning Container Registry for vulnerabilities during continuous deployment of applications using GitLab.
- Storing Docker images in Yandex Container Registry.