This project demonstrates the provisioning of an AWS environment using Terraform, deploying a containerized application to Kubernetes (Minikube), and setting up monitoring and observability with Prometheus and Grafana. The project is divided into three parts:
- AWS Environment Provisioning with Terraform
- Kubernetes Deployment with Minikube
- Monitoring and Observability
The AWS environment is provisioned using Infrastructure as Code (IaC) with Terraform. The resources created include:
- VPC with public and private subnets.
- Internet Gateway and NAT Gateway for network traffic.
- An EC2 Instance for hosting a mock application in a private subnet.
- An S3 Bucket for static file storage.
- Security Groups for restricted access.
- Installed Terraform and verified its setup.
- Created an S3 bucket to store the Terraform state as a best practice.
- Designed and applied the Terraform plan to create the infrastructure.
- Verified the creation of resources on AWS and terminated them when no longer required.
This section involves deploying a containerized Python application to Kubernetes using Minikube and Kubernetes manifests. Kops is used for managing the cluster due to its cost-effectiveness and industrial standards.
- Minikube setup on an EC2 instance.
- Deployment of a Python application with Kubernetes manifests.
- DNS routing via Route53 for the application.
- Created an EC2 instance and installed required tools (Kops, kubectl, AWS CLI, Helm, and ArgoCD).
- Created a Kops bucket to store the cluster state.
- Mapped DNS using Route53 for external access to the application.
- Deployed and validated the Kubernetes cluster using Kops commands.
- Hosted the application accessible via LoadBalancer DNS.
Monitoring and observability were implemented using CloudWatch, Prometheus, and Grafana.
- Created a CloudWatch dashboard to monitor the AWS resources.
- Deployed Prometheus on Kubernetes:
- Set up a monitoring namespace and RBAC rules.
- Configured Prometheus to scrape Kubernetes pod metrics.
- Deployed Grafana on Kubernetes:
- Integrated Prometheus as a data source.
- Visualized cluster metrics using pre-built Grafana dashboards.
- Create Cluster:
kops create cluster --name=kubeparas.proddeploy.xyz --state=s3://kopsparasbucket \ --zones=us-east-1a,us-east-1b --node-count=1 --node-size=t3.small --master-size=t3.medium \ --dns-zone=kubeparas.proddeploy.xyz --node-volume-size=8 --master-volume-size=8
- Update Cluster:
kops update cluster --name kubeparas.proddeploy.xyz --state=s3://kopsparasbucket --yes --admin
- Validate Cluster:
kops validate cluster --state=s3://kopsparasbucket
- Delete Cluster:
kops delete cluster --name kubeparas.proddeploy.xyz --state=s3://kopsparasbucket --yes
- Terraform for AWS provisioning
- Docker for containerizing applications
- Kubernetes (Minikube, Kops) for orchestration
- Prometheus for metrics collection
- Grafana for visualization
- CloudWatch for AWS monitoring