Skip to content

Latest commit

 

History

History
75 lines (58 loc) · 3.33 KB

File metadata and controls

75 lines (58 loc) · 3.33 KB

Self Hosted Runners on Managed Instance Group

This module handles the opinionated creation of infrastructure necessary to deploy Github Self Hosted Runners on MIG Container VMs.

This includes:

  • Enabling necessary APIs
  • VPC
  • NAT & Cloud Router
  • MIG Container Instance Template
  • MIG Instance Manager
  • FW Rules

Below are some examples:

This example shows how to deploy a Self Hosted Runner that supports Docker Workflows on MIG Container VMs.

This example shows how to deploy a Self Hosted Runner on MIG Container VMs.

Inputs

Name Description Type Default Required
additional_metadata Additional metadata to attach to the instance map(any) {} no
cooldown_period The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. number 60 no
create_network When set to true, VPC,router and NAT will be auto created bool true no
dind Flag to determine whether to expose dockersock bool false no
gh_token Github token that is used for generating Self Hosted Runner Token string n/a yes
image The github runner image string n/a yes
instance_name The gce instance name string "gh-runner" no
network_name Name for the VPC network string "gh-runner-network" no
project_id The project id to deploy Github Runner 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
restart_policy The desired Docker restart policy for the runner image string "Always" no
service_account Service account email address string "" no
subnet_ip IP range for the subnet string "10.10.10.0/24" no
subnet_name Name for the subnet string "gh-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
target_size The number of runner instances number 2 no

Outputs

Name Description
mig_instance_group The instance group url of the created MIG
mig_instance_template The name of the MIG Instance Template
mig_name The name of the MIG
network_name Name of VPC
service_account Service account email for GCE
subnet_name Name of VPC

Requirements

Before this module can be used on a project, you must ensure that the following pre-requisites are fulfilled:

  1. Required APIs are activated

    "iam.googleapis.com",
    "cloudresourcemanager.googleapis.com",
    "containerregistry.googleapis.com",
    "storage-component.googleapis.com",
    "logging.googleapis.com",
    "monitoring.googleapis.com"