This module handles the opinionated creation of infrastructure necessary to deploy Github Self Hosted Runners on GKE.
This includes:
- Enabling necessary APIs
- VPC
- GKE Cluster
- Kubernetes Secret
Below are some examples:
This example shows how to deploy Self Hosted Runners on GKE that supports Docker Workflows.
This example shows how to deploy a simple GKE Self Hosted Runner.
Name | Description | Type | Default | Required |
---|---|---|---|---|
create_network | When set to true, VPC will be auto created | bool |
true |
no |
gh_token | Github token that is used for generating Self Hosted Runner Token | string |
n/a | yes |
ip_range_pods_cidr | The secondary ip range cidr to use for pods | string |
"192.168.0.0/18" |
no |
ip_range_pods_name | The secondary ip range to use for pods | string |
"ip-range-pods" |
no |
ip_range_services_cider | The secondary ip range cidr to use for services | string |
"192.168.64.0/18" |
no |
ip_range_services_name | The secondary ip range to use for services | string |
"ip-range-scv" |
no |
machine_type | Machine type for runner node pool | string |
"n1-standard-4" |
no |
max_node_count | Maximum number of nodes in the runner node pool | number |
4 |
no |
min_node_count | Minimum number of nodes in the runner node pool | number |
2 |
no |
network_name | Name for the VPC network | string |
"runner-network" |
no |
project_id | The project id to deploy Github Runner cluster | string |
n/a | yes |
region | The GCP region to deploy instances into | string |
"us-east4" |
no |
repo_name | Name of the repo for the Github Action | string |
n/a | yes |
repo_owner | Owner of the repo for the Github Action | string |
n/a | yes |
repo_url | Repo URL for the Github Action | string |
n/a | yes |
runner_k8s_config | Name for the k8s secret required to configure gh runners on GKE | string |
"runner-k8s-config" |
no |
service_account | Optional Service Account for the nodes | string |
"" |
no |
subnet_ip | IP range for the subnet | string |
"10.0.0.0/17" |
no |
subnet_name | Name for the subnet | string |
"runner-subnet" |
no |
subnetwork_project | The ID of the project in which the subnetwork belongs. If it is not provided, the project_id is used. | string |
"" |
no |
zones | The GCP zone to deploy gke into | list(string) |
[ |
no |
Name | Description |
---|---|
ca_certificate | The cluster ca certificate (base64 encoded) |
client_token | The bearer token for auth |
cluster_name | Cluster name |
kubernetes_endpoint | The cluster endpoint |
location | Cluster location |
network_name | Name of VPC |
service_account | The default service account used for running nodes. |
subnet_name | Name of VPC |
Before this module can be used on a project, you must ensure that the following pre-requisites are fulfilled:
-
Required APIs are activated
"iam.googleapis.com", "cloudresourcemanager.googleapis.com", "containerregistry.googleapis.com", "container.googleapis.com", "storage-component.googleapis.com", "logging.googleapis.com", "monitoring.googleapis.com"