Skip to content
tezvyn:

What problem can a breaking API change cause during a rolling update?

Source: geeksforgeeks.orgEasyHow cards are made

What problem can a breaking API change cause during a rolling update?

Tests if you know rolling updates run mixed versions, so breaking API changes crash cross-traffic. Good answer: note old and new pods serve together, watch probes fail, and monitor 5xx spikes. Red flag: claiming Kubernetes isolates versions during rollout.

What's really being asked

This question checks whether you understand that a rolling update is a gradual replacement, not an atomic switch. Kubernetes keeps old pods running while it starts new ones, so both versions coexist behind the same Service for a window of time. The interviewer wants to see if you recognize that breaking API changes create a split-brain scenario where traffic crosses incompatible versions, and whether you know how to observe that failure in practice.

The full answer

First, explain that during a rolling update the ReplicaSet scales up new pods and scales down old pods incrementally, and the Service load balancer sends traffic to any ready pod regardless of version. Second, identify the specific risk: if the new code changes a request payload, response schema, internal gRPC contract, or database format, then an old pod calling a new pod or vice versa will encounter deserialization errors, HTTP 500s, or silent data corruption. Third, describe detection mechanisms in order: failing readiness or startup probes that prevent the new pod from entering the Service endpoint list; application metrics showing a spike in HTTP 5xx or latency; log aggregation catching class cast or schema exceptions; and synthetic canary requests that exercise the API boundary during the rollout. Fourth, mention that the safest fix is backward compatibility, such as additive-only schema changes or dual-write and dual-read patterns, rather than relying on detection alone.

The mistakes people make

A major red flag is claiming that Kubernetes drains all old pods before new ones start, which ignores the core mechanics of a rolling update. Another weak answer is saying you would detect the problem only after the rollout completes by running manual smoke tests, because by then users have already hit errors. Saying that health checks alone prevent the issue is also wrong, because a pod can pass a liveness probe and still serve broken API responses.

What usually comes next

The interviewer may ask how you would prevent this with deployment strategies, so be ready to contrast blue-green and canary releases against a simple rolling update. They might also ask about handling breaking database schema changes during a rollout, or how service meshes like Istio use traffic splitting to avoid cross-version calls.

A concrete example

Imagine a user service running six pods on version 1.0. You deploy version 2.0 which renames a JSON field from userName to displayName. Kubernetes starts two new pods while four old pods remain. A frontend pod sends a request to the user Service, the load balancer routes it to a 2.0 pod, but the frontend still expects userName and crashes on null. You detect this because the new pods readiness probes pass, yet your metrics dashboard shows a 400 percent jump in NullPointerException logs and HTTP 500 responses from the frontend tier exactly when the new pods join the endpoint slice.

Interview question

Why does a breaking API change risk errors during a Kubernetes rolling update?

  • a.Old and new pods coexist behind the Service, so traffic crosses incompatible versions.Correct
  • b.Kubernetes terminates all old pods before any new pods start serving traffic.
  • c.Readiness probes always detect breaking API changes and block new pods from the Service.
  • d.The Deployment controller automatically isolates traffic between different pod versions.
Why?

During a rolling update, old and new pods run simultaneously behind the same Service, so a breaking API change causes cross-traffic failures like HTTP 500s. It is wrong to think Kubernetes drains all old pods first, because the rollout intentionally scales new pods up while old pods are still running and receiving traffic.

Just read this? Test yourself on what you have been reading.

Read the original → geeksforgeeks.org

You just looked this up. Could you explain it out loud?

That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Open roles that interview on kubernetes — each one lists the topics its interview covers.

See open roles