diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e21051f..34dfc580 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ project adheres to [Semantic Versioning](http://semver.org/). ### Added -- A tiny but mighty feature. (you're on fire, @me 🔥) +- manage eks workers' root volume size and type ### Changed diff --git a/README.md b/README.md index 788c9062..b5859a85 100644 --- a/README.md +++ b/README.md @@ -90,6 +90,7 @@ Many thanks to [the contributors listed here](https://github.com/terraform-aws-m MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-eks/tree/master/LICENSE) for full details. + ## Inputs | Name | Description | Type | Default | Required | @@ -131,3 +132,4 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a | worker_iam_role_name | IAM role name attached to EKS workers | | worker_security_group_id | Security group ID attached to the EKS workers. | | workers_asg_arns | IDs of the autoscaling groups containing workers. | + diff --git a/variables.tf b/variables.tf index 752fc13f..2de0ea90 100644 --- a/variables.tf +++ b/variables.tf @@ -85,6 +85,9 @@ variable "workers_group_defaults" { asg_max_size = "3" # Maximum worker capacity in the autoscaling group. asg_min_size = "1" # Minimum worker capacity in the autoscaling group. instance_type = "m4.large" # Size of the workers instances. + root_volume_size = "20" # root volume size of workers instances. + root_volume_type = "gp2" # root volume type of workers instances, can be 'standard', 'gp2', or 'io1' + root_iops = "0" # The amount of provisioned IOPS. This must be set with a volume_type of "io1". key_name = "" # The key name that should be used for the instances in the autoscaling group pre_userdata = "" # userdata to pre-append to the default userdata. additional_userdata = "" # userdata to append to the default userdata. diff --git a/workers.tf b/workers.tf index 1184de48..869ffa2d 100644 --- a/workers.tf +++ b/workers.tf @@ -37,6 +37,9 @@ resource "aws_launch_configuration" "workers" { } root_block_device { + volume_size = "${lookup(var.worker_groups[count.index], "root_volume_size", lookup(var.workers_group_defaults, "root_volume_size"))}" + volume_type = "${lookup(var.worker_groups[count.index], "root_volume_type", lookup(var.workers_group_defaults, "root_volume_type"))}" + iops = "${lookup(var.worker_groups[count.index], "root_iops", lookup(var.workers_group_defaults, "root_iops"))}" delete_on_termination = true } }