Skip to content

olaje948/kubernetes-mongo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸš€ Kubernetes + Minikube

Deploying MongoDB & Mongo-Express (Step-by-Step Guide)

This guide explains how to deploy MongoDB and Mongo-Express on Minikube using Kubernetes manifests.


πŸ“Œ 1. Start Fresh (Optional – Reset Minikube)

minikube delete --all

πŸ“Œ 2. Start Minikube

minikube start --driver=docker

πŸ“Œ 3. Apply MongoDB Deployment & Service

kubectl apply -f mongo.yml

πŸ“Œ 4. Apply Mongo-Express Deployment & Service

kubectl apply -f mongo-express.yml

πŸ“Œ 5. Access Mongo-Express via Minikube Service

minikube service mongo-express-service

This will print a URL like:

http://127.0.0.1:30001

πŸ“Œ 6. Optional: Port-Forward Mongo-Express Service

kubectl port-forward service/mongo-express-service 30001:8081

Visit:

http://localhost:30001

πŸ“Œ 7. Check Pods

kubectl get pods

πŸ“Œ 8. Check Services

kubectl get service
# or
kubectl get svc

πŸ“Œ 9. Check Deployments

kubectl get deployment

πŸ“Œ 10. Debugging / Troubleshooting

Describe a Pod

kubectl describe pod <pod-name>

Describe a Service

kubectl describe service mongo-express-service

Describe a Deployment

kubectl describe deployment mongo-express-deployment

⚑ Notes & Tips

  • Use:
kubectl get pods -o wide

to see node assignments and Pod IPs.

  • Minikube uses the Docker driver by default; you can change it if needed.

  • Production Warning:
    Avoid storing passwords directly in YAML files.
    Use Kubernetes Secrets:

kubectl create secret generic mongo-secret   --from-literal=username=admin   --from-literal=password=pass123

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published