Skip to content

A basic application for the understanding of Kubernetes and its implementation on Google Cloud Platform

Notifications You must be signed in to change notification settings

manishjchoudhary/kubernetes-docker-webapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes, Docker and GCP

Build Status

🐳 A very simple application that uses Kubernetes and Docker containers. This is my first project on K8s and Google cloud platform.

Application Architecture

The diagram below demonstrates the flow of the web application. The incoming request by the browser is handled by the ingress-ngnix, request related to frontend is sent to multi-client deployment and the backend based request is sent to multi-server named deployment. multi-server route the request to either postgres pod or Redis pod depending on the requirement. Further the communication between the individual deployments or pods is managed using ClusterIp Services. For permanent storage, persistent volume claim is used, so you sleep doubt free knowing that your data is secure even if 1 or 2 happens to fail.

architecture

Getting Started

The project uses docker and kubernetes, so it should be installed and configured onto your system. Then to work with kubernetes, kubectl and minikube should be configured.

Front end (client)

  • To edit the ReactJS code, open /client
  • To change deployment configuration, edit /k8s/client-deployment.yml
  • To change the service configuration (ClusterIP), edit /k8s/client-cluster-ip-service.yml

Server

  • To edit the NodeJS code, open /server
  • To change deployment configuration, edit /k8s/server-deployment.yml
  • To change the service configuration (ClusterIP), edit /k8s/server-cluster-ip-service.yml

Worker

  • To edit the NodeJS code, open /worker
  • To change deployment configuration, edit /k8s/worker-deployment.yml
  • To change the service configuration (ClusterIP), edit /k8s/worker-cluster-ip-service.yml

Redis database

  • To change redis deployment configuration, edit k8s/redis-deployment.yml
  • To change redis service configuration, edit k8s/redis-cluster-ip-service.yml

Postgres (Persistent Volume Claim)

  • To change postgres deployment configuration, edit k8s/postgres-deployment.yml
  • To change postgres service configuration, edit k8s/postgres-cluster-ip-service.yml

Load Balancer (ingress-nginx)

  • To change the load balancer configuration, edit k8s/ingress-service.yml

npm vulnerability fix

This issue has bugged me for a long period of time. Earlier I had to check manually for deprecated versions of the packages being used, which was very hectic but this can be easily solved using npm package npm-check-updates.

Install npm check updates package

npm i -g npm-check-updates

After installing the package run these command in the file directory where your package.json file is located

ncu
ncu -u
Install those packages
$ npm i

If you want to just update those package with vulnerabilities and change package-lock.json
$ npm audit fix

Voilà!

About

A basic application for the understanding of Kubernetes and its implementation on Google Cloud Platform

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published