Skip to content

Deployed a Flask-based web application on Kubernetes using Docker containers, and explored various Kubernetes features such as replication controllers, health monitoring, rolling updates, and alerting on both Minikube and AWS EKS

Notifications You must be signed in to change notification settings

ZEwithBayesTaylor/Kuber

Repository files navigation

Docker-Kubernetes

Overview

The task is to deploy a web application on Kubernetes using Docker containers.

Workflow

Commands

# Part 2
docker build -t xf2664/flask-app:latest .
docker-compose up
docker push xf2664/flask-app:latest

# Part 3
minikube start
kubectl apply -f app-depolyment.yaml
minikube service flask-app-service --url

# Part 5
kubectl get pods
kubectl delete pod <pod-name>
# should genereate a new pod
kubectl get pods

# Part 8
# Setup Prometheus monitoring on Kubernetes
# reference: https://devopscube.com/setup-prometheus-monitoring-on-kubernetes/
kubectl create namespace monitoring
kubectl create -f clusterRole.yaml
kubectl create  -f prometheus-deployment.yaml 
kubectl get deployments --namespace=monitoring
kubectl get pods --namespace=monitoring
kubectl port-forward prometheus-monitoring-3331088907-hm5n1 8080:9090 -n monitoring
# reference: https://devopscube.com/setup-kube-state-metrics/
git clone https://github.com/devopscube/kube-state-metrics-configs.git
kubectl apply -f kube-state-metrics-configs/
kubectl get deployments kube-state-metrics -n kube-system
# reference: https://devopscube.com/alert-manager-kubernetes-guide/#
git clone https://github.com/bibinwilson/kubernetes-alert-manager.git
kubectl create -f AlertManagerConfigmap.yaml
kubectl create -f AlertTemplateConfigMap.yaml
kubectl create -f Deployment.yaml
kubectl create -f Service.yaml

minikube service alertmanager --url -n monitoring

Some other helpful commands

# remove all docker images and containers
docker rm $(docker ps -aq)
docker image prune -fa
docker volume prune -f

kubectl get services
minikube dashboard

About

Deployed a Flask-based web application on Kubernetes using Docker containers, and explored various Kubernetes features such as replication controllers, health monitoring, rolling updates, and alerting on both Minikube and AWS EKS

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published