The invention relates to the technical field of
continuous integration and
continuous delivery, and discloses a Jenkins
continuous integration method based on Kubernetes. According to the method, a Jenkins
server is deployed in a Kubernetes cluster to serve as a control plane, a construction environment is created through a preset multi-container Pod template, and a Pod containing a plurality of containers is dynamically created based on the Pod template, so that each container executes different construction tasks. Containers in the Pod realize
collaboration through sharing a network
namespace and a storage volume, and a Jenkins
server monitors task execution states of the containers in the Pod and performs dynamic scheduling according to task priorities and cluster load states. And after the task is completed, automatically destroying the Pod and releasing cluster resources. According to the method and the device, dynamic expansion and contraction of a construction environment and efficient parallel execution of tasks are realized, the problem that a traditional Jenkins static
resource pool is difficult to deal with load changes is solved, the
resource utilization rate is improved, the expandability of the
system is enhanced, and an efficient and reliable solution is provided for an enterprise-level
continuous integration system.