Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
8 changes: 6 additions & 2 deletions examples/aws-project-byoc-I/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,12 @@ locals {
}

# Kubernetes node group specifications and resource quotas
# Defines the compute capacity and node types for the EKS cluster
k8s_node_groups = data.zillizcloud_byoc_i_project_settings.this.node_quotas
# Merges node quotas from Zilliz cloud settings with optional ami_type overrides
k8s_node_groups = {
for name, ng in data.zillizcloud_byoc_i_project_settings.this.node_quotas : name => merge(ng, {
ami_type = lookup(var.k8s_node_group_ami_type, name, "")
})
}

# Zilliz project identifier for resource tagging and organization
# Links AWS resources back to the specific Zilliz cloud project
Expand Down
11 changes: 11 additions & 0 deletions examples/aws-project-byoc-I/terraform.sample.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ minimal_roles = {
}
}

# Optional AMI type override per node group (core, index, search, fundamental)
# By default, AMI type is auto-detected from instance architecture:
# - ARM instances (e.g., m6g, c7g, t4g) -> AL2023_ARM_64_STANDARD
# - x86 instances (e.g., m6i, c5, r5) -> AL2023_x86_64_STANDARD
# k8s_node_group_ami_type = {
# fundamental = "BOTTLEROCKET_x86_64"
# search = "BOTTLEROCKET_x86_64"
# index = "BOTTLEROCKET_x86_64"
# core = "BOTTLEROCKET_x86_64"
# }

# Enable AWS Client-Side Encryption (CSE) for Milvus data
# When enabled without aws_cse_exiting_key_arn, a new KMS key will be created automatically
enable_aws_cse = false
Expand Down
27 changes: 27 additions & 0 deletions examples/aws-project-byoc-I/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,31 @@ variable "aws_cse_exiting_key_arn" {
description = "The ARN of the existing KMS key to use for AWS CSE"
type = string
default = ""
}

variable "k8s_node_group_ami_type" {
description = <<-EOT
Optional AMI type override per node group (core, index, search, fundamental).
By default, the AMI type is auto-detected based on instance architecture:
- ARM instances (e.g., m6g, c7g, t4g) -> AL2023_ARM_64_STANDARD
- x86 instances (e.g., m6i, c5, r5) -> AL2023_x86_64_STANDARD

When specified, the provided value takes precedence over auto-detection.
Only the node groups listed in the map are overridden; others keep auto-detection.

Example - override a single node group:
k8s_node_group_ami_type = {
core = "AL2_x86_64"
}

Example - override multiple node groups:
k8s_node_group_ami_type = {
fundamental = "BOTTLEROCKET_x86_64"
search = "BOTTLEROCKET_x86_64"
index = "BOTTLEROCKET_x86_64"
core = "BOTTLEROCKET_x86_64"
}
EOT
type = map(string)
default = {}
}
19 changes: 10 additions & 9 deletions modules/aws_byoc_i/eks/eks_nodegroup.tf
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,16 @@ resource "aws_launch_template" "diskann" {
}


# Determine AMI type based on instance architecture
# Determine AMI type for each node group:
# - Use the explicitly provided ami_type if set
# - Otherwise auto-detect from instance type (ARM 'g' suffix -> AL2023_ARM_64_STANDARD, else AL2023_x86_64_STANDARD)
locals {
# Map instance types to their appropriate AMI types
# ARM instances typically have 'g' in their generation identifier (e.g., m6g, c7g, t4g)
# This regex matches instance types with 'g' after the number, which indicates ARM architecture
ami_types = {
search = can(regex("^[a-z]+[0-9]+g[a-z]*\\.", var.k8s_node_groups.search.instance_types)) ? "AL2023_ARM_64_STANDARD" : "AL2023_x86_64_STANDARD"
core = can(regex("^[a-z]+[0-9]+g[a-z]*\\.", var.k8s_node_groups.core.instance_types)) ? "AL2023_ARM_64_STANDARD" : "AL2023_x86_64_STANDARD"
index = can(regex("^[a-z]+[0-9]+g[a-z]*\\.", var.k8s_node_groups.index.instance_types)) ? "AL2023_ARM_64_STANDARD" : "AL2023_x86_64_STANDARD"
fundamental = can(regex("^[a-z]+[0-9]+g[a-z]*\\.", var.k8s_node_groups.fundamental.instance_types)) ? "AL2023_ARM_64_STANDARD" : "AL2023_x86_64_STANDARD"
for name, ng in var.k8s_node_groups : name => (
ng.ami_type != "" ? ng.ami_type : (
can(regex("^[a-z]+[0-9]+g[a-z]*\\.", ng.instance_types)) ? "AL2023_ARM_64_STANDARD" : "AL2023_x86_64_STANDARD"
)
)
}
}

Expand Down Expand Up @@ -453,7 +453,8 @@ resource "time_sleep" "wait_init" {
}

resource "aws_eks_node_group" "init" {
ami_type = "AL2023_x86_64_STANDARD"
# make it share the same AMI type as core node group
ami_type = local.ami_types.core
capacity_type = "ON_DEMAND"
cluster_name = local.eks_cluster_name

Expand Down
1 change: 1 addition & 0 deletions modules/aws_byoc_i/eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ variable "k8s_node_groups" {
desired_size = number
instance_types = string
capacity_type = string
ami_type = optional(string, "")
}))

default = {
Expand Down