Resolve "Run the application on Kubernetes locally using “minikube”"
All threads resolved!
Closes #19 (closed)
Merge request reports
Activity
added Required label
requested review from @strokh24
assigned to @gajesh24
- Resolved by Jesus Galaz Reyes
added 1 commit
- 92a9d51e - feat(kubernetes): complete Kubernetes setup for todo-app with Minikube
Setup Guide to Use the Project
Prerequisites:
-
Install Minikube: Follow the official Minikube installation guide.
-
Install kubectl: Ensure you have Kubernetes CLI (kubectl) installed and configured.
Step-by-Step Instructions
- Start Minikube
- Run Minikube with your preferred driver/docker engine (e.g., Docker):
minikube start --driver=docker
- Build Docker Images
- Point your terminal to Minikube’s Docker environment:
eval $(minikube docker-env)
- Build the todo-app image:
docker build -t todo-app:latest .
- Deploy MongoDB
- Apply the MongoDB deployment and service configuration:
kubectl apply -f mongodb-deployment.yml kubectl apply -f mongodb-service.yml
- Deploy Todo App
- Apply the todo-app deployment and service configuration:
kubectl apply -f todo-app-deployment.yml kubectl apply -f todo-app-service.yml
- Access the Application
- Use Minikube’s service command to expose the app:
minikube service todo-app --url
- Open the URL provided by the command in your browser.
- Verify Functionality
- Test creating, viewing, and deleting tasks via the ToDo app UI.
- Verify MongoDB connectivity by checking app logs:
kubectl logs -l app=todo-app
Debugging and Troubleshooting
- Check Pod Status:
kubectl get pods
Ensure all pods are in the Running state
- Inspect Logs:
kubectl logs <pod-name>
- Delete Pods to Restart:
kubectl delete pod -l app=todo-app
- Reset Minikube if Issues Persist:
minikube delete minikube start
Cleanup
- To remove all Kubernetes resources:
kubectl delete -f mongodb-deployment.yml kubectl delete -f mongodb-service.yml kubectl delete -f todo-app-deployment.yml kubectl delete -f todo-app-service.yml
- To remove minikube and its data:
minikube stop minikube delete --all rm -rf ~/.minikube rm -rf ~/.kube brew uninstall minikube
-
enabled an automatic merge when all merge checks for 92a9d51e pass
mentioned in commit 8a82de38
Please register or sign in to reply