/To-do-web-app-K8S-Cluster

This the todo app using streamlit

Primary LanguagePython

To-do Web App K8S Cluster

This project sets up a Kubernetes (K8S) cluster to deploy a Python-based to-do web application using Nginx as a reverse proxy.

Prerequisites

  • Docker
  • Minikube
  • Kubectl
  • Git

Getting Started

Clone the Repository

git clone https://github.com/Matanmoshes/To-do-web-app-K8S-Cluster.git
cd To-do-web-app-K8S-Cluster

Setup Minikube

Start Minikube:

minikube start

Deploy the Application

  1. Deploy the To-do App

Apply the deployment and service for the to-do app:

kubectl apply -f todo-app-deployment.yaml
kubectl apply -f todo-app-service.yaml
  1. Deploy Nginx as Reverse Proxy

Apply the deployment, config map, and service for Nginx:

kubectl apply -f nginx-deployment.yaml
kubectl apply -f nginx-configmap.yaml
kubectl apply -f nginx-service.yaml

Accessing the Application

To access the application, find the Minikube IP and the NodePort assigned to the Nginx service:

  1. Get the Minikube IP:
minikube ip
  1. Get the NodePort for the Nginx service:
kubectl get svc nginx-service

Combine the Minikube IP and NodePort to access the application. For example, if the Minikube IP is 192.168.49.2 and the NodePort is 31274, open:

http://192.168.49.2:31274

Troubleshooting

If you encounter any issues, check the logs of the pods:

kubectl get pods
kubectl logs <nginx-pod-name>
kubectl logs <todo-app-pod-name>

Acknowledgements

  • Kubernetes
  • Minikube
  • Docker
  • Nginx