
Module deploys GitLab Runner into a Kubernetes cluster via Helm.
Once you have a Corewide Solutions Portal account, this one-time action will use your browser session to retrieve credentials:
shellterraform login solutions.corewide.com
Initialize mandatory providers:
Copy and paste into your Terraform configuration and insert the variables:
hclmodule "tf_k8s_gitlab_ci_runner" {
source = "solutions.corewide.com/kubernetes/tf-k8s-gitlab-ci-runner/helm"
version = "~> 1.0.0"
# specify module inputs here or try one of the examples below
...
}
Initialize the setup:
shellterraform init
Corewide DevOps team strictly follows Semantic Versioning
Specification
to
provide our clients with products that have predictable upgrades between versions. We
recommend
pinning
patch versions of our modules using pessimistic
constraint operator (~>
) to prevent breaking changes during upgrades.
To get new features during the upgrades (without breaking compatibility), use
~> 1.0
and run
terraform init -upgrade
For the safest setup, use strict pinning with version = "1.0.0"
All notable changes to this project are documented here.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
node_selector
and job_node_selector
variables for GitLab Runner placement managementjob_service_account_name_prefix
variable for providing name prefix of Service Accounts allowed to be used in CI job podspipeline_image
variable that will replace default_image
in v1.5default_image
variable in favour of pipeline_image
and will be deleted in v1.5app_version
and chart_version
variables for GitLab Runner managementFirst stable version
Deploy GitLab Runner with mandatory values only:
hclmodule "gitlab_runner" {
source = "solutions.corewide.com/kubernetes/tf-k8s-gitlab-ci-runner/helm"
version = "~> 1.0"
registration_token = "registration_token"
}
Deploy GitLab Runner with custom configuration:
hclmodule "gitlab_runner" {
source = "solutions.corewide.com/kubernetes/tf-k8s-gitlab-ci-runner/helm"
version = "~> 1.0"
registration_token = "registration_token"
gitlab_url = "https://client-gitlab.com"
namespace = "ci"
pipeline_image = "alpine/git"
custom_values = {
node_selector = {
"node\.kubernetes\.io/instance-type" = "m5.large"
},
}
}
Variable | Description | Type | Default | Required | Sensitive |
---|---|---|---|---|---|
name_prefix |
Name prefix for all the resources created by the module | string |
yes | no | |
registration_token |
Registration token for GitLab Runner | string |
yes | yes | |
concurrent_jobs |
Number of pipelines running at the same time | number |
4 |
no | no |
create_namespace |
Indicates creation of dedicated namespace for GitLab Runner | bool |
true |
no | no |
custom_values |
Custom values for GitLab Runner | map(any) |
{} |
no | no |
default_image |
Default container image to run pipeline steps in | string |
docker:dind |
no | no |
gitlab_url |
GitLab server URL to connect GitLab Runner to | string |
https://gitlab.com |
no | no |
namespace |
The namespace to install GitLab Runner into | string |
gitlab |
no | no |
termination_period |
The duration in seconds that the pod has to terminate gracefully, after the job completed | number |
1800 |
no | no |
Dependency | Version | Kind |
---|---|---|
terraform |
>= 1.0 |
CLI |
hashicorp/helm |
~> 2.5 |
provider |
hashicorp/kubernetes |
~> 2.9 |
provider |