Simply provision an EKS cluster with Terraform
- Configures a multi-zone EKS cluster with one node group as described by AWS Getting Started Guide.
- Simple configuration with just a few veriables.
- Manage multiple clusters with Terraform workspaces.
region
: The AWS region to deploy cluster to (e.g. "eu-west-1").
n_workers
: Number of workers in cluster node group.
worker_instance_type
: Instance type to use for cluster node group (e.g. "t3.medium").
- Set AWS credential environment variables for Terraform AWS provider:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
- Run
terraform init
to install AWS provider. - Apply Terraform plan:
TF_VAR_region=eu-west-1 TF_VAR_n_workers=1 TF_VAR_worker_instance_type=t3.medium terraform apply
- To manage cluster, you need
awscli
andkubectl
:
aws eks --region eu-west-1 update-kubeconfig --name eks-$(terraform workspace show)
kubectl get nodes
TF_VAR_region=eu-west-1 TF_VAR_n_workers=1 TF_VAR_worker_instance_type=t3.medium terraform destroy