Skip to content

Commit 2814efc

Browse files
Merge pull request #66 from ozbillwang/#57
Manage eks workers' root_block_device
2 parents bc84805 + 5628a24 commit 2814efc

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ project adheres to [Semantic Versioning](http://semver.org/).
99

1010
### Added
1111

12-
- A tiny but mighty feature. (you're on fire, @me 🔥)
12+
- manage eks workers' root volume size and type
1313

1414
### Changed
1515

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Many thanks to [the contributors listed here](https://github.com/terraform-aws-m
9090
9191
MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-aws-eks/tree/master/LICENSE) for full details.
9292
93+
9394
## Inputs
9495
9596
| Name | Description | Type | Default | Required |
@@ -131,3 +132,4 @@ MIT Licensed. See [LICENSE](https://github.com/terraform-aws-modules/terraform-a
131132
| worker_iam_role_name | IAM role name attached to EKS workers |
132133
| worker_security_group_id | Security group ID attached to the EKS workers. |
133134
| workers_asg_arns | IDs of the autoscaling groups containing workers. |
135+

variables.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ variable "workers_group_defaults" {
8585
asg_max_size = "3" # Maximum worker capacity in the autoscaling group.
8686
asg_min_size = "1" # Minimum worker capacity in the autoscaling group.
8787
instance_type = "m4.large" # Size of the workers instances.
88+
root_volume_size = "20" # root volume size of workers instances.
89+
root_volume_type = "gp2" # root volume type of workers instances, can be 'standard', 'gp2', or 'io1'
90+
root_iops = "0" # The amount of provisioned IOPS. This must be set with a volume_type of "io1".
8891
key_name = "" # The key name that should be used for the instances in the autoscaling group
8992
pre_userdata = "" # userdata to pre-append to the default userdata.
9093
additional_userdata = "" # userdata to append to the default userdata.

workers.tf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ resource "aws_launch_configuration" "workers" {
3737
}
3838

3939
root_block_device {
40+
volume_size = "${lookup(var.worker_groups[count.index], "root_volume_size", lookup(var.workers_group_defaults, "root_volume_size"))}"
41+
volume_type = "${lookup(var.worker_groups[count.index], "root_volume_type", lookup(var.workers_group_defaults, "root_volume_type"))}"
42+
iops = "${lookup(var.worker_groups[count.index], "root_iops", lookup(var.workers_group_defaults, "root_iops"))}"
4043
delete_on_termination = true
4144
}
4245
}

0 commit comments

Comments
 (0)