Note: This is purely made for learning purposes. Any PRs are welcome.
K3S is a lightweight Kubernetes distribution that is easy to install and manage. It is a great option for small to medium sized clusters. This project is a Terraform module that will deploy a K3S cluster on AWS. It will inherit existing VPC, with their Subnets to create its own set of resources to run K3S on the Cloud. The following resources will be created:
- Network Load Balancer
- Security Groups
- Auto Scaling Group
- Launch Template
- IAM Role
- IAM Policy
- IAM Instance Profile
- EC2 Instances
- AWS account
- AWS CLI
- Terraform
- Clone this repository
- Create a S3 Bucket manually in AWS for the Terraform State
- Update the variables accordingly in
variables.tf
- Update the S3 Bucket name along with the AWS region accordingly in
backend.tf
- Change the region in
main.tf
if needed. - Run
terraform init
- Run
terraform plan
- Run
terraform apply
- The default instance type is
t2.micro
. You can change it to whatever you want. - The default AMI is Amazon Linux 2 AMI. It is set to get the Latest Image by default.
- The default number of instances is 1. You can change it to whatever you want.
- ASG has been set to
0
. You can change it whenever you want to provision an instance. - Kubeconfig generated from the K3S cluster will be saved in S3 bucket provided in the
variables.tf
file.
- Add support for Spot Instances.