DevOps Project from scratch- Deploy Cloud Native Monitoring Application on Kubernetes
(Things to have before starting the projects)
- AWS Account.
- Programmatic access and AWS configured with CLI.
- Python3 Installed.
- Docker and Kubectl installed.
- Code editor (Vscode)
$ git clone <repository_url>
Step 2: Install dependencies :The application uses the psutil
and Flask
, Plotly, boto3 libraries. Install them using pip:
pip3 install -r requirements.txt
To run the application, navigate to the root directory of the project and execute the following command:
$ python3 app.py
This will start the Flask server on localhost:5000
. Navigate to http://localhost:5000/ on your browser to access the application.
$ docker build -t <image_name> .
$ docker run -p 5000:5000 <image_name>
This will start the Flask server in a Docker container on localhost:5000
. Navigate to http://localhost:5000/ on your browser to access the application.
$ docker push <ecr_repo_uri>:<tag>
make sure to edit the name of the image on line 25 with your image Uri.
- Once you run this file by running “python3 eks.py” deployment and service will be created.
- Check by running following commands:
kubectl get deployment -n default (check deployments)
kubectl get service -n default (check service)
kubectl get pods -n default (to check the pods)
Once your pod is up and running, run the port-forward to expose the service
kubectl port-forward service/<service_name> 5000:5000