When deploying a new release into production, implementing the Canary Deployment strategy is one of the best approaches for gradually rolling out new features to users without risking downtime or disruptions in a production environment. However, setting it up manually comes with significant challenges, such as setting up traffic routing, rollback complexity, resource overhead, and RBAC considerations.
Why struggle with manual configurations when you can automate everything? In this blog, we’ll see how to simplify Canary Deployments in Kubernetes using the Devtron platform, eliminating these complexities so you can deploy features faster and more safely.
Pre-requisites for Performing Canary Deployment
Before starting with the tutorial, let’s look at all the things you’ll require to follow along:
- An Application on GitHub
- Devtron is installed and configured on your machine. If you haven’t installed Devtron, feel free to check out the well-managed installation documentation and join the Discord community for help!
- Setting up the Global Configuration before deploying an app.
- Ingress Controller is deployed on your cluster.
Canary Deployments on Kubernetes using Devtron
Let’s dive into implementing Canary Deployments in Kubernetes with Devtron! But before we begin, ensure you’ve met the necessary prerequisites to set up a smooth deployment.
Step 1: Create a Devtron Application
Creating an application in Devtron is quick and simple. Just head to the dashboard, select Create New → Custom App, fill in the required details as shown below, and hit Create App to get started.

Check out the documentation to learn more about the application creation process.
Step 2: Add Repository
Upon redirection to the Configuration tab, the next step is to set up a few essential settings. The first task is to specify the Git Repository where your application resides.

Step 3: Setting up Build Configuration
Next, we need to set up a Build Configuration to generate the container image for your application.

Step 4: Deployment Configurations
Now, you will be redirected to the Base Configuration page, where you need to change the Chart type from Deployment → Rollout Deployment. The Rollout Deployment chart provides us with advanced deployment configurations such as Blue/Green and Canary deployments.

Step 5: Enable Ingress in the Rollout Deployment Chart
Once you've selected the Rollout Deployment chart, search for Ingress in the template, enable it, and apply the necessary changes as shown below.

- Set the className to nginx.
- Enable the configuration by changing enabled from false to true.
- Specify the hostname where your application will be hosted.
- Define the application’s path.
Then click Save & Next.
Step 6: Create Build and Deployment Pipelines
Next, set up your build and deployment pipelines, then choose the Canary Deployment strategy from the dropdown in your deployment pipeline configuration, as shown below.

Please check the documentation to learn more about the pipeline configurations.
After creating the deployment pipeline, the workflow editor would look like this:

Step 7: Trigger the Build and Deployment Pipelines
Once all the configurations are complete, all that’s left is to trigger the build stage and subsequently the deployment.
From the Build & Deploy tab, select the Git material to trigger the build stage. The pipeline will build the container image.
Once the build stage is complete, you can trigger the deployment for the built artifact.

After triggering the deployment, Devtron automatically pushes your application to the cluster, applying the configuration settings you've set up earlier.
Once the application is deployed, you will be able to see the application health, deployment status, security vulnerabilities, the Kubernetes resources of the application, and more.

Step 8: Override your Environment
After deploying the application, navigate to the Environment Overrides section under the Configurations tab. Modify the settings here so that when new replicas are created, you can observe how traffic is gradually shifted during the canary rollout in the App Details section.
Click on devtron-demo to expand the deployment template configuration. Next, click on + Create Override to enable editing. You can now modify the configuration as needed. In our case, we updated the number of replicas and adjusted the CPU and memory settings. Once done, click Save changes to apply the updates.

Step 9: Deploy the application
Once again, navigate to the Build & Deploy tab, select the image in the Deployment pipeline, and deploy it using the updated deployment configurations.

Once deployed, navigate to the app details to observe traffic distribution between the 'New Pods' and 'Old Pods' as part of the canary deployment.

Congratulations! You've just seen how easy it is to configure and implement Canary Deployments using Devtron.
Conclusion
Here's a quick recap of what we covered:
- Creating and configuring a Devtron application
- Setting up Git repositories and build pipelines
- Choosing the Rollout Deployment chart to enable the Canary strategy
- Configuring Ingress for traffic routing
- Building, deploying, and customizing environment overrides
- Observing the traffic split between New Pods and Old Pods during the canary rollout
FAQ
What is a canary deployment in Kubernetes?
A canary deployment in Kubernetes is a progressive delivery strategy where a new version of an application is gradually rolled out to a small subset of users before a full deployment.
What is the difference between blue green and canary Kubernetes?
Blue-green switches traffic to the new version all at once, while canary slowly shifts traffic, allowing safer, gradual rollouts.
How does Devtron simplify canary deployments in Kubernetes?
Devtron provides a visual interface and built-in automation to configure, monitor, and manage canary deployments, making the process seamless and less error-prone.
Can I control traffic split during canary deployment in Devtron?
Yes, Devtron allows you to define custom traffic splits between the stable and canary versions, enabling precise rollout control.
Does Devtron support automatic rollback in canary deployments?
Yes, Devtron supports rollback mechanisms. If the canary release shows issues, you can easily revert to the stable version without any disruption.