Skip to content

devulapallideepika/Jenkins

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 

Repository files navigation

Install Jenkins, configure Docker as slave, set up cicd, deploy applications to k8s using Argo CD in GitOps way.

  • create ec2 instance

install jenkins

  • Pre-Requisites:
    • java

Run the below commands to install java & jenkins

  • Install java
    • sudo apt update
    • sudo apt install openjdk-11-jre

image

  • Verify Java is Installed
    • java -version
  • Installing jenkins
  • curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee
    /usr/share/keyrings/jenkins-keyring.asc > /dev/null
  • echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]
    https://pkg.jenkins.io/debian binary/ | sudo tee
    /etc/apt/sources.list.d/jenkins.list > /dev/null
  • sudo apt-get update
  • sudo apt-get install jenkins

image

  • Allow the inbound rule with port 8080 as jenkins by default runs on port 8080.
  • Access the Jenkins on http://:8080
  • To know the administration password the command is sudo cat /var/lib/jenkins/secrets/initialAdminPassword

image

image

image

install docker

  • Below are the commands to install docker

  • sudo apt update

  • sudo apt install docker.io

  • image

Grant Jenkins user and Ubuntu user permission to docker deamon.

  • sudo su -
  • usermod -aG docker jenkins
  • usermod -aG docker ubuntu
  • systemctl restart docker

install sonarqube

  • sudo su - -apt install unzip -adduser sonarqube

image

-wget https://binaries.sonarsource.com/Distribution/sonarqube/sonarqube-9.4.0.54424.zip

image

  • unzip *
  • chmod -R 755 /home/sonarqube/sonarqube-9.4.0.54424
  • chown -R sonarqube:sonarqube /home/sonarqube/sonarqube-9.4.0.54424
  • cd sonarqube-9.4.0.54424/bin/linux-x86-64/
  • ./sonar.sh start

image

  • Access the SonarQube Server on http://:9000

image

install necessary plugins in jenkins

  • install docker-pipeline plugin

image

  • install sonarqube scanner plugin

image

Given global credientials in jenkins

  • docker username & password given as credientials

image

  • github token given as secret text

image

  • sonarqube token given as secret text

image

image

image

image

set up kubernetes using eksctl

  • create ec2 instance and add Iam role with permissions -ec2fullaccess -cloudformationFullaccess -IamFullaccess -Administrator access

image

image

install awscli

image

image

install kubectl

image

install eksctl

image

  • create eks cluster

image

image

ARGOCD installation in eksctl

image

image

image

IN JENKINS

  • create a job
  • given git URL and git branch and jenkins file path

image

image

  • installed necessary plugins including docker pipeline , sonarqube scanner plugins .
  • Given credentials of Docker username & password,sonarqube token,github token
  • now build the job

image

image

image

  • In sonarqube quality check is passed

image

In argocd

  • create an application by connecting to repository

image

image

image

image

  • created Pod

image

  • created Deployment

image

  • created Service

image

image

-Access the application using loadbalancer

image




Deploying application using Docker

  • packaging the code using mvn clean package command

image

image

  • creating image using docker build command

image

image

  • creating container from the image created using docker build command.

  • docker run -p $HOST_PORT:$CONTAINER_PORT --name <container_name> -t : command to create container

image

  • Access the application on localhost:port no

image

About

Install Jenkins, configure Docker as slave, set up cicd, deploy applications to k8s using Argo CD in GitOps way.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • HTML 39.7%
  • Java 39.2%
  • Dockerfile 16.2%
  • CSS 4.9%