Updated on 2026-03-10 GMT+08:00

Solution Overview

What Is Jenkins?

Jenkins is an open-source continuous integration (CI) tool with a user-friendly GUI. Originally derived from Hudson, it automates the continuous building and testing of software projects and helps monitor the execution of external tasks.

Jenkins is written in Java and can run separately or in popular servlet containers such as Tomcat. It is usually used together with the version control tools (or SCM tools) and build tools. Jenkins supports project building in diverse languages and is fully compatible with many third-party build tools, such as Maven, Ant, and Gradle. Jenkins is seamlessly integrated with typical versioning tools, such as SVN and GIT. It can directly connect to source code hosting websites, such as GitHub.

Notes and Constraints

  • This solution can be deployed only in CCE clusters. It is not supported in DeC.
  • CCE does not provide maintenance and support for Jenkins. The maintenance is provided by the developers.

Solution Architecture

You can install Jenkins using either of the following ways:

  • Use a single master to install Jenkins. The master handles jobs and builds and releases services. However, security risks may exist.
  • Use masters and agents. A master schedules build jobs to agents for execution, and monitors agent status. Agents execute build jobs dispatched by the master and return the job progress and result.

You can install Jenkins masters and agents on VMs, containers, or combination of the two. For details, see Table 1.

Table 1 Jenkins deployment modes

Deployment Mode

Master

Agent

Advantages and Disadvantages

Single master

VMs

N/A

  • Advantage: Localized construction is easy to operate.
  • Disadvantage: Job management and execution are performed on the same VM and the security risk is high.

Single master

Containers

N/A

  • Advantage: Kubernetes containers support self-healing.
  • Disadvantage: Job management and execution are not isolated. Security risks exist.

Masters and agents

VMs

VMs

  • Advantage: Job management and execution are isolated and the security risk is low.
  • Disadvantage: Agents are fixed. Resources cannot be scheduled. The resource utilization is low, and the maintenance cost is high.

Containers (Kubernetes cluster)

  • Advantage: Containerized agents can be fixed or dynamic. Kubernetes schedules the dynamic agents, improving the resource utilization. Jobs can be evenly allocated based on the scheduling policy, which is easy to maintain.
  • Disadvantage: The master may break down and the recovery cost is high.

Masters and agents

Containers (Kubernetes cluster)

Containers (Kubernetes cluster)

  • Advantage: Containerized agents can be fixed or dynamic. Kubernetes schedules the dynamic agents, improving the resource utilization. The master is self-healing and the maintenance cost is low. Agents and the master can be deployed in the same cluster or in different clusters.
  • Disadvantage: The system is complex and the environment is difficult to set up.

In this section, Jenkins is installed with the containerized masters and agents. Kubernetes schedules the dynamic agents. For details about the architecture, see Figure 1.

  • Masters manage jobs. To use the Kubernetes resources, install Kubernetes add-ons on the masters.
  • Kubernetes creates pods for agents to execute jobs. When a job on a master is scheduled, the master sends a request to Kubernetes through the Kubernetes add-ons. After receiving the request, Kubernetes creates a pod using the pod template. The pod then sends requests to the master. After accessing the master, you can execute the job on the pod.
Figure 1 Installing Jenkins on Kubernetes

Procedure

  1. Install and deploy a Jenkins master by referring to Installing and Deploying a Jenkins Master.

    Jenkins masters are deployed in a CCE cluster using container images.

  2. Configuring a Jenkins Agent

    Jenkins can create static agents in a cluster or use pipelines to interconnect with CCE to provide pods for agents to execute jobs. The dynamic agents use Kubernetes add-ons to configure cluster authentication and user permissions.

  3. Use Jenkins to build a pipeline by referring to Using Jenkins to Build a Pipeline.

    Jenkins pipelines interconnect with SWR and call docker build/login/push commands in agents to package and push images automatically.

    You can also use pipelines to deploy and upgrade Kubernetes resources (such as Deployments, Services, ingresses, and jobs).