Fullstack WebApp in Node+Express+Mongo - Deployed on Kubernetes & Architecture Explaination Diagrams
Stack - Node.js + Express.js + MongoDB + Docker + Kubernetes + Prometheus + Grafana + Spekt8
For Running The web app locally:
$ mv /local/node ~./home //move node app to home directory because db setup at home for time to time restart.
$ npm install
$ node app.js
For Running web App in Docker
$ cd Node_Project or cd local/node //Node_project - Production | local/node - local run
$ docker build -t dockerhub-username/node-project .
$ docker images -a //check for build image
$ docker push username/repository:tag
$ docker-compose up --build
$ Open ---> localhost:3000
For Running WebApp Clusters and Monitoring with Prometheus and Grafana
$ cd ~/.kube && kubectl --kubeconfig="clustername-kubeconfig.yaml" get nodes
$ kubect get nodes
$ kubectl get pods
$ kubectl get services
$ kubectl get services
$ kubectl exec -it mongo-mongodb-replicaset-0 -- mongo -u tikam -p --authenticationDatabase admin
$ kubectl port-forward -n monitoring svc/doks-cluster-monitoring-grafana 8000:80
$ kubectl port-forward -n monitoring svc/doks-cluster-monitoring-pr-prometheus 9090:9090
$ kubectl get svc -n monitoring
$ kubectl apply -f spekt8-deployment.yaml
$ kubectl apply -f fabric8-rbac.yaml.
$ kubectl port-forward deployment/spekt8 3000:3000