gitlab-runners

AckeeCZ/gitlab-runners/gcp

Terraform Module HCL GCP

Terraform module for GitLab CI runners deployed at GCP with focus on Node.js builds

Install
module "gitlab-runners" {
source = "AckeeCZ/gitlab-runners/gcp"
version = "1.2.0"
}
plain text: /constructs/tfmod-ackeecz-gitlab-runners-gcp/install.txt
⭐ Source on GitHub 📦 Registry page
README

Ackee Node.js Optimized Gitlab CI Runners 🦄 Terraform module for GitLab CI runners deployed at GCP with focus on Node.js builds. Why 🦄? Autoscaling by working hours Preemptible instances Distributed cache using GCS (Google Cloud Storage) Registry as a pull through cache for: docker (Docker registry) npm (Verdaccio) NAT or Public IP setup Highly customizable in general First setup After specifying gitlab_url, runner_token, project and optionally some other variables, run terraform. Initialization of the controller will take a while and then the infrastructure is ready (signalized with a newly registered runner in GitLab Runners Admin Area). It is then recommended to adjust the HW requirements (instance types), to balance between quick builds and willingness to pay for them. Our setup can be

Inputs (29)
NameTypeDescriptionDefault
projectstringGCP project for cloud runners required
gitlab_urlstringGitLab URL where cloud runners are intended to be used required
runner_tokenstringRegistration token for runner obtained in GitLab required
zonestringZone for GCE instances"europe-west1-c"
controller_imagestringImage for controller"ubuntu-os-cloud/ubuntu-2004-lts"
runner_concurrencynumberThe maximum number of summoned instances.12
runner_idle_timenumberThe maximum idle time for summoned instances before they went down60
controller_gitlab_untaggedstringRegister the runner to also execute GitLab jobs that are untagged."true"
runner_instance_tagsstringThe GCP instance networking tags to apply"gitlab-runner"
runner_mount_volumeslist(string)Docker volume mounts[ "/cache", "/builds:/builds", "/v
enable_cloud_natboolUse Cloud NAT instance instead of public IP addresesfalse
controller_disk_typestringGCP disk type for controller"pd-balanced"
worker_imagestringImage for provisioned VMs"ubuntu-os-cloud/global/images/family/ub
networkstringGCP network for use"default"
controller_gitlab_namestringName of registered runner in GitLab"GCP runner"
runner_disk_sizestringThe size of the persistent disk in GB for summoned instances (higher number than"200"
runner_idle_count_working_hoursnumberAlways up instances during working hours4
controller_instance_typestringInstance type for controller, speed & power is not needed here"e2-small"
docker_machine_versionstringVersion of docker machine for runners"v0.16.2"
controller_gitlab_tagsstringList of runner's tags delimited with ,"cloud"
runner_instance_typestringRunner instance type. Adjust it for build needs"n2d-standard-2"
runner_cache_locationstringGCS bucket location for runner cache"EUROPE-WEST1"
runner_idle_time_working_hoursnumberThe maximum idle time for summoned instances before they went down during workin600
Outputs (1)
runners_service_account
Resources (9)
google_compute_addressgoogle_compute_instancegoogle_project_iam_membergoogle_service_accountgoogle_service_account_iam_membergoogle_service_account_keygoogle_storage_bucketgoogle_storage_bucket_iam_bindingrandom_string
Details
FrameworkTerraform Module
LanguageHCL
Version1.2.0
Cloud GCP
★ Stars2
Forks4
Total downloads4.8k
Inputs29
Outputs1
Resources9
NamespaceAckeeCZ
Updated