Skip to content

Commit

Permalink
Merge pull request #38 from Snowflake-Labs/eks-node-option
Browse files Browse the repository at this point in the history
Add customize node min, max and desired option.
  • Loading branch information
sfc-gh-bkou authored Nov 14, 2024
2 parents 5161884 + dc10c67 commit 09db1bd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
6 changes: 3 additions & 3 deletions eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ module "eks" {

eks_managed_node_groups = {
node-group-1 = {
min_size = 3
max_size = 5
desired_size = 3
min_size = var.eks_managed_node_groups_options.min_size
max_size = var.eks_managed_node_groups_options.max_size
desired_size = var.eks_managed_node_groups_options.desired_size

instance_types = var.node_group_instance_sizes
capacity_type = "ON_DEMAND"
Expand Down
2 changes: 2 additions & 0 deletions templates/external_dns_private_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ zoneIdFilters: ["${aws_private_hosted_zone}"]
annotationFilter: "alb.ingress.kubernetes.io/scheme=internal"
txtOwnerId: ${eks_cluster_id}

%{ if anytrue([image_registry != null, image_repository != null, image_tag != null]) ~}
image:
%{ if image_registry != null ~}
registry: ${image_registry}
Expand All @@ -29,3 +30,4 @@ image:
%{ if image_tag != null ~}
tag: ${image_tag}
%{ endif ~}
%{ endif ~}
2 changes: 2 additions & 0 deletions templates/external_dns_values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ zoneIdFilters: ["${aws_public_hosted_zone}"]
annotationFilter: "alb.ingress.kubernetes.io/scheme=internet-facing"
txtOwnerId: ${eks_cluster_id}

%{ if anytrue([image_registry != null, image_repository != null, image_tag != null]) ~}
image:
%{ if image_registry != null ~}
registry: ${image_registry}
Expand All @@ -29,3 +30,4 @@ image:
%{ if image_tag != null ~}
tag: ${image_tag}
%{ endif ~}
%{ endif ~}
14 changes: 14 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,20 @@ variable "eks_aws_auth_configmap_users" {
default = []
}

variable "eks_managed_node_groups_options" {
description = "An object variable containing key-value pairs for the eks_managed_node_groups parameters."
type = object({
min_size = number
max_size = number
desired_size = number
})
default = {
min_size = 3
max_size = 5
desired_size = 3
}
}

variable "create_logs_bucket" {
description = "Flag to create an S3 bucket or not."
type = bool
Expand Down

0 comments on commit 09db1bd

Please sign in to comment.