/Nodeapp

Assesment

Primary LanguageCSSMIT LicenseMIT

What I have added in this repo?

  • Modified app.js and .env.example files, instead of passing MongoDB URI , I have passed the username,password,host,port and DB separately so that we can separate these as kubernetes ConfigMap and Secrets.
  • Added Jenkinsfile for End to end CI
  • Added sonar-project.properties file for static code analysis.
  • Added Kubernetes folder contains k8s manifest files.
  • helm folder added.
  • added argo-application.yaml file

Task1: I have used Jenkins for ci/cd , written and pushed The Jenkinsfile to the folder.

Task2: I have configured webhooks-in github , so as i push the code to github repo my jenkins job triggerd and Failed at stage scan image , Because i have used trivy to scan the image for Vulnerablities. It is having High and Critical Vulnerablities so the CI stopped.

Capture

Console Output screenshot

Capture2

To remove these Vulnerablities we need to modify the Dockerfile, we can use distroless images or remove the unwanted packages from the base image.

To proceed furuther I have changed my jenkinsfile to just scan the Vulnerablities and proceed.

Task3:

For code quality/code coverage used SonarQube, Integrated sonarqube with the jenkins server . In the Global tool configuration, configured the sonar scanner. created the sonar-project.properties file. Using build-in sonarway quality-gate.

sonarQube

Task4:

Build the Docker image in Ci, and push that to Docker hub and then deploy it into the Kubernets cluster.

endtoend

we can check that in k8 cluster

kubectl get deployment

kubernetes

Task5:

Created the helm chart for the node app, used mongodb as dependency chart for that. For our application up and running simply install this chart.

created the argo-application.yaml file , with help of this declarative file we can deploy the helm chart in kubernetes cluster using ArgoCd.

kubectl apply-f argo-application.yaml.

Argocd