π Completed DevOps Project: CI/CD Pipeline Setup with Jenkins, Docker, and Kubernetes π
Iβm excited to share the successful completion of my latest DevOps project, which involved setting up a comprehensive CI/CD pipeline and deploying a backend application. In this blog, I'll walk you through the tools used, key steps taken, and lessons learned from this project.
π οΈ Project Tools:
Maven
GitHub
Jenkins
Docker
π Project Highlights
1. Jenkins Server Setup
The first step was to set up Jenkins on an Ubuntu VM in AWS EC2. Hereβs a brief rundown of the setup process:
Create an Ubuntu VM: Deployed an Ubuntu VM (t2.medium) on AWS EC2.
Configure Security: Enabled port 8080 in the security group inbound rules.
Install Java:
Install Jenkins:
Start Jenkins:
Verify Jenkins:
Access Jenkins: Open Jenkins in your browser using the VMβs public IP address at `
http://public-ip:8080/
`.Initial Setup: Copy the Jenkins admin password and complete the setup by creating an admin account and installing required plugins.
2. Maven Configuration
Configured Maven as a global tool within Jenkins:
- Navigate to Manage Jenkins -> Tools -> Maven Installation -> Add Maven.
3. Docker Integration
Installed Docker on the Jenkins server:
4. EKS Management Host Creation
Set up an Ubuntu VM (t2.micro) for EKS management and installed necessary tools:
Install
kubectl
:$ curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl
$ chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin$ kubectl version --short --client
Install AWS CLI:
Install
eksctl
:$ curl --silent --location "[github.com/weaveworks/eksctl/releases/lates..](github.com/weaveworks/eksctl/releases/lates.. -s)_amd64.tar.gz" | tar xz -C /tmp
$ sudo mv /tmp/eksctl /usr/local/bin
$ eksctl version
5. IAM Role Creation
Created and attached IAM roles to both the EKS Management Host and Jenkins Server:
Create Role: In IAM service, select the use case as
ec2
and add the following permissions:IAM - FullAccess
VPC - FullAccess
EC2 - FullAccess
CloudFormation - FullAccess
Administrator - Access
Attach Role: Attach this role to both the EKS Management Host and Jenkins Machine.
6. EKS Cluster Setup
Created an EKS cluster using eksctl
:
$ eksctl create cluster --name K8S-cluster --region ap-south-1 --node-type t2.medium --zones ap-south-1a,ap-south-1b
Note: Cluster creation may take 5 to 10 minutes. Verify nodes with:
7. Jenkins Server Configuration
Installed AWS CLI and kubectl
on Jenkins:
AWS CLI:
kubectl
:$ curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.19.6/2021-01-05/bin/linux/amd64/kubectl
$ chmod +x ./kubectl sudo mv ./kubectl /usr/local/bin
$ kubectl version --short --client
8. Update EKS Cluster Config in Jenkins
Copy kube config file from EKS Management Host and paste it in Jenkins server:
Verify EKS Nodes in Jenkins:
9. CI/CD Pipeline Creation
- CI Job: Clones the Git repo, builds Docker images, and triggers the CD job.
- CD Job: Deploys the Docker image to the Kubernetes EKS cluster.
10. Backend Deployment
The project was focused on deploying a backend application using RDS MySQL for database management.
11. Access Application
Verified deployment by accessing the application via browser at http://<nodePort>/context-path/
.
π GitHub Repository
For more details on this project, check out the GitHub repository: Report-APP-Deployment
This project was a fantastic opportunity to dive into DevOps and backend deployment. Iβm excited to continue exploring these technologies and would love to discuss DevOps practices further. Feel free to reach out!