A Jenkins cluster management device based on Kubernetes

By using a Kubernetes-based Jenkins cluster management device, the problem of inconvenient management of Jenkins hosts and nodes is solved, enabling fast and unified management and creation, and improving operational efficiency.

CN114398146BActive Publication Date: 2025-02-18宝宝巴士股份有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111614592.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-02-18
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

Existing technologies suffer from inconvenience, slowness, and lack of uniformity in managing multiple Jenkins hosts and nodes in different Kubernetes clusters.

Method used

The Jenkins cluster management system, based on Kubernetes, includes a Jenkins host management module, a node template management module, a cluster management module, and a node manager. By using the communication key information of the Kubernetes cluster management module and the Pod configuration information of the nodes, the system enables rapid deployment and management of Jenkins nodes.

Benefits of technology

It enables convenient, fast, and unified management of multiple Jenkins hosts and their nodes, and supports easy creation and management in different Kubernetes clusters.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The present invention provides a Jenkins cluster management device based on Kubernetes. By setting a Jenkins host management module, a Jenkins node template management module, a Kubernets cluster management module and a Jenkins node manager, the Kubernets cluster management module is used to pre-declare communication key information and Kubernets Pod configuration information of the Jenkins node, and the Kubernets virtual container technology is used to enable operation and maintenance personnel to conveniently, quickly and uniformly manage different Jenkins hosts, and conveniently create and manage Jenkins nodes in different Kubernets clusters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software, and in particular to a Jenkins cluster management device based on Kubernetes. Background Art

[0002] Kubernetes is an open source platform for managing containerized applications on multiple hosts in a cloud platform. Kubernetes makes the deployment of containerized applications simple and efficient, and provides a mechanism for application deployment, planning, updating, and maintenance. A core feature of Kubernetes is that it can manage containers autonomously to ensure that containers in the cloud platform run in the state expected by the user (for example, if the user wants Apache to run all the time, the user does not need to worry about how to do it, Kubernetes will automatically monitor, restart, and create a new one. In short, let Apache always provide services). The administrator can load a microservice and let the planner find the right location. At the same time, Kubernetes also improves the system's tools and humanization, allowing users to easily deploy their own applications.

[0003] Jenkins is an open source software project. It is a continuous integration tool developed based on Java. It is used to monitor continuous and repetitive work. It aims to provide an open and easy-to-use software platform that enables software projects to be continuously integrated. Jenkins agent nodes are "workers" that perform operations requested by the Jenkins controller. The Jenkins controller manages the agents and can manage the tools on the agents. Jenkins agents can be statically allocated or dynamically allocated through systems such as Kubernetes, OpenShift, Amazon EC2, Azure, Google Cloud, IBM Cloud, Oracle Cloud, and other cloud providers.

[0004] Jenkins is combined with Kubernets to run Jenkins nodes in the container of the Kubernets cluster. It can quickly manage node instances according to business needs, which makes automated operation and maintenance and migration very convenient. This is also the architecture solution adopted by more and more practitioners. However, as Devpos work becomes more and more professional, more and more automated work replaces manpower, and the amount of automated business increases, sometimes using only one Jenkins host can no longer meet business needs. How to conveniently, quickly and uniformly manage different Jenkins hosts, and conveniently create and manage Jenkins nodes in different Kubernets clusters, has become an urgent problem to be solved. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] In order to solve the above problems in the prior art, the present invention provides a Jenkins cluster management device based on Kubernetes, which can conveniently, quickly and uniformly manage multiple Jenkins hosts and their nodes in different Kubernetes clusters.

[0007] (II) Technical solution

[0008] In order to achieve the above object, the technical solution adopted by the present invention is:

[0009] A Jenkins cluster management device based on Kubernetes, comprising:

[0010] The Jenkins host management module stores the Jenkins host configuration information and is used to start the Kubernetes Pod template of the Jenkins node template management module.

[0011] The Jenkins node template management module stores the Kubernetes Pod template configuration and is used to manage the Kubernetes Pod template configuration of Jenkins node instances in different working environments.

[0012] The Kubernetes cluster management module stores the Kubernetes cluster communication configuration information and is used to manage the Kubernetes cluster communication configuration information of different regions and cloud computing platforms. It is also used to deploy the Kubernetes Pod template configuration of the Jenkins node in the Jenkins node template management module to the remote Kubernetes cluster and create node instances.

[0013] Jenkins Node Manager is used to view, release and retrieve local nodes of different Jenkins hosts. (III) Beneficial Effects

[0014] The beneficial effects of the present invention are: by setting a Jenkins host management module, a Jenkins node template management module, a Kubernets cluster management module and a Jenkins node manager, using the Kubernets cluster management module to pre-declare communication key information and Kubernets Pod configuration information of the Jenkins node, and then using the Kubernets virtual container technology, operation and maintenance personnel can conveniently, quickly and uniformly manage different Jenkins hosts, and conveniently create and manage Jenkins nodes in different Kubernets clusters. DETAILED DESCRIPTION

[0015] In order to better explain the present invention and facilitate understanding, the present invention is described in detail through specific implementation methods.

[0016] A Jenkins cluster management device based on Kubernetes, comprising:

[0017] The Jenkins host management module stores the Jenkins host configuration information and is used to start the Kubernetes Pod template of the Jenkins node template management module.

[0018] The Jenkins host configuration information includes the host name, host address, login user name and login Token.

[0019] The Jenkins node template management module stores the Kubernetes Pod template configuration and is used to manage the Kubernetes Pod template configuration of Jenkins node instances in different working environments.

[0020] The Kubernetes Pod template configuration includes the template name, template identifier, the cluster to which it belongs, and the template content;

[0021] The template content includes preset environment variables and environment variable value placeholders;

[0022] The preset environment variables include the Jenkins host address environment variable and the Jenkins host communication key environment variable;

[0023] The environment variable placeholder is used in the process of starting the Jenkins node template management module Kubernets Pod template.

[0024] The specific process of the Jenkins host management module starting the Jenkins node template management module Kubernets Pod template is as follows:

[0025] The backend of the Jenkins host management module receives the Jenkins node template management module Kubernets Pod template under the specified Jenkins host and the number of nodes to be created;

[0026] The backend of the Jenkins host management module creates a local Jenkins node object in the Jenkins node manager according to the template content, then calls the node creation interface of the specified Jenkins host, creates a Jenkins node and obtains the node communication key, and then writes the node communication key and the Jenkins host address into the Kubernets Pod template content of the Jenkins node template management module and the node object of the Jenkins node manager through the environment variable placeholder and the placeholder replacement method to obtain the target template, and finally sends the target template and the number of nodes to be created to the Kubernets cluster management module.

[0027] The Kubernetes cluster management module stores the Kubernetes cluster communication configuration information and is used to manage the Kubernetes cluster communication configuration information of different regions and cloud computing platforms. It is also used to deploy the Kubernetes Pod template configuration of the Jenkins node in the Jenkins node template management module to the remote Kubernetes cluster and create node instances.

[0028] The Kubernets cluster communication configuration information includes the cluster name and Kubernets cluster config information.

[0029] The specific process of creating a node instance is as follows:

[0030] Using the Kubernets cluster communication configuration information, the Kubernets Pod template configuration of the Jenkins node is used as a request parameter, the Kubernets deployment interface is called, and a specific node instance is created.

[0031] Jenkins Node Manager, used to view, release and retrieve local nodes of different Jenkins hosts.

[0032] The Jenkins node manager stores the local Jenkins node object created during the process of starting the Jenkins node Kubernets Pod template.

[0033] Also includes:

[0034] Jenkins Node Synchronizer, used to continuously synchronize the real status of remote devices and synchronize to the Jenkins Node Manager

[0035] The Jenkins node synchronizer is a timed, independently running device, and its operation process is as follows:

[0036] Get the local Jenkins node object in the current system, then call the Jenkins host interface to get the running status of the node. If the node is online (busy, idle), get the working status of the node and synchronize it to the local node object.

[0037] If the node is offline, call the instance object corresponding to the Kubernets resource deletion interface, then call the Jenkins host node deletion interface corresponding to the Jenkins host node, and finally delete the local Jenkins node object.

[0038] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention specification, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A Jenkins cluster management device based on Kubernetes, characterized in that: include: The Jenkins host management module stores the Jenkins host configuration information and is used to start the Kubernetes Pod template of the Jenkins node in the Jenkins node template management module; The Jenkins node template management module stores the Kubernetes Pod template configuration and is used to manage the Kubernetes Pod template configuration of Jenkins node instances in different working environments. The Kubernetes cluster management module stores the Kubernetes cluster communication configuration information and is used to manage the Kubernetes cluster communication configuration information of different regions and cloud computing platforms. It is also used to deploy the Kubernetes Pod template configuration of the Jenkins node in the Jenkins node template management module to the remote Kubernetes cluster and create a node instance. Jenkins Node Manager, used to view, release, and retrieve local nodes of different Jenkins hosts; Jenkins Node Synchronizer, used to continuously synchronize the real status of remote devices and synchronize to the Jenkins Node Manager; The specific process of the Jenkins host management module starting the Kubernets Pod template of the Jenkins node in the Jenkins node template management module is as follows: The backend of the Jenkins host management module receives the Kubernets Pod template of the Jenkins node and the number of nodes to be created in the Jenkins node template management module under the specified Jenkins host; The backend of the Jenkins host management module creates a local Jenkins node object in the Jenkins node manager according to the template content, then calls the node creation interface of the specified Jenkins host, creates a Jenkins node and obtains the node communication key, and then writes the node communication key and the Jenkins host address into the Kubernets Pod template content of the Jenkins node in the Jenkins node template management module and the node object of the Jenkins node manager through the environment variable placeholder and uses the placeholder replacement method to obtain the target template, and finally sends the target template and the number of nodes to be created to the Kubernets cluster management module.

2. The Jenkins cluster management device based on Kubernetes according to claim 1, characterized in that: The Jenkins host configuration information includes the host name, host address, login user name and login Token.

3. The Jenkins cluster management device based on Kubernetes according to claim 1, characterized in that: The Kubernetes Pod template configuration includes the template name, template identifier, the cluster to which it belongs, and the template content; The template content includes preset environment variables and environment variable value placeholders; The preset environment variables include the Jenkins host address environment variable and the Jenkins host communication key environment variable; The environment variable placeholder is used in the process of starting the Kubernets Pod template of the Jenkins node in the Jenkins node template management module.

4. The Jenkins cluster management device based on Kubernetes according to claim 1, characterized in that: The Kubernets cluster communication configuration information includes the cluster name and Kubernets cluster config information.

5. The Jenkins cluster management device based on Kubernetes according to claim 1, characterized in that: The specific process of creating a node instance is as follows: Using the Kubernets cluster communication configuration information, the Kubernets Pod template configuration of the Jenkins node is used as a request parameter, the Kubernets deployment interface is called, and a node instance is created.

6. The Jenkins cluster management device based on Kubernetes according to claim 1, characterized in that: The Jenkins node manager stores the local Jenkins node object created during the Kubernets Pod template process of starting the Jenkins node.

7. The Jenkins cluster management device based on Kubernetes according to claim 1, characterized in that: The Jenkins node synchronizer is a timed, independently running device, and its operation process is as follows: Get the local Jenkins node object in the current system, then call the Jenkins host interface to get the running status of the node. If the node is online, get the working status of the node and synchronize it to the local node object. If the node is offline, call the Kubernets resource to delete the instance object corresponding to the interface, then call the Jenkins host node to delete the Jenkins host node corresponding to the interface, and finally delete the local Jenkins node object.

Citation Information

Patent Citations

  • Jenkins-based task construction method and system

    CN111262908A

  • Cloud edge cooperation system and cluster resource control method and device

    CN112925647A