Continuously build and publish applications to Kubernetes clusters using Jenkins

This article has been archived in the [Best Practices - Continuous Build and Release with Jenkins] chapter in the kubernetes -handbook, and everything is stable and accurate in the kubernetes-handbook.

Our Jenkins based CI/CD process is shown below.

Jenkins-based continuous integration and release

Flow Description

App build and release process instructions.

  1. When users submit code to Gitlab, the code must contain Dockerfile;
  2. Submit the code to the remote repository;
  3. Users need to fill in the git warehouse address and branch, service type, service name, number of resources, number of instances, etc. when publishing the application, and trigger Jenkins to automatically build after confirmation;
  4. The CI pipeline of Jenkins automatically compiles the code and packages it into a docker image and pushes it to the Harbor image warehouse;
  5. Jenkins' CI pipeline includes custom scripts that replace variables with user-input options based on our prepared kubernetes YAML template;
  6. Generate the kubernetes YAML configuration file for the application;
  7. Update the configuration of the Ingress, and add a routing information to the configuration file of the ingress according to the name of the newly deployed application
  8. Update PowerDNS, insert a DNS record into it, the IP address is the IP address of the edge node. For edge nodes, please refer to the [Best Practices - Edge Node Configuration] chapter in the kubernetes-handbook ;
  9. Jenkins calls the kubernetes API and deploys the application to the kubernetes cluster.

For application updates, rolling upgrades, and grayscale releases, please pay attention to the follow-up articles in Jimmy Song's Blog or pay attention to the updates of kubernetes-handbook .

 

http://blog.csdn.net/ganglia/article/details/73826599

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326206789&siteId=291194637