Skip to content

Commit 30a7a93

Browse files
davidmontoyagoalinetskyi
authored andcommitted
feat: allow set disk size & type on vm runners (terraform-google-modules#235)
1 parent b3ee9ea commit 30a7a93

6 files changed

Lines changed: 32 additions & 4 deletions

File tree

modules/gh-runner-mig-container-vm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ This example shows how to deploy a Self Hosted Runner on MIG Container VMs.
3030
| cooldown\_period | The number of seconds that the autoscaler should wait before it starts collecting information from a new instance. | `number` | `60` | no |
3131
| create\_network | When set to true, VPC,router and NAT will be auto created | `bool` | `true` | no |
3232
| dind | Flag to determine whether to expose dockersock | `bool` | `false` | no |
33+
| disk\_size\_gb | Instance disk size in GB | `number` | `100` | no |
34+
| disk\_type | Instance disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-ssd"` | no |
3335
| gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes |
3436
| image | The github runner image | `string` | n/a | yes |
3537
| instance\_name | The gce instance name | `string` | `"gh-runner"` | no |

modules/gh-runner-mig-container-vm/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ module "mig_template" {
163163
"https://www.googleapis.com/auth/cloud-platform",
164164
]
165165
}
166-
disk_size_gb = 100
167-
disk_type = "pd-ssd"
166+
disk_size_gb = var.disk_size_gb
167+
disk_type = var.disk_type
168168
auto_delete = true
169169
name_prefix = "gh-runner"
170170
source_image_family = "cos-stable"

modules/gh-runner-mig-container-vm/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,15 @@ variable "spot_instance_termination_action" {
131131
type = string
132132
default = "STOP"
133133
}
134+
135+
variable "disk_size_gb" {
136+
type = number
137+
description = "Instance disk size in GB"
138+
default = 100
139+
}
140+
141+
variable "disk_type" {
142+
type = string
143+
description = "Instance disk type, can be either pd-ssd, local-ssd, or pd-standard"
144+
default = "pd-ssd"
145+
}

modules/gh-runner-mig-vm/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ module "gh_runner_mig" {
165165
| enable\_schedule | Enable autoscaling schedule. When enabled, scales based on configured schedule parameters. | `bool` | `false` | no |
166166
| create\_subnetwork | Whether to create subnetwork or use the one provided via subnet\_name | `bool` | `true` | no |
167167
| custom\_metadata | User provided custom metadata | `map(any)` | `{}` | no |
168+
| disk\_size\_gb | Instance disk size in GB | `number` | `100` | no |
169+
| disk\_type | Instance disk type, can be either pd-ssd, local-ssd, or pd-standard | `string` | `"pd-ssd"` | no |
168170
| gh\_runner\_labels | GitHub runner labels to attach to the runners. Docs: https://docs.github.com/en/actions/hosting-your-own-runners/using-labels-with-self-hosted-runners | `set(string)` | `[]` | no |
169171
| gh\_token | Github token that is used for generating Self Hosted Runner Token | `string` | n/a | yes |
170172
| instance\_tags | Additional tags to add to the instances | `list(string)` | `[]` | no |

modules/gh-runner-mig-vm/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ module "mig_template" {
132132
"https://www.googleapis.com/auth/cloud-platform",
133133
]
134134
}
135-
disk_size_gb = 100
136-
disk_type = "pd-ssd"
135+
disk_size_gb = var.disk_size_gb
136+
disk_type = var.disk_type
137137
auto_delete = true
138138
name_prefix = "gh-runner"
139139
source_image_family = var.source_image_family

modules/gh-runner-mig-vm/variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,15 @@ variable "spot_instance_termination_action" {
263263
type = string
264264
default = "STOP"
265265
}
266+
267+
variable "disk_size_gb" {
268+
type = number
269+
description = "Instance disk size in GB"
270+
default = 100
271+
}
272+
273+
variable "disk_type" {
274+
type = string
275+
description = "Instance disk type, can be either pd-ssd, local-ssd, or pd-standard"
276+
default = "pd-ssd"
277+
}

0 commit comments

Comments
 (0)