mirror of
https://github.com/terraform-aws-modules/terraform-aws-eks.git
synced 2025-09-09 19:32:58 +08:00
feat!: Upgrade min AWS provider and Terraform versions to 6.0 and 1.5.7 respectively (#3412)
* feat!: Upgrade min AWS provider and Terraform versions to `6.0` and `1.5.7` respectively * fix: Remove deprecated arguments in AWS v6.0 provider, upgrade Helm provider to v3.0, bump VPC module to v6.0 * fix: Remove `aws-auth` sub-module * fix: Remove `platform` and `cluster_service_ipv4_cidr` variables from `user-data` sub-module * fix: Resolve all marked `todos` that have been accumulated * fix: Set default `http_put_response_hop_limit` to `1` * fix: Remove IRSA support from Karpenter sub-module * fix: Avoid making GET requests from data sources unless absolutely necessary * feat: Add variable optional attribute definitions * feat: Bump KMS key module version to latest, add remaining variable attribute definitions * fix: Remove `cluster_` prefix from variable names to better match the underlying API * fix: Move all EFA logic to the nodegroup itself * fix: Remove arguments that do not make sense in EKS * fix: Updates from plan validation * fix: Remove more self-managed node group attributes that are commonly not used in EKS clusters * fix: Remove data plane compute `*_defaults` variables that do not work with variable optional attributes * fix: Ignore changes to `bootstrap_self_managed_addons` to aid in upgrade * feat: Add support for `region` argument on relevant resources * feat: Initial pass on upgrade guide * fix: Updates from testing and validating EKS managed node group * fix: Updates from testing and validating self-managed node group * docs: Ensure addon ussage documented is aligned * feat: Switch to dualstack OIDC issuer URL * feat: Allow sourcing over overriding the Karpenter assume role policy * fix: Use `Bool` instead of `StringEquals` for DenyHTTP queue policy * fix: Correct use of `nullable` and default value propagation
This commit is contained in:
@@ -17,14 +17,14 @@ Note that this example may create resources which cost money. Run `terraform des
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.2 |
|
||||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 5.95, < 6.0.0 |
|
||||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
|
||||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.0 |
|
||||
|
||||
## Providers
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 5.95, < 6.0.0 |
|
||||
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.0 |
|
||||
|
||||
## Modules
|
||||
|
||||
@@ -33,11 +33,11 @@ Note that this example may create resources which cost money. Run `terraform des
|
||||
| <a name="module_aws_vpc_cni_ipv6_pod_identity"></a> [aws\_vpc\_cni\_ipv6\_pod\_identity](#module\_aws\_vpc\_cni\_ipv6\_pod\_identity) | terraform-aws-modules/eks-pod-identity/aws | ~> 1.6 |
|
||||
| <a name="module_disabled_eks"></a> [disabled\_eks](#module\_disabled\_eks) | ../.. | n/a |
|
||||
| <a name="module_disabled_eks_managed_node_group"></a> [disabled\_eks\_managed\_node\_group](#module\_disabled\_eks\_managed\_node\_group) | ../../modules/eks-managed-node-group | n/a |
|
||||
| <a name="module_ebs_kms_key"></a> [ebs\_kms\_key](#module\_ebs\_kms\_key) | terraform-aws-modules/kms/aws | ~> 2.1 |
|
||||
| <a name="module_ebs_kms_key"></a> [ebs\_kms\_key](#module\_ebs\_kms\_key) | terraform-aws-modules/kms/aws | ~> 4.0 |
|
||||
| <a name="module_eks"></a> [eks](#module\_eks) | ../.. | n/a |
|
||||
| <a name="module_eks_managed_node_group"></a> [eks\_managed\_node\_group](#module\_eks\_managed\_node\_group) | ../../modules/eks-managed-node-group | n/a |
|
||||
| <a name="module_key_pair"></a> [key\_pair](#module\_key\_pair) | terraform-aws-modules/key-pair/aws | ~> 2.0 |
|
||||
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 5.0 |
|
||||
| <a name="module_vpc"></a> [vpc](#module\_vpc) | terraform-aws-modules/vpc/aws | ~> 6.0 |
|
||||
|
||||
## Resources
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ data "aws_availability_zones" "available" {
|
||||
}
|
||||
|
||||
locals {
|
||||
name = "ex-${replace(basename(path.cwd), "_", "-")}"
|
||||
cluster_version = "1.33"
|
||||
region = "eu-west-1"
|
||||
name = "ex-${replace(basename(path.cwd), "_", "-")}"
|
||||
kubernetes_version = "1.33"
|
||||
region = "eu-west-1"
|
||||
|
||||
vpc_cidr = "10.0.0.0/16"
|
||||
azs = slice(data.aws_availability_zones.available.names, 0, 3)
|
||||
@@ -34,21 +34,17 @@ locals {
|
||||
module "eks" {
|
||||
source = "../.."
|
||||
|
||||
cluster_name = local.name
|
||||
cluster_version = local.cluster_version
|
||||
cluster_endpoint_public_access = true
|
||||
name = local.name
|
||||
kubernetes_version = local.kubernetes_version
|
||||
endpoint_public_access = true
|
||||
|
||||
# IPV6
|
||||
cluster_ip_family = "ipv6"
|
||||
ip_family = "ipv6"
|
||||
create_cni_ipv6_iam_policy = true
|
||||
|
||||
enable_cluster_creator_admin_permissions = true
|
||||
|
||||
# Enable EFA support by adding necessary security group rules
|
||||
# to the shared node security group
|
||||
enable_efa_support = true
|
||||
|
||||
cluster_addons = {
|
||||
addons = {
|
||||
coredns = {
|
||||
most_recent = true
|
||||
}
|
||||
@@ -79,11 +75,11 @@ module "eks" {
|
||||
}
|
||||
}
|
||||
|
||||
cluster_upgrade_policy = {
|
||||
upgrade_policy = {
|
||||
support_type = "STANDARD"
|
||||
}
|
||||
|
||||
cluster_zonal_shift_config = {
|
||||
zonal_shift_config = {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
@@ -91,11 +87,6 @@ module "eks" {
|
||||
subnet_ids = module.vpc.private_subnets
|
||||
control_plane_subnet_ids = module.vpc.intra_subnets
|
||||
|
||||
eks_managed_node_group_defaults = {
|
||||
ami_type = "AL2023_x86_64_STANDARD"
|
||||
instance_types = ["m6i.large", "m5.large", "m5n.large", "m5zn.large"]
|
||||
}
|
||||
|
||||
eks_managed_node_groups = {
|
||||
# Default node group - as provided by AWS EKS
|
||||
default_node_group = {
|
||||
@@ -114,8 +105,8 @@ module "eks" {
|
||||
|
||||
placement_group = {
|
||||
create_placement_group = true
|
||||
# forces the subnet lookup to be restricted to this availability zone
|
||||
placement_group_az = element(local.azs, 3)
|
||||
subnet_ids = slice(module.vpc.private_subnets, 0, 1)
|
||||
instance_types = ["m5.large", "m5n.large", "m5zn.large"]
|
||||
}
|
||||
|
||||
# AL2023 node group utilizing new user data format which utilizes nodeadm
|
||||
@@ -135,8 +126,6 @@ module "eks" {
|
||||
kubelet:
|
||||
config:
|
||||
shutdownGracePeriod: 30s
|
||||
featureGates:
|
||||
DisableKubeletCloudCredentialProviders: true
|
||||
EOT
|
||||
}
|
||||
]
|
||||
@@ -238,8 +227,6 @@ module "eks" {
|
||||
kubelet:
|
||||
config:
|
||||
shutdownGracePeriod: 30s
|
||||
featureGates:
|
||||
DisableKubeletCloudCredentialProviders: true
|
||||
EOT
|
||||
content_type = "application/node.eks.aws"
|
||||
}]
|
||||
@@ -359,7 +346,7 @@ module "eks" {
|
||||
|
||||
# This will:
|
||||
# 1. Create a placement group to place the instances close to one another
|
||||
# 2. Ignore subnets that reside in AZs that do not support the instance type
|
||||
# 2. Create and attach the necessary security group rules (and security group)
|
||||
# 3. Expose all of the available EFA interfaces on the launch template
|
||||
enable_efa_support = true
|
||||
enable_efa_only = true
|
||||
@@ -476,7 +463,7 @@ module "disabled_eks_managed_node_group" {
|
||||
|
||||
module "vpc" {
|
||||
source = "terraform-aws-modules/vpc/aws"
|
||||
version = "~> 5.0"
|
||||
version = "~> 6.0"
|
||||
|
||||
name = local.name
|
||||
cidr = local.vpc_cidr
|
||||
@@ -523,7 +510,7 @@ module "aws_vpc_cni_ipv6_pod_identity" {
|
||||
|
||||
module "ebs_kms_key" {
|
||||
source = "terraform-aws-modules/kms/aws"
|
||||
version = "~> 2.1"
|
||||
version = "~> 4.0"
|
||||
|
||||
description = "Customer managed key to encrypt EKS managed node group volumes"
|
||||
|
||||
@@ -605,7 +592,7 @@ data "aws_ami" "eks_default" {
|
||||
|
||||
filter {
|
||||
name = "name"
|
||||
values = ["amazon-eks-node-al2023-x86_64-standard-${local.cluster_version}-v*"]
|
||||
values = ["amazon-eks-node-al2023-x86_64-standard-${local.kubernetes_version}-v*"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,7 +602,7 @@ data "aws_ami" "eks_default_arm" {
|
||||
|
||||
filter {
|
||||
name = "name"
|
||||
values = ["amazon-eks-node-al2023-arm64-standard-${local.cluster_version}-v*"]
|
||||
values = ["amazon-eks-node-al2023-arm64-standard-${local.kubernetes_version}-v*"]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -625,7 +612,7 @@ data "aws_ami" "eks_default_bottlerocket" {
|
||||
|
||||
filter {
|
||||
name = "name"
|
||||
values = ["bottlerocket-aws-k8s-${local.cluster_version}-x86_64-*"]
|
||||
values = ["bottlerocket-aws-k8s-${local.kubernetes_version}-x86_64-*"]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
terraform {
|
||||
required_version = ">= 1.3.2"
|
||||
required_version = ">= 1.5.7"
|
||||
|
||||
required_providers {
|
||||
aws = {
|
||||
source = "hashicorp/aws"
|
||||
version = ">= 5.95, < 6.0.0"
|
||||
version = ">= 6.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user