This terraform script creates a new EKS cluster in an existing VPC using spot instances with the following features:
- AWS Load Balancer Controller v2.3.1
- External DNS v0.10.2
The advantage of this configuration is that for the lifecycle of application specific resources (DNS entries, load balancers, target groups), Terraform is not needed. Kubernetes ingress resources with specific annotations are sufficient and can be checked into each application's repository to fulfill IaC requirements.
If certificates are added to the AWS Certificate Manager in the cluster's account, the applications will be able to use the certificates as well. The certificates are discovered using Certificate Discovery. This works with wildcard certificates as well.
k8s/game2048.yaml is the 2048 game example used by the AWS Load Balancer Controller, but this version is configured to use HTTP and HTTPS.
This configuration doesn't create a VPC, but if needed one can easily be added by using the VPC Terraform module.
Note: This setup is loosely based on Provisioning Kubernetes clusters on AWS with Terraform and EKS, but is using the latest software versions from 2022 and supports External DNS as well.