- Lab
- A Cloud Guru
Canary Deployments with Kubernetes and Jenkins
Canary deployments are a great way to achieve greater stability when doing continuous deployments. By testing changes in a live environment with real users, you can deploy with greater confidence while minimizing the impact of bugs and issues on your users. In this learning activity, you will implement a simple canary deployment to a Kubernetes Cluster as part of a Jenkins Pipeline.
Path Info
Table of Contents
-
Challenge
Set up the project and Jenkins and run an initial deployment.
To this, you will need to perform the following steps:
- Fork the sample source code repo: https://github.com/ACloudGuru-Resources/cicd-pipeline-train-schedule-canary.
- Change the
DOCKER_IMAGE_NAME
at the top of the Jenkinsfile to use your docker hub username instead ofwillbla
. - Log in to the Jenkins server.
- Set up the credentials in Jenkins (GitHub access token, Docker Hub, and Kubeconfig).
- Create a project and build it from your fork.
-
Challenge
Add a canary stage to the pipeline and run a successful deployment.
To complete this, you will need to do the following:
- Create a deployment template for the canary deployment with a "canary" track.
- Add a canary stage to the Jenkinsfile to perform the canary deployment.
- Modify the production deploy stage to clean up the canary deployment after production deployment is approved.
- Execute the deployment in Jenkins.
Don't hesitate to Refer to the
example-solution
branch of the sample source code repo for an example of how to do this!
What's a lab?
Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.
Provided environment for hands-on practice
We will provide the credentials and environment necessary for you to practice right within your browser.
Guided walkthrough
Follow along with the author’s guided walkthrough and build something new in your provided environment!
Did you know?
On average, you retain 75% more of your learning if you get time for practice.