Lab 5.1 - Distributed Jenkins Builds

1. Configuring SSH. Do it on the master node

ssh root@10.X.X.66
su - jenkins

ssh-keygen -t rsa
cat .ssh/id_rsa.pub

2. Install Java Development Kit 11 and save the public key of master node on slave node

ssh root@10.X.X.67
sudo apt install openjdk-11-jdk
java -version
useradd -m -s /bin/bash jenkins
su - jenkins
mkdir .ssh/
cat << EOF >> .ssh/authorized_keys
[Paste the public key here]
EOF

3. Try to SSH from master to slave node using jenkins user

ssh jenkins@10.X.X.67

4. Go to Jenkins Dashboard > Manage Jenkins

5. And then click Manage Nodes and Clouds

6. To add a new node, click New Node button

7. Identify it with the following values:

  • Name: podX-slave0
  • Type: Permanent Agent

Click OK

8. Configure the slave node with these properties:

  • Number # of executors: 2
  • Remote root directory: /home/jenkins
  • No Labels
  • Usage: Use this node as much as possible
  • Launch method: Launch slave agents via SSH and configure it with:
    • Host: 10.X.X.67

For credentials, click Add > Jenkins:

  • Domain: Global Credentials (unrestricted)
  • Kind: SSH Username with private key
  • Username: jenkins
  • Private Key: Enter directly and paste the private key of user jenkins in master node (you can retrieve from id_rsa file on folder .ssh/ which generated before)
  • Passphrase: None and then click Add

  • Set the Credentials field dropdown to Jenkins (SSH Key for the Agent)
  • Click the button Advanced to access the Port field, and set it to 22
  • Host Key Verification Strategy: No verifying verification strategy
  • Under the Node Properties, check the toggle for Environment Variables
  • Click Add to add a new environment variable
  • Enter JAVA_HOME for Name and /usr/lib/jvm/java-11-openjdk-amd64/ for value

Click Save

9. Click the Node podX-slave0 on the list

10. On the left-menu, click on the Log

11. See that, if you read the log, the agent is now online

Daftar Materi
  • CI and CD Fundamentals
  • Old Ways of Software Development
  • Agile Development Process
  • Agile Development Process Work?
  • Modern Development Philosophies
  • CI / CD
  • DevOps Culture
  • Git Overview
  • Git Basic Command
  • Lab 1.1 - Managing Repository Using Git
  • Jenkins Overview
  • Jenkins Overview
  • Jenkins Short History
  • Why Jenkins is popular
  • Jenkins Releases
  • Installing Jenkins
  • Topology and Lab Environment
  • Jenkins Admin Basics
  • Manage Jenkins Screens
  • The Jenkins Home Directory
  • Jenkins Workflow
  • Using Credentials
  • Configuring Credentials
  • Plugin Management
  • Advanced Jenkins Features
  • Working with SCM
  • Source Code Management (SCM)
  • A History of SCM
  • Advanced SCM
  • Modifying the Code
  • SCM Repository
  • Updating the Repository
  • SCM Terminology
  • Branch and Merge Strategies
  • Release Branching
  • Supported SCM Products
  • View The Changelogs
  • Incremental & Clean Check Out
  • Jenkins Jobs and Builds
  • What is Job?
  • Different Types of Jobs
  • Relationship Between Project
  • What is a Builds?
  • Builds Notifications
  • Polling
  • A Periodic Build Trigger
  • How Does Pushing Work
  • Lab 7.1 - First Job in Jenkins
  • Lab 7.2 - Scheduling a Job
  • Lab 7.3 - Maven Job
  • Lab 7.4 - Jenkins Email Notification
  • Lab 7.5 - Monitoring Jenkins Job
  • Code Quality and Code Coverage Metrics
  • Software Testing
  • Importance of Testing
  • Automated Testing
  • Categories of Testing
  • The Testing Portfolio
  • The Testing Pyramid
  • Code Coverage Metrics
  • Code Coverage Tools
  • Lab 8.1 - Testing Code Quality With JUnit
  • Lab 8.2 - Code Coverage using JaCoCo
  • Parameterized Builds
  • Build Parameter
  • Type Of Parameters
  • The Ways of Using Parameterized Builds
  • Configuring Parameterized Builds
  • Lab 9.1 - Parameterized Jobs
  • Lab 9.2 - Build Triggers and Steps
  • Pipeline
  • Pipeline
  • Scope of Pipeline
  • The Advantages of Pipeline
  • Jenkins Pipeline Sections
  • Scripted Pipeline
  • Declarative Pipeline
  • Tools for Working with Pipeline
  • Parallel Stages
  • Pipeline without Blue Ocean
  • Lab 10.1 - Go Jenkins Pipeline
  • Lab 10.2 - Docker Declarative Pipeline on Spesific Node
  • Lab 10.3 - Create a Simple Scripted Pipeline
  • Automated Deployments
  • Automate Jenkins
  • Jenkins CLI
  • Lab 11.1 - Multibranch Pipeline
  • Lab 11.2 - Configuring Jenkins to Connect to Kubernetes cluster
  • Validated Merge for GitHub
  • Overview - Validated Merge
  • Validated Merge Model
  • Access Control
  • Post-build Push Failure
  • Server Setup
  • Pull Request Builder for GitHub
  • Pull Requests
  • Commands
  • Configuring a Github Hook
  • Lab 13.1 - Integrate GitHub Webhook with Jenkins
  • Lab 13.2 - GitHub Pull Request Builder
  • Templates
  • The Jenkins Template Engine
  • Benefits of the Templating Engine
  • Implementing the Template
  • Lab 14.1 - Templating Engine Basic
  • Lab 14.2 - Templating Engine using SCM