A real time chat application through socket.io has been implemented and hosted through node.js server. The application is shipped as a docker image available on dockerhub which is then deployed as pods through k0s kubernetes cluster. The monitoring is performed by Prometheus and the front-end dashboard is provided through Grafana.The WAF for the node application is implemented through a helmet. Helmet is a npm package which configures http headers to be more secure.The CI/CD is implemented through github and github-actions.
Horizontal pod autoscaling has been developed to scale pods based on cpu resource consumption. Manifest files have been used to deploy the same. The pods have been tested with a payload and the scaling has been observed (refer to screenshots 1 2 and 3) The pods eventually downscale after a period of time.
Prometheus scrapes the node exporters running on kubernetes and creates metrics and logs. These metrics are then used by Grafana through specific queries. We can observe that there is a peak in cpu cycles and the number of packets received by the application in the prometheus and grafana dashboards. Logs can be seen in screenshot 4. screenshots 5,6,7,8,9
Github has been used for maintaining different branches and versions of the application source code. Building and testing of the application’s docker image has been done through workflow in github-actions. Refer screenshot 10,11 Security The application has been secured with https (screenshot 12) with ssl certificates generated with openssl. Note:since the certificates are self signed, there is a warning shown. The waf as mentioned earlier has been implemented using helmet. Refer screenshot 13