Skip to content

Commit

Permalink
Add opts for extra node pool sizes (#99)
Browse files Browse the repository at this point in the history
Co-authored-by: Addison Higham <[email protected]>
  • Loading branch information
jdmaguire and Addison Higham authored Mar 14, 2023
1 parent a8cda4c commit 6610864
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,10 @@ You can also disable `kubernetes-external-secrets` by setting the input `enable-
| <a name="input_external_secrets_helm_chart_repository"></a> [external\_secrets\_helm\_chart\_repository](#input\_external\_secrets\_helm\_chart\_repository) | The repository containing the kubernetes-external-secrets helm chart. | `string` | `"https://external-secrets.github.io/kubernetes-external-secrets"` | no |
| <a name="input_external_secrets_helm_chart_version"></a> [external\_secrets\_helm\_chart\_version](#input\_external\_secrets\_helm\_chart\_version) | Helm chart version for kubernetes-external-secrets. Defaults to "8.3.0". See https://github.com/external-secrets/kubernetes-external-secrets/tree/master/charts/kubernetes-external-secrets for updates. | `string` | `"8.3.0"` | no |
| <a name="input_external_secrets_settings"></a> [external\_secrets\_settings](#input\_external\_secrets\_settings) | Additional settings which will be passed to the Helm chart values, see https://github.com/external-secrets/kubernetes-external-secrets/tree/master/charts/kubernetes-external-secrets for available options. | `map(any)` | `{}` | no |
| <a name="input_extra_node_pool_desired_size"></a> [extra\_node\_pool\_desired\_size](#input\_extra\_node\_pool\_desired\_size) | The desired size of the node pool AutoScaling group. | `number` | `0` | no |
| <a name="input_extra_node_pool_instance_types"></a> [extra\_node\_pool\_instance\_types](#input\_extra\_node\_pool\_instance\_types) | Set of instance types of an extra node pool. Same properties as default node pool except name and instance types. | `list(string)` | `[]` | no |
| <a name="input_extra_node_pool_max_size"></a> [extra\_node\_pool\_max\_size](#input\_extra\_node\_pool\_max\_size) | The max size of the node pool AutoScaling group. | `number` | `0` | no |
| <a name="input_extra_node_pool_min_size"></a> [extra\_node\_pool\_min\_size](#input\_extra\_node\_pool\_min\_size) | The minimum size of the node pool AutoScaling group. | `number` | `0` | no |
| <a name="input_func_pool_ami_id"></a> [func\_pool\_ami\_id](#input\_func\_pool\_ami\_id) | The AMI ID to use for the func pool nodes. Defaults to the latest EKS Optimized AMI provided by AWS | `string` | `""` | no |
| <a name="input_func_pool_ami_is_eks_optimized"></a> [func\_pool\_ami\_is\_eks\_optimized](#input\_func\_pool\_ami\_is\_eks\_optimized) | If the custom AMI is an EKS optimized image, ignored if ami\_id is not set. If this is true then bootstrap.sh is called automatically (max pod logic needs to be manually set), if this is false you need to provide all the node configuration in pre\_userdata | `bool` | `true` | no |
| <a name="input_func_pool_desired_size"></a> [func\_pool\_desired\_size](#input\_func\_pool\_desired\_size) | Desired number of worker nodes | `number` | `0` | no |
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ locals {
}

snc_node_config = { for i, v in var.private_subnet_ids : "snc-node-pool${i}" => merge(local.node_pool_defaults, { subnets = [var.private_subnet_ids[i]], name = "snc-node-pool${i}" }) }
snc_extra_node_config = (length(var.extra_node_pool_instance_types) == 0 ? {} : { for i, v in var.private_subnet_ids : "snc-extra-node-pool${i}" => merge(local.node_pool_defaults, { subnets = [var.private_subnet_ids[i]], name = "snc-extra-node-pool${i}", instance_types = var.extra_node_pool_instance_types }) })
snc_extra_node_config = (length(var.extra_node_pool_instance_types) == 0 ? {} : { for i, v in var.private_subnet_ids : "snc-extra-node-pool${i}" => merge(local.node_pool_defaults, { subnets = [var.private_subnet_ids[i]], name = "snc-extra-node-pool${i}", instance_types = var.extra_node_pool_instance_types, min_capacity = var.extra_node_pool_min_size, max_capacity = var.extra_node_pool_max_size, desired_capacity = var.extra_node_pool_desired_size }) })
snc_func_config = { for i, v in var.private_subnet_ids : "snc-func-pool${i}" => merge(local.func_pool_defaults, { subnets = [var.private_subnet_ids[i]], name = "snc-func-pool${i}" }) }
node_groups = (var.enable_func_pool ? merge(local.snc_node_config, local.snc_func_config, local.snc_extra_node_config) : merge(local.snc_node_config, local.snc_extra_node_config))
}
Expand Down
18 changes: 18 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,24 @@ variable "extra_node_pool_instance_types" {
type = list(string)
}

variable "extra_node_pool_max_size" {
default = 0
description = "The max size of the node pool AutoScaling group."
type = number
}

variable "extra_node_pool_min_size" {
default = 0
description = "The minimum size of the node pool AutoScaling group."
type = number
}

variable "extra_node_pool_desired_size" {
default = 0
description = "The desired size of the node pool AutoScaling group."
type = number
}

variable "node_pool_labels" {
default = {}
description = "A map of kubernetes labels to add to the node pool."
Expand Down

0 comments on commit 6610864

Please sign in to comment.