chore: Update examples for Fargate high availability (#2378)

This commit is contained in:
Bryant Biggs
2023-01-05 07:53:37 -05:00
committed by GitHub
parent 460e43db77
commit 21e26e9045
3 changed files with 61 additions and 56 deletions

View File

@@ -92,6 +92,10 @@ module "eks" {
subnet_ids = module.vpc.private_subnets
control_plane_subnet_ids = module.vpc.intra_subnets
# Fargate profiles use the cluster primary security group so these are not utilized
create_cluster_security_group = false
create_node_security_group = false
manage_aws_auth_configmap = true
aws_auth_roles = [
# We need to add in the Karpenter node IAM role for nodes launched by Karpenter
@@ -105,21 +109,26 @@ module "eks" {
},
]
fargate_profiles = {
kube_system = {
name = "kube-system"
selectors = [
{ namespace = "kube-system" }
]
}
karpenter = {
name = "karpenter"
selectors = [
{ namespace = "karpenter" }
]
}
}
fargate_profiles = merge(
{ for i in range(3) :
"kube-system-${element(split("-", local.azs[i]), 2)}" => {
selectors = [
{ namespace = "kube-system" }
]
# We want to create a profile per AZ for high availability
subnet_ids = [element(module.vpc.private_subnets, i)]
}
},
{ for i in range(3) :
"karpenter-${element(split("-", local.azs[i]), 2)}" => {
selectors = [
{ namespace = "karpenter" }
]
# We want to create a profile per AZ for high availability
subnet_ids = [element(module.vpc.private_subnets, i)]
}
},
)
tags = merge(local.tags, {
# NOTE - if creating multiple security groups with this module, only tag the
@@ -151,7 +160,7 @@ resource "helm_release" "karpenter" {
repository_username = data.aws_ecrpublic_authorization_token.token.user_name
repository_password = data.aws_ecrpublic_authorization_token.token.password
chart = "karpenter"
version = "v0.19.3"
version = "v0.21.1"
set {
name = "settings.aws.clusterName"