Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Overview

Updated on 2025-01-03 GMT+08:00

Jenkins is an open-source automation server widely used for continuous integration (CI) and continuous delivery (CD). When your code library changes, Jenkins helps you automatically build, test, and deploy applications, improving development efficiency and product quality. Jenkins can be deployed in different environments. Each environment has their advantages. For details, see Table 1. In addition, Jenkins can be deployed on a single node or in a distributed mode.

  • Single-node deployment: Jenkins runs as an independent instance. All builds and operations are performed on the Jenkins master, which is responsible for job scheduling, system management, and execution of specific build jobs. All jobs are running on the same node, which may cause excessive consumption of system resources. In addition, as the project scale and the number of build jobs increase, single-node deployment may become a performance bottleneck. This deployment mode is suitable for small teams or individuals.
  • Distributed deployment: The Jenkins master is responsible for job scheduling and system management, and the Jenkins agents for executing specific build jobs. The Jenkins master receives build requests from users and distributes jobs to available Jenkins agents. Each Jenkins agent can be independently configured to support different OSs and build tools, providing flexible build environments and scalability. In addition, the separation of management and execution can effectively improve system performance and response speed. This mode is suitable for large-scale production environments, especially when there are a large number of build jobs or there are high requirements for concurrent builds.

This section uses distributed deployment as an example to describe how to deploy and use Jenkins in a CCE Autopilot cluster.

Table 1 Comparisons of environments where Jenkins will be deployed

Item

CCE Autopilot

CCE Standard/CCE Turbo

VMs

Physical Machines

Scenario

CI/CD and scenarios that have high requirements for automation management.

Large-scale distributed environment and CI/CD.

Small- and medium-sized projects, or scenarios where multiple teams or projects share one physical machine.

Scenarios that have high requirements for performance and hardware, require stable resources, and do not require frequent expansion.

Performance

High

High

Relatively low

High

Resource utilization

High

High

Relatively low

Low

O&M

Simple

Simple

Less complex

Complex

Scalability

Auto scaling in seconds

Auto scaling in minutes

Relatively poor

Poor

Availability

High

High

High

Relatively low

Isolation level

High

Relatively low

High

High

Precautions

CCE does not provide maintenance and support for Jenkins. The maintenance is provided by the developers.

Basic Concepts of Jenkins

  • Jenkins master: the core of the Jenkins system. It manages and coordinates all jobs. It can be regarded as a manager that does not directly execute jobs. Instead, it allocates jobs to other workers (Jenkins agents).
    NOTE:

    The Jenkins master provides a web page for users to perform operations and view the task progress.

  • Jenkins agent: a pod or machine that Jenkins uses to execute jobs. Multiple Jenkins agents can be configured at the same time to share the load and improve job concurrency and efficiency.
  • Plugin: a component that extends the functionality of Jenkins. Jenkins allows users to install different plugins as needed to implement functions such as versioning, build tools, and deployment. In addition, plugins can integrate different tools and technologies, such as Kubernetes, Git, and Maven. The Kubernetes plugin is the key to information exchange between Jenkins and the cluster.
  • Pipeline: an automated workflow that connects multiple phases (such as build, test, and deployment) in the software development process to ensure that each step can be automatically executed in a certain sequence and based on certain rules. With the pipeline, you can deliver jobs to the Jenkins master and use the pipeline script to define the entire automation process. The Jenkins master executes the jobs based on the script.
  • Cloud: Various cloud environments, such as clusters, containers, and VMs, can be configured to flexibly use compute resources of external cloud platforms and implement dynamic management of Jenkins agents.
    Figure 1 Logical relationships between basic concepts

Solution Architecture

Figure 2 shows the steps for deploying Jenkins and Table 2 provides more details.

Figure 2 Flowchart
Table 2 Procedure

Step

Description

Image

Deploying the Jenkins Master in the Cluster

  • Install and deploy the Jenkins master in the CCE Autopilot cluster for managing jobs.
  • Use a browser to access the Jenkins master through the public IP address of the load balancer.

jenkins/jenkins:lts

NOTE:

jenkins/jenkins:lts indicates a Docker LTS image. The LTS version is a long-term release provided by Jenkins. It is relatively stable and will receive security updates and bug fixes for a longer time. It is suitable for production systems that require a stable environment. For more information, see LTS Release Line.

Configuring the Jenkins Agent

  • Install the Kubernetes plugin on the Jenkins web page.
  • Configure cluster information in the cloud to connect to the cluster.
  • Configure a pod template for dynamically creating Jenkins agent pods in the cloud.

The Jenkins agent requires three images:

  • jenkins/inbound-agent:latest: used to connect the Jenkins agent and Jenkins master to ensure continuous job execution.
  • maven:3.8.1-jdk-8: used to execute packing jobs in the pipeline.
  • gcr.io/kaniko-project/executor:v1.23.2-debug: used to build and push Docker images in the container.

Building and Executing a Pipeline on Jenkins

  • Compile a pipeline script on the Jenkins web page, define the automation process of the entire job, and compile the job into a language that can be understood by the Jenkins master.
  • The Jenkins master coordinates the execution process of the pipeline, dynamically creates Jenkins agents (in the form of pods) in the cluster through the Kubernetes plugin, and distributes jobs to Jenkins agents for processing. After the jobs are complete, Jenkins agents are automatically deleted.

In this example, the pipeline pulls code from the code repository, packs the code into an image, and pushes the image to the SWR image repository.

tomcat (This image needs to be pulled to SWR.)

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback