🐳 A very simple application that uses Kubernetes and Docker containers. This is my first project on K8s and Google cloud platform.
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.
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.
- 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
- 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
- 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
- To change redis deployment configuration, edit
k8s/redis-deployment.yml
- To change redis service configuration, edit
k8s/redis-cluster-ip-service.yml
- To change postgres deployment configuration, edit
k8s/postgres-deployment.yml
- To change postgres service configuration, edit
k8s/postgres-cluster-ip-service.yml
- To change the load balancer configuration, edit
k8s/ingress-service.yml
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à!