Skip to content

feat: Support volume type configuration #579

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ Made with [contributors-img](https://contrib.rocks).
| <a name="input_runners_request_concurrency"></a> [runners\_request\_concurrency](#input\_runners\_request\_concurrency) | Limit number of concurrent requests for new jobs from GitLab (default 1). | `number` | `1` | no |
| <a name="input_runners_request_spot_instance"></a> [runners\_request\_spot\_instance](#input\_runners\_request\_spot\_instance) | Whether or not to request spot instances via docker-machine | `bool` | `true` | no |
| <a name="input_runners_root_size"></a> [runners\_root\_size](#input\_runners\_root\_size) | Runner instance root size in GB. | `number` | `16` | no |
| <a name="input_runners_volume_type"></a> [runners\_volume\_type](#input\_runners\_volume\_type_) | Runner instance volume type. | `string` | `gp2` | no |
| <a name="input_runners_services_volumes_tmpfs"></a> [runners\_services\_volumes\_tmpfs](#input\_runners\_services\_volumes\_tmpfs) | Mount a tmpfs in gitlab service container. https://docs.gitlab.com/runner/executors/docker.html#mounting-a-directory-in-ram | <pre>list(object({<br> volume = string<br> options = string<br> }))</pre> | `[]` | no |
| <a name="input_runners_shm_size"></a> [runners\_shm\_size](#input\_runners\_shm\_size) | shm\_size for the runners, will be used in the runner config.toml | `number` | `0` | no |
| <a name="input_runners_token"></a> [runners\_token](#input\_runners\_token) | Token for the runner, will be used in the runner config.toml. | `string` | `"__REPLACED_BY_USER_DATA__"` | no |
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ locals {
runners_max_builds = local.runners_max_builds_string
runners_machine_autoscaling = local.runners_machine_autoscaling
runners_root_size = var.runners_root_size
runners_volume_type = var.runners_volume_type
runners_iam_instance_profile_name = var.runners_iam_instance_profile_name
runners_use_private_address_only = var.runners_use_private_address
runners_use_private_address = !var.runners_use_private_address
Expand Down
1 change: 1 addition & 0 deletions template/runner-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ listen_address = "${prometheus_listen_address}"
"amazonec2-monitoring=${runners_monitoring}",
"amazonec2-iam-instance-profile=%{ if runners_iam_instance_profile_name != "" }${runners_iam_instance_profile_name}%{ else }${runners_instance_profile}%{ endif ~}",
"amazonec2-root-size=${runners_root_size}",
"amazonec2-volume-type=${runners_volume_type}",
"amazonec2-ami=${runners_ami}"
${docker_machine_options}
]
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,12 @@ variable "runners_root_size" {
default = 16
}

variable "runners_volume_type" {
description = "Runner instance volume type"
type = string
default = "gp2"
}

variable "runners_iam_instance_profile_name" {
description = "IAM instance profile name of the runners, will be used in the runner config.toml"
type = string
Expand Down