Solution Overview
What Is Jenkins?
Jenkins is an open source continuous integration (CI) tool that provides user-friendly GUIs. It originates from Hudson and is used to automate all sorts of tasks related to building, testing, and delivering or deploying software.
Jenkins is written in Java and can run in popular servlet containers such as Tomcat, or run independently. It is usually used together with the version control tools (or SCM tools) and build tools. Jenkins supports various languages and is compatible with third-party build tools, such as Maven, Ant, and Gradle. It seamlessly integrates with common version control tools, such as SVN and Git, and can directly connect to source code hosting services, such as GitHub.
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 the following methods:
- You can use a single Master to install Jenkins. The Master handles jobs and builds and releases services. However, security risks may exist.
- Another one is to use Master+Agents. 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 the Master and Agents on VMs, containers, or combination of the two. For details, see Table 1.
Deployment Mode |
Master |
Agent |
Advantages and Disadvantages |
---|---|---|---|
Single Master |
VMs |
- |
|
Single Master |
Containers |
- |
|
Master+Agents |
VMs |
VMs |
|
Containers (Kubernetes cluster) |
|
||
Master+Agents |
Containers (Kubernetes cluster) |
Containers (Kubernetes cluster) |
|
In this section, Jenkins is installed with the containerized Master and Agents. Kubernetes schedules the dynamic Agents. For details about the architecture, see Figure 1.
- The Master handles jobs. Install Kubernetes add-ons on the Master to use the Kubernetes platform resources.
- The Kubernetes platform generates pods for Agents to execute jobs. When a job is scheduled on the Master, the Master sends a request to the Kubernetes platform using the Kubernetes add-on. After receiving the request, Kubernetes builds a pod using the pod template to send requests to the Master. After the Master is successfully connected, you can execute the job on the pod.
Procedure
- Installing and Deploying Jenkins Master
Jenkins Master is deployed in the CCE cluster using container images.
- Configuring Jenkins Agent
Jenkins can fix Agents in the cluster or use the pipeline 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.
- Using Jenkins to Build a Pipeline
The Jenkins pipeline interconnects with SWR and calls 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).
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