Related technology Docker + Rancher + SwarmKit + Jenkins
Background:
In the context of large-scale promotion of micro-services, a large number of applications are sharded with finer granularity. It brings complex and high cost for the deployment of a large number of application services and the allocation and use of machine resources. Under the tide of Serverless, the containerization of traditional applications has been transformed into a standard entry threshold.
Goal:
- Increase machine utilization.
- Horizontal expansion capabilities. Machine resource usage can be managed by application service segmentation and quotas can be adjusted quickly (memory, CPU, network, disk)
- Portability. Encapsulate application and dependency on environment configuration.
- Application lifecycle management capabilities. Automated deployment, multi-instance deployment, rollback, etc. It can be refined, automated, and perceptive.
Implementation scheme:
Dokcer is containerized
Docker: is an open source application container engine that allows developers to package their applications and dependencies into a portable container and then distribute them to any popular Linux machine, as well as virtualization.
Docker SwarmKit does container choreography
Docker SwarmKit:Docker SwarmKit is an open-source Docker cluster management and choreography tool. Consistency and task scheduling based on Raft algorithm, it is more lightweight than K8S and has lower deployment cost. Provides consistency between cluster management and service scheduling.
Rancher does container hosting
Rancher is an open source enterprise container management platform. Provides full stack containerization management
Dokcer plugin for image packaging
Dokcer plugin: The Docker plugin provides the ability for the MAVEN build life cycle to build, package, and PUSH an image to a private server
Jenkins and Rancher plug-in for container instruction delivery
Jenkins Jenkins-Rancher plug-in delivers service upgrade instructions to Rancher after application construction through the Rancher plug-in in Jenkins
An overview of
The entire application container process is as follows.
- Jenkins initiated the application build order.
- Maven performs the image generation of the Docker plug-in in the application
- Maven performs the application’s Docker plugin Push image to private server
- Jenkins sends commands to Rancher via the Rancher plugin to upgrade the service
- Rancher upgrades the service through hosted Docker SwarmKit. Pull image from private server and restart container.
insufficient
- Rancher 1.6 currently in use does not support specifying parameters other than the Rancher management platform for The Docker container run. Parameters such as cpus and oom-kill-disable are not supported
A signature
Rice cake mother — Zi Xi