Skip to content

Commit

Permalink
fix VPC CNI provisioning without pod subnets (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
steved authored Mar 15, 2024
1 parent 6e71c19 commit ec08fc8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions modules/nodes/addons.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,19 @@ locals {
AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG = "true"
ENI_CONFIG_LABEL_DEF = "topology.kubernetes.io/zone" } : {})

vpc_cni_eni_config = local.is_pod_sb ? {
vpc_cni_eni_config = {
create = true
region = var.region
subnets = { for sb in var.network_info.subnets.pod : sb.az => { id = sb.subnet_id
securityGroups = [var.eks_info.nodes.security_group_id] } }
} : { create = false,
region = var.region, subnets = {} }

vpc_cni_configuration_values = {
env = local.vpc_cni_env
eniConfig = local.vpc_cni_eni_config
subnets = {
for sb in var.network_info.subnets.pod : sb.az => {
id = sb.subnet_id
securityGroups = [var.eks_info.nodes.security_group_id]
}
}
}

vpc_cni_configuration_values = merge({ env = local.vpc_cni_env }, local.is_pod_sb ? { eniConfig = local.vpc_cni_eni_config } : {})

addons_config_values = {
vpc-cni = local.vpc_cni_configuration_values
}
Expand Down

0 comments on commit ec08fc8

Please sign in to comment.