This example shows how to deploy a self hosted kubernetes cluster using Terraform.
- Use Packer to create a custom AMI image with the required software
- Use Terraform to deploy the infrastructure
- Use Ansible to configure the kubernetes cluster so new nodes can join the cluster
- Use kubectl to deploy a simple nginx server
- Clone the repository
- Run the Docker development container
- dev.ps1
- dev.sh
- Run the setup
- ./scripts/generate_key.sh
- ./scripts/generate_ssl.sh
- Make sure you have a valid AWS profile configured with a default VPC
- Run the terraform Setup
- ./scripts/init_terraform.sh
- Generate AMI images using Packer
- ./scripts/build_ami.sh test
- Deploy the infrastructure
- ./scripts/tf test apply
Done!
- Use vault or secrets manager to store the private key
- Use a bastion host/ network load balancer to access nginx server in a private subnet
- restrict network ACL access
- Use a load balancer to distribute traffic to multiple nginx servers
- Use a CDN to cache static content
- Use a WAF to protect against malicious traffic
- Configure DNS records