This project demonstrates how to create a cloud-native resource monitoring application using Python, Flask, Docker, AWS EKS, and Kubernetes. The application monitors system metrics like CPU and memory usage and displays them in a user-friendly web interface.
- AWS Account
- Programmatic access and AWS configured with CLI
- Python3 Installed
- Docker and Kubectl installed
- Code editor (Vscode)
- Clone the repository:
git clone <repository_url>
- Install dependencies:
pip3 install -r requirements.txt
- Run the application:
python3 app.py
- Create a Dockerfile
- Build the Docker image:
docker build -t <image_name> .
- Run the Docker container:
docker run -p 5000:5000 <image_name>
- Create an ECR repository using Python
- Push the Docker image to ECR:
docker push <ecr_repo_uri>:<tag>
- Create an EKS cluster and add a node group
- Create a node group in the EKS cluster
- Create a deployment and service (make sure to edit the name of the image on line 25 with your image URI)
Once you run python3 eks.py
, the deployment and service will be created. You can check by running the following commands:
kubectl get deployment -n default
kubectl get service -n default
kubectl get pods -n default
Once your pod is up and running, run the port-forward to expose the service: kubectl port-forward service/<service_name> 5000:5000
This project was inspired by a YouTube tutorial. I forked the original repository and added my own modifications to enhance the functionality of the application.