-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Description
Description
I am encountering an issue where the EKS managed node group fails to create. Terraform stops with the error:
Error: waiting for EKS Node Group (...): unexpected state 'CREATE_FAILED', wanted 'ACTIVE'.
Last error: NodeCreationFailure: Unhealthy nodes in the Kubernetes cluster
I have followed the recommended cleanup steps (rm -rf .terraform + terraform init) but the issue persists.
This happens when deploying an EKS cluster using the terraform-aws-modules/eks/aws module.
Versions
Module version: v21.8.0
-
Module version [Required]:
-
Terraform version:a
Terraform v1.13.5
on linux_amd64 -
Provider version(s):
provider registry.terraform.io/hashicorp/aws v6.21.0
Reproduction Code [Required]
This configuration can be executed via:
terraform init && terraform apply
`provider "aws" {
region = "ap-south-1"
}
data "aws_availability_zones" "azs" {
state = "available"
}
module "myapp-vpc" {
source = "terraform-aws-modules/vpc/aws"
version = "6.5.0"
name = "myapp-vpc"
cidr = var.vpc_cidr_block
azs = var.avail_zone
private_subnets = var.private_subnet_cidr_block
public_subnets = var.public_subnet_cidr_block
enable_nat_gateway = true
single_nat_gateway = true
enable_dns_hostnames = true
tags = {
"kubernetes.io/cluster/myapp-vpc-cluster" = "shared"
}
public_subnet_tags = {
"kubernetes.io/cluster/myapp-vpc-cluster" = "shared"
"kubernetes.io/role/elb" = 1
}
private_subnet_tags = {
"kubernetes.io/cluster/myapp-vpc-cluster" = "shared"
"kubernetes.io/role/internal-elb" = 1
}
}
module "eks" {
source = "terraform-aws-modules/eks/aws"
version = "21.8.0"
name = "myapp-vpc-cluster"
kubernetes_version = "1.30"
vpc_id = module.myapp-vpc.vpc_id
subnet_ids = module.myapp-vpc.private_subnets
endpoint_public_access = true
endpoint_private_access = true
enable_cluster_creator_admin_permissions = true
eks_managed_node_groups = {
worker1 = {
instance_types = ["t3.micro"]
min_size = 1
max_size = 3
desired_size = 1
}
}
tags = {
environment = "development"
application = "myapp"
}
}
`
Steps to reproduce the behavior:
- Create a new folder.
- Copy the above main.tf, variables, and VPC CIDRs.
- Run :
terraform init terraform apply - Observe the node group creation failure
Expected behavior
The EKS cluster and node group should complete setup and reach the ACTIVE state
Actual behavior
Terraform fails while creating the EKS managed node group
NodeCreationFailure: Unhealthy nodes in the Kubernetes cluster
Terminal Output Screenshot(s)
Additional context
