Cover illustration for “Canary Deployments in Kubernetes Without a Service Mesh”

Essay CI/CD Pipelines

Canary Deployments in Kubernetes Without a Service Mesh

Replica ratios, Gateway API weights, and controllers each fit different teams.

Replica ratios provide a workable start, Gateway API weights add precise routing, and progressive delivery controllers automate the decision. The right choice depends on the infrastructure the team actually has.

Why standard Kubernetes Deployments cannot do canary releases on their own

A standard Kubernetes Deployment supports only RollingUpdate and Recreate. Neither strategy controls a weighted canary traffic split. RollingUpdate replaces pods gradually, but production traffic still reaches whichever pods are running. It cannot hold exposure at a fixed percentage while both versions coexist. Changing the rollout settings does not close that gap.

Teams must therefore choose between simpler releases that expose more traffic to the new version and a separate way to control traffic. For teams without a platform function, the extra infrastructure can make genuine canaries seem out of reach. But the mechanisms come in manageable tiers, namely replica-ratio splitting, Ingress annotations, and Gateway API weights. Progressive delivery controllers such as Argo Rollouts and Flagger form a fourth layer, automating the promote-or-abort decision.

Replica-ratio splitting: the zero-dependency starting point and its hard limits

Two Deployments behind one Service provide the simplest starting point. The stable and canary Deployments share a label that the Service selector matches, so kube-proxy distributes connections across both sets of endpoints. The canary receives roughly its proportional share of requests. To raise that share, teams must change the replica ratio. To reach 50%, the stable and canary replica counts match.

Once the canary passes validation, the stable Deployment’s image changes to v2, its replica count returns to full capacity, and the canary scales to zero. For rollback, the canary scales to zero while stable takes the traffic. This makes the approach useful for internal services where approximate exposure is acceptable, or for teams proving their monitoring before adding routing infrastructure.

The approximation has hard limits, however. Kube-proxy chooses an endpoint for each connection rather than for each request, so keep-alive and long-lived HTTP/2 connections can skew the split that teams see. Users also have no guaranteed track assignment and can encounter different versions across requests. Teams also have to change pod counts to change traffic shares. The signal to move on is a need for finer splits, internal-tester or beta-cohort targeting, or split accuracy that does not depend on replica count.

What NGINX Ingress canary annotations could do, and why Gateway API has replaced them

NGINX Ingress annotations separated traffic control from replica counts. A second Ingress object pointed to the canary Service, with nginx.ingress.kubernetes.io/canary set to "true" and additional annotations for weights, headers, or cookies. The controller merged the two Ingress objects into one upstream routing rule. Teams could therefore keep enough pods running for capacity while exposing only a small share of traffic to the canary.

Matching rules also made targeted testing practical. Header matching came first, then cookie matching, then weight. Internal testers could use a header to reach the canary while general traffic followed the weighted split. This was a useful, widely adopted mesh-free approach.

The retirement changes the decision for teams using it. Kubernetes retired Ingress NGINX in March 2026, ending releases, bug fixes, security patches, and other updates. Existing annotation-based workflows therefore depend on an unpatched controller, with growing exposure to security vulnerabilities. Teams should migrate the routing mechanism to Gateway API while preserving the canary process those annotations enabled.

Gateway API HTTPRoute weights: how precise traffic splitting works without a service mesh

Gateway API makes traffic weights explicit in an HTTPRoute. Stable and canary each get a Service, and the route references both through backendRefs with weights such as 95 for stable and 5 for canary. Advancing the rollout means patching those weights. Routing and capacity become separate controls. The data plane applies the split per request, avoiding the connection-pinning problem that undermines replica ratios under HTTP/2 and keep-alive.

One HTTPRoute rule can match the X-Canary header with the value true and send those requests entirely to canary. A second rule applies the weighted split to general traffic. Internal testers can validate the version before the public split opens. Request mirroring offers another preliminary check by copying live traffic to canary and discarding its responses.

The API also separates the routing pattern from the implementation. Envoy Gateway, Istio, Cilium, NGINX Gateway Fabric, Traefik, and Kong implement HTTPRoute conformance, so the pattern does not bind a team to one data plane. A mesh is not required for this routing. But Gateway API does not decide whether a release is healthy, analyze metrics automatically, or sequence promotion steps. Those jobs belong to a progressive delivery controller.

Argo Rollouts and Flagger: automating the promote-or-abort decision

Argo Rollouts and Flagger add the same core loop, shifting traffic, querying metrics, comparing results against thresholds, and either advancing or returning traffic to stable. Without that loop, someone must watch the release and make each decision.

Argo Rollouts replaces the Deployment object with a Rollout custom resource and defines explicit traffic steps with configurable pauses. A pause can require manual approval or a passing AnalysisRun. It works with Argo CD, which suits teams that want close control over each step. Its basic canary mode can also automate replica-ratio rollouts before a team adds traffic-shaping infrastructure.

Flagger instead works beside a normal Deployment and uses metric analysis to decide when to move ahead. It needs fewer changes to manifests and works closely with Flux CD. That makes it a natural choice for teams seeking autonomous promotion with less configuration. Both tools belong to project families with graduated status at a cloud-native software foundation, Argo and Flux respectively. Neither workflow is inherently the right one for every team.

A 527-deploy retrospective comparing Argo Rollouts 1.7 and Flagger 1.29 illustrates the trade-off. Argo had higher canary success for stateless workloads and faster mean rollback, while Flagger needed less metric configuration per deploy. Existing monitoring can also shape the choice because Argo supports providers including Prometheus, Datadog, New Relic, and CloudWatch, plus Kubernetes jobs and webhooks. Neither controller requires a service mesh for core canary routing and automated rollback.

Teams must therefore choose between simpler releases that expose more traffic to the new version and a separate way to control traffic.

What to actually measure during a canary window

The observability gap is where canary safety breaks down. A traffic split can work perfectly while the release quietly degrades. Error rate catches crashes and 5xx responses, but it can miss a latency regression, a client rendering problem, or a failed business task.

Before the first canary, teams should instrument both tracks for 5xx rate and error ratio, p95 and p99 latency, pod restarts, and OOMKilled events. High-risk changes also need business signals such as checkout success or queue lag. Metrics should include the track label or Rollouts pod-template-hash so dashboards can separate the versions. The useful comparison is canary against stable during the same window. A traffic spike can raise latency on both versions without implicating the new release.

MLflow’s canary guidance warns that healthy error rates and latency can conceal logically inferior model outputs. Output quality scores, user feedback signals, and task completion rates therefore belong in the first canary stage. Detecting poor output while exposure is small is the point of the exercise.

Specific constraints that change the calculus: stateful services, GPU workloads, and low-traffic systems

Stateless, high-traffic services are the easiest fit for canaries. Stateful services need more care because session-bound users can encounter inconsistencies when requests switch versions. Header- or cookie-based matching can pin a user to one track for the rollout. Database compatibility creates a separate hazard. If canary writes data that stable cannot read, rollback can damage data, so migrations should be backward-compatible and ship separately from application changes.

GPU inference changes the economics of running both versions. GPU-served LLMs on A100s can cost $18–$36 per hour, and keeping stable and canary running together can double that cost during the rollout. Spot or preemptible instances can reduce the cost of canary GPU capacity. Interruption is tolerable here because losing the canary returns the release to the stable track.

A small share of an already quiet service may not produce enough requests for meaningful comparisons. In that case, blue-green can be the better fit, offering an instant cutover and rollback. Canary deployment is a workload choice.

Feature flags as an application-layer alternative for teams not yet running Kubernetes

Feature flags provide canary logic without Kubernetes infrastructure. The application hashes a user ID against a flag key and assigns that user consistently to one code path. That consistency is a real advantage over untargeted request- or connection-based splitting. The same user sees stable or canary for the whole rollout, which makes behavioral analysis and A/B-style comparisons cleaner. No ingress controller or Gateway API implementation is needed.

A flag does not isolate a new binary’s memory leak, OOMKilled events, or latency regressions that occur regardless of the selected code path. Infrastructure splitting exposes the new binary to production load while limiting its reach. Teams can therefore use Gateway API weights or a rollout controller for infrastructure validation and flags for user cohorts and business analysis. For teams not yet on Kubernetes, flags remain a legitimate starting point without adopting a cluster.

Choosing the right mechanism for the infrastructure maturity your team actually has

Diagram: Four Tiers of Canary Traffic Control. Visualizes: Show four progressive tiers of canary traffic-splitting mechanism, ordered from simplest to most capable: (1) Replica-ratio splitting — zero dependencies, approximate split tied to pod…

The simplest mechanism that meets current requirements is the right one. Replica-ratio splitting fits teams with only the cloud provider’s default load balancer, internal services that tolerate per-connection approximation, and teams still establishing canary observability. Gateway API is the next step when replica counts cannot give teams the split they want, when they need an accurate split with HTTP/2, or when internal testers need targeted routing. It is also the migration path away from retired Ingress NGINX setups. None of those needs automatically calls for a service mesh.

Controllers become useful when manual promotion slows deployment or compliance requires an auditable automated rollback record. Argo Rollouts fits explicit step control and existing Argo CD workflows, while Flagger fits autonomous advancement and Flux workflows. Feature flags meet a different need for consistent user cohorts, and teams can use them without Kubernetes. These choices need not arrive together. Each should fill a specific need for more precise routing, automation, or evidence about a release.

Implementation effort should match deployment frequency and service risk. Engineering labor can outweigh the cost of a small canary, especially when the work includes routing, metric analysis, and cluster operations. Porter is one option for teams that want replica-based canaries without hand-writing Deployment pairs and scaling steps, deploying Kubernetes-based apps into their own AWS, GCP, or Azure account. It automates the surrounding CI/CD so that the starting point does not require the same manual configuration work.

A team starting with replica ratios today and adding HTTPRoute weights next quarter is making defensible progress. Automated promotion can follow when the monitoring and workflow justify it. That progression matches infrastructure maturity without requiring a service mesh at any stage.

Tomáš Dvořáček

← Back to Cluster Without Ops