Internship Report
Internship Report
Chapter 1
INTRODUCTION
1.2 Setup:
Phase 1: Initial Setup and Deployment
newgrp docker
sudo chmod 777 /var/run/docker.sock
4. Build and run your application using Docker containers:
docker build -t netflix .
docker run -d --name netflix -p
8081:80 netflix:latest #to delete
docker stop <containerid>
docker rmi -f Netflix
It will show an error cause you need API key
5. : Get the API Key:
Open a web browser and navigate to TMDB (The Movie Database)
website.
Click on "Login" and create an account.
Once logged in, go to your profile and select "Settings."
Click on "API" from the left-side panel.
Create a new API key by clicking "Create" and accepting the terms and
conditions.
Provide the required basic details and click "Submit."
You will receive your TMDB API key.
Now recreate the Docker image with your api key:
Chapter 2
SECURITY
Chapter 3
CI/CD SETUP
1. Install Jenkins for Automation:
Install Jenkins on the EC2 instance to automate deployment: Install Java
sudo apt update
sudo apt install fontconfig openjdk-17-jre
java -version
openjdk version "17.0.8" 2023-07-18
OpenJDK Runtime Environment (build 17.0.8+7-Debian-1deb12u1)
OpenJDK 64-Bit Server VM (build 17.0.8+7-Debian-
1deb12u1, mixed mode, sharing)
#jenkins
sudo wget -O
/usr/share/keyrings/jenkins-keyring.asc
\
https://pkg.jenkins.io/debian-stable/jenk
ins.io-2023.key
echo deb
[signed-by=/usr/share/keyrings/jenkins-
keyring.asc] \ https://pkg.jenkins.io/debian-
stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get
install Jenkins
sudo systemctl
start Jenkins
sudo systemctl
enable Jenkins
Save
The Configure System option is used in Jenkins to configure different
server
Global Tool Configuration is used to configure different tools
that we install using Plugins
To securely handle DockerHub credentials in your Jenkins pipeline, follow these steps:
Go to "Dashboard" → "Manage Jenkins" → "Manage Credentials."
Click on "System" and then "Global credentials (unrestricted)."
Click on "Add Credentials" on the left side.
Choose "Secret text" as the kind of credentials.
Enter your DockerHub credentials (Username and Password) and
give the credentials an ID (e.g., "docker").
Click "OK" to save your DockerHub credentials.
Now, you have installed the Dependency-Check plugin, configured the tool, and added
Docker- related plugins along with your DockerHub credentials in Jenkins. You can now
proceed with configuring your Jenkins pipeline to include these tools and credentials in
your CI/CD process.
10. Then Simply add the Docker image building and pushing it to the
dockerhub steps too in the Jenkins File.
After all build steps get successful the Jenkins Job will run and looks like:
And when u access the <instance ip>:8081 on browser the following page will be
displayed
Chapter 4
MONITORING
Create a system user for Node Exporter and download Node Exporter:
sudo useradd --system --no-create-home --shell /bin/false node_exporter
wget
https://github.com/prometheus/node_exporter/releases/download/v1.6.1/
node_exporte r-1.6.1.linux-amd64.tar.gz
Extract Node Exporter files, move the :
Enable and start Node Exporter: sudo systemctl enable node_exporter sudo
systemctl start node_exporter
Verify the Node Exporter's status: sudo systemctl status
node_exporter
You can access Node Exporter metrics in Prometheus.
Grafana
Install Grafana on Ubuntu 22.04 and Set it up to Work with Prometheus Step 1: Install
Dependencies:
First, ensure that all necessary dependencies are installed: sudo apt-get
Dept. of CSE, ACSCE 2024-25 15
Deploy Netflix Clone on Cloud using Jenkins
update.
sudo apt-get install -y apt-transport-https software properties-common
Step 2: Add the GPG Key:
Open a web browser and navigate to Grafana using your server's IP address.
The default port for Grafana is 3000. For example:
http://<your-server-ip>:3000
You'll be prompted to log in to Grafana. The default username is "admin,"
and the default password is also "admin."
4.3 Grafana
When you log in for the first time, Grafana will prompt you to
change the default password for security reasons. Follow the
prompts to set a new password.
To visualize metrics, you need to add a data source. Follow these steps:
1. Click on the gear icon (⚙️) in the left sidebar to open the
"Configuration" menu.
2. Select "Data Sources."
3. Click on the "Add data source" button.
4. Choose "Prometheus" as the data source type.
5. In the "HTTP" section:
Set the "URL" to http://localhost:9090 (assuming
Prometheus is running on the same server).
6. Click the "Save & Test" button to ensure the data server is
working. Step 10: Import a Dashboard:
To make it easier to view metrics, you can import a pre-configured
dashboard. Follow these steps:
Dept. of CSE, ACSCE 2024-25 17
Deploy Netflix Clone on Cloud using Jenkins
Click on the "+" (plus) icon in the left sidebar to open the "Create" menu.
Select "Dashboard."
Click on the "Import" dashboard option.
Enter the dashboard code you want to import (e.g., code 1860).
Click the "Load" button.
Select the data source you added (Prometheus) from the dropdown.
Click on the "Import" button.
You should now have a Grafana dashboard set up to visualize metrics from Prometheus.
Grafana is a powerful tool for creating visualizations and dashboards, and you can
further customize it to suit your specific monitoring needs.
That's it! You've successfully installed and set up Grafana to work with Prometheus for
monitoring and visualization.
Chapter 5
NOTIFICATION
Implement Notification Services:
the connection
And also add this at Extended Email Notification Section:
If any Job Got Success or Failed You will get an email as this:
Chapter 6
KUBERNETES
Create Kubernetes Cluster with Nodegroups
In this phase, you'll set up a Kubernetes cluster with node groups. This will
provide a scalable environment to deploy and manage your applications.
To begin monitoring your Kubernetes cluster, you'll install the Prometheus Node
Exporter. This component allows you to collect system-level metrics from your
cluster nodes. Here are the steps to install the Node Exporter using Helm:
https://prometheus-community.github.io/helm-charts
-
job_nam
e:
'Netflix'
metrics_
path:
'/metrics'
static_co
nfigs:
- targets: ['node1Ip:9100']
Replace 'your-job-name' with a descriptive name for your job. The static_configs
section specifies the targets to scrape metrics from, and in this case, it's set to
nodeip:9001.
Don't forget to reload or restart Prometheus to apply these changes to your
configuration.
To deploy an application with ArgoCD, you can follow these steps, which I'll
outline in Markdown format:
Install ArgoCD:
You can install ArgoCD on your Kubernetes cluster by following the instructions
provided in the EKS Workshop documentation.
2. Set Your GitHub Repository as a Source:
After installing ArgoCD, you need to set up your GitHub repository as a source for
your application deployment. This typically involves configuring the connection to
your repository and defining the source for your ArgoCD application. The specific
steps will depend on your setup and requirements.
6.2 Argo CD
To Access the app make sure port 30007 is open in your security group and then
open a new tab paste your NodeIP:30007, your app should be running.
Chapter 7
CONCLUSION
The successful deployment of the Netflix Clone application using Jenkins on the cloud
exemplifies a holistic application of DevSecOps principles, blending development,
security, and operations into a seamless workflow. Through the use of cloud infrastructure
(AWS EC2 and EKS), containerization with Docker, and CI/CD automation via Jenkins,
this project offered real-world exposure to scalable and secure software delivery. Security
was integrated from the outset using tools like SonarQube, Trivy, and OWASP
Dependency-Check to proactively identify and resolve vulnerabilities. Continuous
monitoring and observability were established using Prometheus and Grafana, ensuring
system health and performance could be visualized and acted upon in real-time.
The project extended to Kubernetes, enabling container orchestration and scalability, and
implemented ArgoCD for GitOps-based deployment, enhancing version control and
rollback capabilities. Notification systems, such as email alerts, improved visibility and
responsiveness to pipeline outcomes. Finally, the inclusion of a cleanup phase emphasized
responsible cloud resource management.
This internship experience not only deepened technical knowledge in cloud computing
and DevSecOps practices but also emphasized the importance of automation, security, and
collaboration in modern software engineering. The hands-on implementation reinforced
best practices, making it a significant step toward professional growth in the DevOps
domain.