Creates a Kubernetes cluster capable of running the Flightdeck platform using
Terraform and EKS. A different node group is created for each availability zone
so that node counts will grow equally in each availability zone and so that
nodes will be able to reliably attach EBS volumes. An OIDC
provider is configured to enable IRSA.
The module will look up VPC subnets for the cluster using the cluster name. The
VPC and subnets must be tagged following the conventions of the Kubernetes AWS
cloud provider:
Tag |
Value |
Add to |
kubernetes.io/role/internal-elb |
1 |
Private subnets |
kubernetes.io/role/elb |
1 |
Public subnets |
kubernetes.io/cluster/NAME |
shared |
VPC and all subnets |
You can quickly create a compatible network using the network module. If
you're bringing your own VPC, you must tag resources as documented above before
creating your cluster.
module "cluster" {
source = "github.com/thoughtbot/flightdeck//aws/cluster?ref=v0.9.0"
# Unique name for this EKS cluster.
name = "example-production-v1"
# Version of Kubernetes for this cluster. Must be supported by EKS.
k8s_version = "1.28"
node_groups = {
# You need at least one node group definition.
default = {
instance_types = ["t3.large"]
max_size = 30
min_size = 2
}
# You can include extra node groups if you want more than one type of node.
m5_2xlarge = {
instance_types = ["m5.2xlarge"]
max_size = 30
min_size = 2
}
}
# Any tags you want to apply to all created resources.
tags = { Module = "cluster/production-v1" }
}
Name |
Description |
Type |
Default |
Required |
enabled_cluster_log_types |
Which EKS control plane log types to enable |
list(string) |
[] |
no |
endpoint_private_access |
Enables the Amazon EKS private API server endpoint. |
bool |
false |
no |
endpoint_public_access |
Enables the Amazon EKS public API server endpoint. |
bool |
true |
no |
k8s_version |
Kubernetes version to deploy |
string |
n/a |
yes |
labels |
Labels to be applied to created resources |
map(string) |
{} |
no |
log_retention_in_days |
How many days until control plane logs are purged |
number |
7 |
no |
name |
Name for this EKS cluster |
string |
n/a |
yes |
namespace |
Prefix to be applied to created resources |
list(string) |
[] |
no |
node_groups |
Node groups to create in this cluster |
map(object({ capacity_type = optional(string, "ON_DEMAND") instance_types = list(string), enforce_imdsv2 = optional(bool, false) max_size = number max_unavailable = optional(number, 3) min_size = number })) |
n/a |
yes |
tags |
Tags to be applied to all created resources |
map(string) |
{} |
no |