Terraform Code and Scripts to Automate Kubernetes Setup using Kubeadm via Terraform (Compatible for Mac with M1 Chip)
For Vagrant Setup Please see vagrant-kubernetes
To learn Kubernetes, please follow learn guide at suashk/
-
AWS Account.
-
3 EC2 Instances With the below Specification - a. Instance Type = "t2.medium" b. AMI = "ami-0fb653ca2d3203ac1"
-
Public Subnet with CIDR - 10.0.1.0/16 (As this is being used for private IPs allocation as per point-4 and POD CIDR Range in K8s Cluster).
-
Private IPs will be assigned as below -
- Security Group Settings - Please create or update your security group as per the below table -
- Update the values as per the below table -
To provision the cluster, execute the following commands.
git clone https://github.com/SuyashHashiCorp/terraform-k8s.git
cd terraform-k8s
terraform init
terraform plan
terraform apply
"Terraform apply" will create the Kubernetes config file and store the information in your local system in the configs directory.
cd terraform-k8s
cd configs
cat config
"Terraform apply" will create the admin user token and saves in the configs directory.
cd vagrant-kubeadm-kubernetes
cd configs
cat token
terraform destroy -auto-approve
terraform apply -auto-approve