This project demonstrates the basic concepts of kubernetes.
Before getting started, ensure that you have the following prerequisites installed on your system:
- Docker
- Kubernetes (kubectl)
- Minikube (optional if using Minikube)
- Clone the repository:
git clone https://github.com/harshvishu/kubernetes-assignment-rust-backend
- Change to the project directory:
cd kubernetes-assignment-rust-backend-main
- Deploy the required resources:
# Apply secrets and config maps
kubectl apply -f deployments/db-secrets.yaml
kubectl apply -f deployments/db-config.yaml
# Apply postgres database service and deployment
kubectl apply -f deployments/postgres-service.yaml
kubectl apply -f deployments/postgres-persistence-volume-deployment.yaml
# Run databse migration and initial seed data if-required
kubectl apply -f deployments/db-migration-up-job.yaml
kubectl apply -f deployments/db-seed-job.yaml
# Start REST Api and Front-End App
kubectl apply -f deployments/todo-config.yaml
kubectl apply -f deployments/todo-api-deployment.yaml
kubectl apply -f deployments/todo-api-service.yaml
kubectl apply -f deployments/todo-web-deployment.yaml
kubectl apply -f deployments/todo-web-loadbalancer-service.yaml
- Verify the deployment:
kubectl get pods
kubectl get services
kubectl get pv
kubectl get pvc
To access the application, follow these steps:
- Get the external IP for the load balancer service (minikube):
minikube service todo-web --url
- Using Kubernetes on docker hub, simply go to:
http://localhost:80
To clean up the resources created by the application, run the following command:
kubectl delete all --all