Canary Deployments by Replica Count
A canary needs no mesh and no ingress weighting: put both versions behind one Service with one shared label, and the traffic split is the ratio of ready Pods. It is the cheapest possible progressive delivery and it has one honest limitation, measured here - the split is approximate, and at low request counts it is not close to the ratio you set.
Application Deployment Guide 18 of 44 Intermediate
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 15 min
kube-proxy picks a backend per connection, effectively at random with equal weight per endpoint. Over a very large number of requests the split approaches the replica ratio; over forty it does not, as the measurement below shows.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a fraction of traffic should reach a new version, with no service mesh and no ingress weighting. This matters because two Deployments behind one Service split by replica count - and the split is approximate, which is something you can measure rather than assume.
- putting two Deployments behind one Service using a shared label
- counting the actual split across forty requests from inside the cluster
- promoting the canary with two scale commands and nothing else
Before you start
- A cluster with room for ten small Pods.
- The session creates namespace
ckad-canarywith Deploymentstable(9 replicas, servingv1), Deploymentcanary(1 replica, servingv2), one Service selecting both, and a client Pod.
-
One Service, two Deployments, one shared label
-
Count the split
-
Promote by scaling