Certified Jenkins Engineer

Jenkins Setup and Interface

Jenkins Architecture

Jenkins employs a distributed architecture to streamline CI/CD pipelines across multiple machines. This design delivers high scalability and flexibility, enabling automated workflows for projects of any size.

Jenkins Controller

The Jenkins Controller (formerly the master) is the central orchestration engine. It is responsible for:

  • User authentication and authorization
  • Job and pipeline definitions, scheduling, and monitoring
  • Plugin management and configuration
  • Hosting the web interface for setup, onboarding, and build insights

The image illustrates the Jenkins architecture, highlighting the Jenkins Controller Node with components like Plugins, Jobs, Nodes, Credentials, and Configurations, and its role in managing CI/CD processes.

Warning

Running build jobs on the controller is suitable for small or test environments only. In production, keep the controller free from heavy workloads to maintain stability.

For production or large-scale setups, isolate build execution by attaching dedicated worker nodes. Key advantages:

  • Protect controller configurations from accidental modifications
  • Offload build tasks to boost performance
  • Scale seamlessly by adding more agents as demand grows

The image illustrates Jenkins architecture, highlighting components of the Jenkins Controller Node and comparing basic and advanced deployment strategies.

Nodes and Executors

Nodes (agents) are the machines—Linux, Windows, or macOS—that run your build jobs. They connect to the controller using:

  • SSH (Secure Shell)
  • JNLP (Java Network Launch Protocol)

Each node offers a set number of executors, which are parallel slots for running builds. When configuring executors, consider:

  • Available CPU and memory
  • Job resource requirements
  • Isolation level:
    • One executor per node for maximum separation
    • One executor per CPU core for higher throughput

Agents

An agent defines how a node communicates with the controller, specifying protocol and authentication. Common agent types include:

Agent TypeProtocolUse Case
SSHSSHLinux/Unix nodes with SSH access
JNLPJNLPWindows nodes or nodes behind firewalls

Alternative approaches:

  • Docker agents

    • Package all build tools in a Docker image
    • Run every job in a fresh container for consistency and isolation

    Note

    Using Docker-based agents ensures a clean environment per build and avoids version conflicts.

  • Kubernetes agents

    • Dynamically provision pods as Jenkins agents
    • Scale on demand and reclaim resources when builds complete

The image illustrates the Jenkins architecture, showing the relationship between the Jenkins Controller Node and various Jenkins Worker Nodes, including Linux and Windows nodes, connected via SSH and JNLP.

Putting It All Together

A typical Jenkins deployment might consist of one controller and multiple worker nodes. The execution flow:

  1. Define jobs and pipelines via the UI, CLI, or REST API.
  2. Controller identifies available executors on connected nodes.
  3. Controller schedules and dispatches build tasks to worker executors.
  4. Nodes execute builds and return status, logs, and artifacts.
  5. Controller aggregates results and provides real-time feedback.

The image is a diagram showing a Jenkins setup with a controller node and two worker nodes (Linux and MacOS), illustrating job success and failure.

This distributed model makes scaling straightforward: add more nodes or increase executor counts to handle growing workloads and complex pipelines.

Watch Video

Watch video content

Previous
Software Testing