The structure desired: Mongo express (as a external service) accessing a mongodb (as a internal service) and using a secret service to storage the username and password.
The final product gonna be like: A web-ui (mongo-express) sending commands to a mongodb (mongodb-service)
Installing the Secret Service
-- Installing the secret service
kubectl apply -f https://bit.ly/3fWLHLj
-- Getting the secret service
kubectl get secret
-- Installing the mongdb service
kubectl apply -f https://bit.ly/2QeWbL2
Checking the services
-- kubectl get all
--kubectl get all | grep mongodb
Installing and configuring mongodb-espress WEB-UI
--Creating the config map that gonna store the info about de database
kubectl apply -f https://bit.ly/3mJ1FKj
-- Installing the mongo-express web ui
kubectl apply -f https://bit.ly/3a2NEC5
If all the services are running we can check the public IP to mongo-express
-- Getting the public ip service
minikube service mongo-express-service
If everything is ok you gonna see the page:
That’s it! your mongodb works using Kubernetes! The structure is like:
Reference: https://www.youtube.com/watch?v=X48VuDVv0do