Jenkins CI/CD
This section will introduce how to use KubeVela with existing CI/CD tools such as Jenkins and why.
With a simple integration effort, KubeVela as a universal application delivery control plane can then supercharge existing CI/CD tools with modern application deployment capabilities such as:
- cross-environments promotion;
- service mesh based application rollout/rollback;
- handling deployment dependencies and topology (DAG);
- declare, provision and consume cloud resources alongside with your application;
- … and much more.
Before combining KubeVela and Jenkins, you need to ensure the following environments have already been set up.
- Deploy Jenkins service with Docker support, including related plugins and credentials which will be used to access image repository.
- A git repository with Webhook enabled. Ensure commits to the target branch will trigger the running of the Jenkins pipeline.
- Get Kubernetes for deployment. Install KubeVela and enable its apiserver. Ensure the KubeVela apiserver can be accessed from external environment.
Deploy Jenkins pipeline with the following Groovy script. You can change the git repository address, image address, apiserver address and other environment configurations on demand. Your git repository should contain the and app.yaml
configuration file to tell how to build the target image and which component the application contains.
THe GIT_COMMIT identifier will be replaced by the current git commit id in Jenkins pipeline. You can check the deployment status in Kubernetes through .
In the deployed application, we use the rollout
trait, which enables us to release 2 pods first for canary validation. After validation succeed, remove in application configuration in the rollout
trait. After that, a complete release will be fired. This mechanism greatly improves the security and stability of the releasing process. You can adjust the rollout strategy depending on your scenario.