Deploy MongoDB and Mongo-Express applications using Kubernetes
📋 Consider deploying 2 apps, MongoDB and Mongo-Express
🔗 MongoDB will be connected via an internal service
🔐 MongoDB URL is stored in a ConfigMap
🔑 MongoDB username and password are stored in secrets
🌐 To access Mongo-Express through the browser, an external service will be created
- 🌐 Browser requests to mongo-express external service
- ⚡ External service requests to the mongo-express pod
- 🚀 Pod will request the MongoDB internal service
- 🔄 Internal service will request the MongoDB pod
💡 This file will hold the username and password
💡 These values are stored in base64 encoded form
kubectl apply -f mongo-secret.yaml
📦 Base image will be mongo
🔌 Port number will be exposed
🔧 Env will contain the root username and password
🔑 The values will be fetched from the secret
kubectl apply -f mongo.yaml
🎯 Selector to connect to the pod through a label
🔗 Internal port and target port mentioned
🔧 Contains the database URL for the MongoDB server
kubectl apply -f mongodb-config.yaml
📦 Specs will have the name of the container
🖼️ Name of the image
🔌 Details of the ports exposed
🔧 Env with the username and password of MongoDB
kubectl apply -f mongo-express.yaml
🌐 Helps access from the browser
⚙️ The type section in the spec will be LoadBalancer