Skip to content

Deploying a MongoDB and Mongo Express application

Notifications You must be signed in to change notification settings

tpaz1/Mongo-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Mongo-app

Deploying a MongoDB and Mongo Express application

In this tutorial we are going to deploy MongoDB and Mongo Express applications using the following Kubernetes components:

  • Service type clusterIp - an internal service for our MongoDB app (no external requests!).
  • Secret that contains our DB credentials.
  • configMap that stores our DB url.
  • Deployment - two Deployments one for the MongoDB app and one for the Mongo Express app. in the Deployment files we are gonna reference both secret and configMap files using Environment variables in order to access our DB in a secure way.
  • Service type LoadBalancer - External service that will allow external requests to our Mongo Express pod.

So with this setup the request flow will look like this:

  1. The request comes from the browser.
  2. Request goes to the External service of the Mongo Express which will than forward it to the Mongo Express pod.
  3. Pod will then connect to the internal service of MongoDB (thats basically the DB url from our configMap).
  4. The service will forward the request to the MongoDB pod where it will authenticate using the credentials (from the secret).

Pre requirements

When all this done, feel free to run the runMe file and get the results :)

Expected results:

alt text

About

Deploying a MongoDB and Mongo Express application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages