This tutorial walks you through deploying a canary release in Kubernetes. A canary deployment allows you to safely test a new application version with a small portion of production traffic before rolling it out completely. This approach helps minimize risk and enables rapid feedback from real users.
For an overview of canary deployments, see Canary deployments in the Managing Workloads concept page.
Objectives Deploy a stable version of an application Deploy a canary version alongside the stable version Route traffic to both versions using a Service Monitor the canary deployment Complete the rollout by scaling the canary and removing the stable version Before you beginYou need to have a Kubernetes cluster, and the kubectl command-line tool must be configured to communicate with your cluster. It is recommended to run this tutorial on a cluster with at least two nodes that are not acting as control plane hosts. If you do not already have a cluster, you can create one by using minikube or you can use one of these Kubernetes playgrounds:

kubernetes.io
Top comments (1)
Canary deployments look clean on paper but the devil's in the observability setup. A few things that bit us:
Traffic splitting ≠ user splitting — sticky sessions or cookie-based affinity means one "canary user" might hit v2 for 5 minutes then flip to v1 on refresh. We learned to route by
user_id % 100at the gateway layer, not LB level.Metrics window too short — 5-minute windows miss slow leaks (memory, connection pools). Run canaries for hours with automated rollback on p99 latency + error rate + custom business metrics (checkout completion, not just HTTP 5xx).
Shadow traffic first — mirror 100% of prod traffic to canary without serving responses. Catches serialization bugs, DB schema drift, cache misses before real users feel it. Saved us twice last quarter.
The rollback trap — if your rollback takes 3 minutes, that's 3 minutes of degraded experience. Keep previous replica set warm (scaled to 10%) so flip-back is near-instant.
One we still argue about: feature flags vs. canary for frontend. Flags let you kill a feature instantly; canaries give you gradual confidence. We do both — flag inside canary so we can kill the feature without rolling back the whole deploy.
What's your rollback SLA? — found it via LabAgent, site: labagent .tech