This project automates the deployment of a self-managed Kubernetes cluster using Terraform and Ansible. The cluster is created in a private AWS VPC and consists of control plane and worker nodes provisioned with kubeadm
.
- Infrastructure as Code (IaC): Uses Terraform to create AWS resources.
- Configuration Management: Automates Kubernetes setup with Ansible.
- Networking: Deploys the cluster in a private VPC with security groups.
- Cluster Components: Kubernetes control plane and worker nodes.
- Container Networking: Calico is used for networking (optional, needs manual setup).
- Terraform
- Ansible
- AWS CLI
- kubectl
- Ansible control node with SSH access to instances
terraform init -backend-config=env-dev/state.tfvars
terraform plan -var-file=env-dev/main.tfvars
terraform apply -var-file=env-dev/main.tfvars -auto-approve
Ansible will be configured using teraform
Worker nodes retrieve the join command from control plane using scp.
Check if all nodes are ready:
kubectl get nodes
Check cluster pods:
kubectl get pods -A
To delete all resources:
terraform destroy -var-file=env-dev/main.tfvars -auto-approve
- configure the needed secrets for user and password, ami ..etc
- Automate Calico installation
- Enhance security with IAM roles and policies
This project provides a scalable, secure Kubernetes cluster with automation for provisioning and configuration. 🚀