Netflix Clone CI/CD Pipeline | Jenkins | Docker | Kubernetes | Monitoring | DevSecOps
In these Project, we are cloning the Netflix API using the Bunch of tools. We are using the Grafana and Prometheus for monitoring All the tools. Use the Jenkins for CI/CD and K8s for the Deployment .

Step 1:Launch an Ubuntu(22.04) T2 Large Instance

Step 2 — Install Jenkins, Docker and Trivy








Install Trivy



Step 3: Create a TMDB API Key







Step 4 — Install Prometheus and Grafana On the new Server




let's move the Prometheus binary and a promtool to the /usr/local/bin/. promtool is used to check configuration files and Prometheus rules.
The main Prometheus configuration file.
To avoid permission issues, you need to set the correct ownership for the /etc/prometheus/ and data directory.

You can delete the archive and a Prometheus folder when you are done.

Verify that you can execute the Prometheus binary by running the following command:

To get more information and configuration options, run Prometheus Help.
We're going to use Systemd, which is a system and service manager for Linux operating systems. For that, we need to create a Systemd unit configuration file.


If , you encounter any issues with Prometheus or are unable to start it. The easiest way to find the problem is to use the journalctl command and search for errors.
Now we can try to access it via the browser. I'm going to be using the IP address of the Ubuntu server. You need to append port 9090 to the IP.


Install Node Exporter on Ubuntu 22.04







If you have any issues, check logs with journalctl
To create a static target, you need to add job_name with static_configs.

prometheus.yml




Install Grafana on Ubuntu 22.04




Go to http://<ip>:3000 and log in to the Grafana using default credentials. The username is admin, and the password is admin as well.
http://<ip>:3000 and log in to the Grafana using default credentials. The username is admin, and the password is admin as well.


For the URL, enter localhost:9090 and click Save and test. You can see Data source is working.





You will see this output

Step 5 — Install the Prometheus Plugin and Integrate it with the Prometheus server










Step 6 — Email Integration With Jenkins and Plugin Setup








This is to just verify the mail configuration






Step 7 — Install Plugins like JDK, Sonarqube Scanner, NodeJs, OWASP Dependency Check
7A — Install Plugin

7B — Configure Java and Nodejs in Global Tool Configuration



Step 8 — Configure Sonar Server in Manage Jenkins









Let's go to our Pipeline and add the script in our Pipeline Script.



Click on Build now, you will see the stage view like this

To see the report, you can go to Sonarqube Server and go to Projects.

Step 9 — Install OWASP Dependency Check Plugins


Now go configure → Pipeline and add this stage to your pipeline and build.

The stage view would look like this,



Step 10 — Docker Image Build and Push



Add this stage to Pipeline Script


When you log in to Dockerhub, you will see a new image is created

Now Run the container to see if the game coming up or not by adding the below stage


You will get this output

Step 11 — Kuberenetes Setup



Part 1 ----------Master Node------------
----------Worker Node------------
Part 2 ------------Both Master & Node ------------
Part 3 --------------- Master ---------------
----------Worker Node------------




Install Node_exporter on both master and worker














STEP 12:Access from a Web browser with




Complete Pipeline
Step 13: Terminate instances.
Last updated