Skip to content
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

feat: Enable throughput & iops configs for managed node_groups #1584

Merged
Merged
Show file tree
Hide file tree
Changes from 2 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
7 changes: 7 additions & 0 deletions examples/managed_node_groups/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,17 @@ module "eks" {

node_groups = {
example = {
create_launch_template = true

desired_capacity = 1
max_capacity = 10
min_capacity = 1

disk_size = 50
disk_type = "gp3"
disk_throughput = 150
disk_iops = 3000

instance_types = ["t3.large"]
capacity_type = "SPOT"
k8s_labels = {
Expand Down
4 changes: 3 additions & 1 deletion modules/node_groups/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ The role ARN specified in `var.default_iam_role_arn` will be used by default. In
| disk\_encrypted | Whether the root disk will be encrypyted. Requires `create_launch_template` to be `true` and `disk_kms_key_id` to be set | bool | false |
| disk\_kms\_key\_id | KMS Key used to encrypt the root disk. Requires both `create_launch_template` and `disk_encrypted` to be `true` | string | "" |
| disk\_size | Workers' disk size | number | Provider default behavior |
| disk\_type | Workers' disk type. Require `create_launch_template` to be `true`| number | `gp3` |
| disk\_type | Workers' disk type. Require `create_launch_template` to be `true`| string | Provider default behavior |
Copy link
Contributor Author

@junaid-ali junaid-ali Sep 13, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated since we don't seem to be setting it to gp3 as the default value, and the default by the provider is gp2
https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/launch_template#volume_type

| disk\_throughput | Workers' disk throughput. Require `create_launch_template` to be `true` and `disk_type` to be `gp3`| number | Provider default behavior |
| disk\_iops | Workers' disk IOPS. Require `create_launch_template` to be `true` and `disk_type` to be `gp3`| number | Provider default behavior |
| ebs\_optimized | Enables/disables EBS optimization. Require `create_launch_template` to be `true` | bool | `true` if defined `instance\_types` are not present in `var.ebs\_optimized\_not\_supported` |
| enable_monitoring | Enables/disables detailed monitoring. Require `create_launch_template` to be `true`| bool | `true` |
| eni_delete | Delete the Elastic Network Interface (ENI) on termination (if set to false you will have to manually delete before destroying) | bool | `true` |
Expand Down
2 changes: 2 additions & 0 deletions modules/node_groups/launch_template.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ resource "aws_launch_template" "workers" {
ebs {
volume_size = lookup(each.value, "disk_size", null)
volume_type = lookup(each.value, "disk_type", null)
iops = lookup(each.value, "disk_iops", null)
throughput = lookup(each.value, "disk_throughput", null)
encrypted = lookup(each.value, "disk_encrypted", null)
kms_key_id = lookup(each.value, "disk_kms_key_id", null)
delete_on_termination = true
Expand Down
2 changes: 2 additions & 0 deletions modules/node_groups/locals.tf
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ locals {
kubelet_extra_args = var.workers_group_defaults["kubelet_extra_args"]
disk_size = var.workers_group_defaults["root_volume_size"]
disk_type = var.workers_group_defaults["root_volume_type"]
disk_iops = var.workers_group_defaults["root_iops"]
disk_throughput = var.workers_group_defaults["root_volume_throughput"]
antonbabenko marked this conversation as resolved.
Show resolved Hide resolved
disk_encrypted = var.workers_group_defaults["root_encrypted"]
disk_kms_key_id = var.workers_group_defaults["root_kms_key_id"]
enable_monitoring = var.workers_group_defaults["enable_monitoring"]
Expand Down