End to end Devops project something new
End to end Devops project something new
Pre-requisites
• Launch EC2 instances 3: Jenkins Master, Agent Machine and EKS Machine
Note:
Optional:
open file : sudo vim /etc/ssh/sshd_config - remove comment for below keys
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
Optional:
sudo init 6
open file : sudo vim /etc/ssh/sshd_config remove comment for below values
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
sudo service sshd reload
1]Docker
2]Docker Commons
3]Docker Pipeline
4]Docker API
5]docker-build-step
6]CloudBees Docker Build and Publish
7]Maven Integration Pipeline
8]Maven Integration
9]Eclipse Temurin installer
10]Maven Integration Pipeline
11]Maven Integration
12] Eclipse Temurin installer
13]onarQube Scanner
14]Sonar Quality Gates
15]Quality Gates
Master/Slave configuration:
Manage jenkins - nodes - Build in node- configuration - no of executor - change to 0 and save it
Create new node- name(jenkins-Agent) - Number of executors 2
Remote root directory: /root/jenkins1
Usage: Use this node as much as possible
Launch Method : Launch agents via SSH ()
Host: Jenkins-Agent private IP
Credentials : add jenkins
kind: ssh Username with private key
ID: Jenkins-Agent
Description: Jenkins-Agent
Username: root (as i generated ssh key for this user)
credentials :
Host Key Verification Strategy : non verifying
Manage jenkins - nodes - Build in node- configuration - no of executor - change to 0 and save it
Create new node- name(jenkins-Agent) - Number of executors 2
Remote root directory: /root/jenkins1
Usage: Use this node as much as possible
Launch Method : Launch agent by connecting it to the controller
• Name: sonarqube-server
• Server URL:
• credentials : token
• name: sonarqube-scanner
• URL: http://<Jenkins_master_private_IP>:8080/sonarqube-webhook/
Create JENKINS_API_TOKEN
Create a CI JOB :
name: gitops-register-app-ci
Discard old builds : Max # of builds to keep 2
Pipeline: pipeline script from SCM
: https://github.com/rajnages/register-app.git
# Sonarqube checks:
# Docker hub checks:
# install kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s
https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin
kubectl version --output=yaml
# Install eksctl
curl --silent --location
"https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -
s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
eksctl version
• Go to EC2 instance- Bootstrap server — Action security — Modify IAM role — add newly
created role
Create a cluster
##It will take 10min to spin up cluster. for our practical we need 3 nodes
#To interact with the API Server we need to deploy the CLI:
$ curl --silent --location -o /usr/local/bin/argocd https://github.com/argoproj/argo-
cd/releases/download/v2.4.7/argocd-linux-amd64
$ chmod +x /usr/local/bin/argocd
#Expose argocd-server
$ kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
Configure ArgoCD to Deploy Pods on EKS and Automate ArgoCD Deployment Job using
GitOps GitHub Repository
Login to argocd load balancer URL— Settings- Repositories — Connect Repo — VIA
HTTPS Type git Project default Repsitory URL :
https://github.com/rajnages/gitops-register-app.git
name: gitops-register-app-cd
Discard old builds : Max # of builds to keep 2
This project is parameterized : String parameterized: Name: IMAGE_TAG
Trigger builds remotely (e.g., from scripts): Authentication Token: gitops-token
Pipeline: pipeline script from SCM :
https://github.com/rajnages/gitops-register-app.git