This Terraform module creates AWS resources to learn for CKA and experiment with kubeadm / self-managed K8s.
- OPTIONAL: AWS Key Pair (you can use a pre-existing one, too)
- VPC
- Public Subnets
- Internet Gateway
- Private Subnets
- NAT Gateway (single one for all AZs to save costs)
- Public Subnets
- Classic Load Balancer
- etcd
- kube-apiserver
- UserData
- EC2 Instances (NO AUTOSCALING!)
- Bastion (provisioned with your private SSH Key and populated SSH Config)
- etcd
- controller
- worker
Set variables in your local terraform.tfvars
file to match your needs.
Use Ubuntu 20.04 LTS instead of default 18.04 and pre-existing AWS Key Pair and SSH Key path:
owner = "johndoe"
ssh_private_key_path = "$HOME/.ssh/id_rsa-customkey"
key_pair_name = "my-key-pair-name"
ubuntu_release = "focal-20.04"
Set custom instance types (default: t3a.small
):
owner = "johndoe"
bastion_instance_type = "t3a.micro"
etcd_instance_type = "t3a.medium"
master_instance_type = "t3a.medium"
worker_instance_type = "t3a.large"
No requirements.
Name | Version |
---|---|
aws | n/a |
http | n/a |
Name | Description | Type | Default | Required |
---|---|---|---|---|
aws_region | AWS Region to use for all resources | string |
"eu-central-1" |
no |
bastion_instance_type | Bastion: EC2 Instance Type | string |
"t3a.small" |
no |
bastion_volume_size | bastion - EBS root volume size in GB | number |
30 |
no |
cfssl_version | cfssl version to install in UserData | string |
"1.4.1" |
no |
controller_instance_type | controller: EC2 Instance Type | string |
"t3a.small" |
no |
controller_volume_size | controller - EBS root volume size in GB | number |
30 |
no |
etcd_instance_type | etcd: EC2 Instance Type | string |
"t3a.small" |
no |
etcd_version | etcd / etcdctl version to install in UserData | string |
"v3.4.13" |
no |
etcd_volume_size | etcd - EBS root volume size in GB | number |
30 |
no |
key_pair_name | Preexisting AWS Key Pair name for SSH (leave emty to generate new AWS Key Pair) | string |
"" |
no |
number_azs | Number of AWS Availability Zones to use for every subnet | number |
3 |
no |
owner | Tag 'Owner' to be used for all resources | string |
n/a | yes |
ssh_private_key_path | SSH Private Key path on your workstatio (must match 'key_pair_name' SSH Key) | string |
"$HOME/.ssh/id_rsa" |
no |
tags | Tags to apply to resources | map(string) |
{ |
no |
timezone | TImezone to set for alle instances | string |
"Europe/Berlin" |
no |
ubuntu_release | Ubuntu release name and version for AMI data source search (<short-name>-<version-number> ) |
string |
"bionic-18.04" |
no |
vpc_cidr | AWS VPC CIDR network block (e.g. 10.0.0.0/16 ) |
string |
"10.0.0.0/16" |
no |
worker_instance_type | Worker: EC2 Instance Type | string |
"t3a.small" |
no |
worker_volume_size | Worker - EBS root volume size in GB | number |
30 |
no |
Name | Description |
---|---|
ami | AMI description |
bastion_public_ip | Bastion Host Public IPv4 address to connect to |
lb_etcd_dns | etcd Load Balancer DNS |
lb_kube_apiserver_dns | kube-apiserver Load Balancer DNS |
workstation_ip | Your workstation's IP address |