100-Days-Of-DevOps-Challenge-KodeKloud

Set Up Jenkins Server

The DevOps team at xFusionCorp Industries is initiating the setup of CI/CD pipelines and has decided to utilize Jenkins as their server. Execute the task according to the provided requirements:

  1. Install Jenkins on the jenkins server using the yum utility only, and start its service.
    • If you face a timeout issue while starting the Jenkins service, refer to this.
  2. Jenkin’s admin user name should be theadmin, password should be Adm!n321, full name should be John and email should be john@jenkins.stratos.xfusioncorp.com.

Note:

  1. To access the jenkins server, connect from the jump host using the root user with the password S3curePass.

  2. After Jenkins server installation, click the Jenkins button on the top bar to access the Jenkins UI and follow on-screen instructions to create an admin user.

Steps

  1. Login into jenkins server and find operating system

     ssh root@jenkins
    
      cat /etc/os-release 
     NAME="CentOS Stream"
     VERSION="9"
     ID="centos"
     ID_LIKE="rhel fedora"
     VERSION_ID="9"
     PLATFORM_ID="platform:el9"
     PRETTY_NAME="CentOS Stream 9"
     ANSI_COLOR="0;31"
     LOGO="fedora-logo-icon"
     CPE_NAME="cpe:/o:centos:centos:9"
     HOME_URL="https://centos.org/"
     BUG_REPORT_URL="https://issues.redhat.com/"
     REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 9"
     REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
    

    We can see its’ centos 9 os based server

  2. Run the following command to update packages:

     yum update -y
     yum install -y wget
    
  3. We will install jenkins for fedora with stable version, following this [Documentation]

     sudo wget -O /etc/yum.repos.d/jenkins.repo \
     https://pkg.jenkins.io/redhat-stable/jenkins.repo
     sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
     sudo dnf upgrade -y
     # Add required dependencies for the jenkins package
     sudo dnf install fontconfig java-21-openjdk -y
     sudo dnf install jenkins -y
     sudo systemctl daemon-reload
    
  4. Start Jenkins server

     sudo systemctl enable --now jenkins
    
  5. Copy the password:

     cat /var/lib/jenkins/secrets/initialAdminPassword
    
  6. Login into Jenkins UI and Setup Jenkins

    • Paste the initial password
    • Install suggested plugins (it will take some time)
    • Continue (skil retry)
    • set: username, password, confirm password, full name and email
    • Save and Continue > Save and Finish
    • Start Jenkins
    • Done

Good to Know?

Jenkins Fundamentals

Jenkins Architecture

Key Features

Installation Components