Skip to content

feat: add support for configuring runner worker root device name #1140

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
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
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ locals {
runners_idle_count = var.runner_worker_docker_machine_instance.idle_count
runners_idle_time = var.runner_worker_docker_machine_instance.idle_time
runners_max_builds = local.runners_max_builds_string
runners_root_device_name = var.runner_worker_docker_machine_instance.root_device_name
runners_root_size = var.runner_worker_docker_machine_instance.root_size
runners_volume_type = var.runner_worker_docker_machine_instance.volume_type
runners_iam_instance_profile_name = var.runner_worker_docker_machine_role.profile_name
Expand Down Expand Up @@ -331,7 +332,7 @@ resource "aws_launch_template" "fleet_gitlab_runner" {
enabled = var.runner_worker_docker_machine_instance.monitoring
}
block_device_mappings {
device_name = "/dev/sda1"
device_name = var.runner_worker_docker_machine_instance.root_device_name

ebs {
volume_size = var.runner_worker_docker_machine_instance.root_size
Expand Down
1 change: 1 addition & 0 deletions template/runner-config.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ listen_address = "${prometheus_listen_address}"
"amazonec2-use-ebs-optimized-instance=${runners_ebs_optimized}",
"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-device-name=${runners_root_device_name}",
"amazonec2-root-size=${runners_root_size}",
"amazonec2-volume-type=${runners_volume_type}",
"amazonec2-userdata=%{~ if runners_userdata != "" ~}/etc/gitlab-runner/runners_userdata.sh%{~ endif ~}",
Expand Down
2 changes: 2 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,7 @@ variable "runner_worker_docker_machine_instance" {
monitoring = Enable detailed monitoring for the Runner Worker.
name_prefix = Set the name prefix and override the `Name` tag for the Runner Worker.
private_address_only = Restrict Runner Worker to the use of a private IP address. If `runner_instance.use_private_address_only` is set to `true` (default), `runner_worker_docker_machine_instance.private_address_only` will also apply for the Runner.
root_device_name = The name of the root volume for the Runner Worker.
root_size = The size of the root volume for the Runner Worker.
start_script = Cloud-init user data that will be passed to the Runner Worker. Should not be base64 encrypted.
subnet_ids = The list of subnet IDs to use for the Runner Worker when the fleet mode is enabled.
Expand All @@ -693,6 +694,7 @@ variable "runner_worker_docker_machine_instance" {
monitoring = optional(bool, false)
name_prefix = optional(string, "")
private_address_only = optional(bool, true)
root_device_name = optional(string, "/dev/sda1")
root_size = optional(number, 8)
start_script = optional(string, "")
subnet_ids = optional(list(string), [])
Expand Down