Q: How do you do a canary deployment on Kubernetes without a service mesh?
Use two Deployments with the same Service label selector but different replica counts:
Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In our production Kubernetes clusters running microservices on EKS/AKS, this was a classic operational challenge. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix."
Initial Diagnostics & Root Cause Analysis
Use two Deployments with the same Service label selector but different replica counts:
app-stable: 9 replicas, version v1app-canary: 1 replica, version v2
Remediation & Permanent Safeguards
The Service routes to all pods matching app: myapp. Traffic split ≈ 90%/10% based on replica ratio. Pros: simple, no extra tools. Cons: rough traffic split (not exact percentage), all users might hit canary randomly. For precise splits, use Argo Rollouts or Flagger.
- app-stable: 9 replicas, version v1
- app-canary: 1 replica, version v2
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
-
Configuring Service selector labels that mismatch underlying Pod manifest metadata when configuring canary deployment Kubernetes
A typo in
spec.selectorcauses the Service endpoints list (kubectl get endpoints) to remain empty, resulting in503 Service Unavailableor timeouts. -
Omitting explicit ingressClassName specifications when running multiple ingress controllers when configuring canary deployment Kubernetes
Without an explicit
ingressClassName, ingress resources are either ignored or picked up unpredictably by competing controllers. -
Depleting worker node subnet IP address allocations under VPC CNI or Azure CNI when configuring canary deployment Kubernetes
Direct VPC pod networking allocates real subnet IPs; failing to monitor IP pools causes new pods to stay stuck indefinitely in
ContainerCreating. - Attempting network triage without inspecting kubectl describe service and EndpointSlice resources when configuring canary deployment Kubernetes Verifying EndpointSlice population immediately determines whether a connectivity failure is caused by pod labeling, readiness probes, or routing.