Overview
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.
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.
Step |
Description |
Image |
---|---|---|
|
jenkins/jenkins:lts 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. |
|
|
The Jenkins agent requires three images:
|
|
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.) |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot