How abhizeetyadav/cloud-native-monitoring-application-on-kubernetes works
Main Components to Identify
• Monitoring Application (app.py): This forms the core application built with Flask. It monitors system metrics using psutil and renders a UI from templates (e.g., templates/index.html).
• Docker Containerization: Represented by Dockerfile, encapsulating the application and its dependencies (as also listed by requirements.txt). This layer ensures the app runs in a consistent environment.
• AWS Integration Components:
• ECR Integration (ecr.py): Shows how the Docker image is managed and pushed to AWS Elastic Container Registry.
• EKS Orchestration (eks.py): Handles the interaction with Kubernetes, orchestrating deployments on AWS Elastic Kubernetes Service.
• External Tools & Dependencies: Mention AWS CLI, Kubernetes CLI (kubectl), and Python libraries (Flask, psutil, Boto3) that are essential for the build and deployment processes.
Relationships and Interactions
• The Flask Application (app.py) consumes system metrics and serves them via a web interface (using the HTML template in the templates directory).
• The Dockerfile packages this application and all its dependencies (including those defined in requirements.txt) into an image.
• The ecr.py script is used to automate the creation of an ECR repository and push the Docker image to it.
• The eks.py script automates the setup/deployment of the containerized application in a Kubernetes cluster (EKS). This shows the data flow from image creation to deployment in a cloud environment.
→ The creation of the application (app.py) which communicates with a front-end (templates).
→ The Docker build process consuming the Dockerfile and requirements.txt.
→ The process where ecr.py pushes this image to an ECR repository.
→ The use of eks.py to deploy the image from ECR into an EKS cluster.
→ External interactions with AWS services and CLI tools.
Architectural Patterns and Design Principles
• Separation of Concerns: The project is organized into distinct modules for monitoring (the application itself), containerization (Docker), and cloud orchestration (AWS ECR/EKS).
• Microservices/Modular Approach: Although it is a simple project, the separation of concerns with distinct scripts (ecr.py and eks.py) hints at a modular design where each component can be evolved independently.
• Containerization and Cloud-Native Principles: The system makes heavy use of Docker and Kubernetes (EKS) to ensure scalability and portability in different environments.