manojnkumar / nodejs-mongodb-sample

Simple NodeJs web application which communicates with Mongo data base

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NodeJS-MongoDB-Sample

A simple NodeJS web application which communicates with MongoDB. Useful for testing Eclipse Che Node workspace.

MongoDB

The application connects to the Mongo data base, so it should be configured with next parameters:

  • MongoDB user - user
  • MongoDB password - password
  • The name of data base - guestbook

Deploy the application on Kubernetes cluster by kubectl command-line tool

  • Before you begin you need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. If you do not already have a cluster, you can create one by using Minikube or Minishift
  • Deploy MongoDB: kubectl apply -f ./kubernetes-manifests/mongo.deployment.yaml
  • Deploy guestbook application: kubectl apply -f ./kubernetes-manifests/guestbook-app.deployment.yaml

Deploy the application via Openshift Connector plug-in on Minishift

  • Create and start a workspace from NodeJS MongoDB Web Application stack with OpenShift Connector plug-in
  • Open a terminal from vscode-openshift-connector container
  • Login into your Kubernetes cluster via oc login https://<IP>:<PORT> --certificate-authority=/var/run/secrets/kubernetes.io/serviceaccount/ca.crt command
  • Create a new project in Openshift application explorer
  • Create new application in your project in Openshift application explorer
  • Open kubernetes-manifests/mongo.deployment.yaml and deploy it via Kubernetes: Create command
  • Create a new Openshift component from the context menu in project explorer by clicking on nodejs-mongodb-sample root folder

About

Simple NodeJs web application which communicates with Mongo data base

License:MIT License


Languages

Language:JavaScript 57.0%Language:CSS 18.5%Language:HTML 16.5%Language:Dockerfile 8.0%