A Release Order Table for Shipping a VM-Hosted API and a Kubernetes Web Frontend Together
Users don't experience whether two deploy buttons were pressed at the same moment. They experience the combination of web and API versions their browser hits. Lay out the four old/new combinations to decide the deploy order, and find the combination you can safely run overnight if only one side succeeds.
We're adding a "pickup window" to the reservation detail screen. The web frontend runs on Kubernetes and the API lives on two existing VMs. Both frontend and backend are done. So do we just press both deploy buttons at the same time?
A user with the reservation screen open has no way of knowing whether the two buttons were pressed together. What they experience is the combination of web version and API version their browser actually calls. If the web deploy finishes 30 seconds early, or one VM is slow to restart, the combination real customers hit changes even in that short window.
In a mixed-environment release, deploy order is decided not by start time but by which web and API version combinations you can actually meet in production, and which of them are safe.
Which version combinations can production actually hit?
Production can hit four combinations of old and new web and API. In this example, the new API adds pickupWindow to the existing response. The old web frontend has been tested to ignore fields it doesn't know, and the new web frontend needs that value to render the reservation detail. (The service layout is illustrative.)
| Combination you can hit in production | Old API | New API |
|---|---|---|
| Old web | Existing screen works | Existing screen works; new field ignored |
| New web | Detail screen errors, can't read pickup window | New feature works |
Given this table, what do you deploy first?
Deploy the API first. Roll the new API onto one VM and confirm the reservation detail still opens on the old web frontend. After rolling the remaining VM, confirm that each instance returns pickupWindow. Calling once through the load balancer and seeing the value doesn't prove both servers switched. Once that passes, roll the Kubernetes web frontend out incrementally.
How do you back out when only one side succeeds?
If only the web deploy fails, keep the API and roll back just the web side. The new API is compatible with the old web frontend. The other direction needs care. If some users already have the new web frontend and you roll the API back first, you recreate the bottom-left cell of the table. Even if you roll every web pod back, browser tabs that are already open can still be running the new code. Either give the new web frontend a fallback when the field is missing, or keep a compatible API for the users who remain.
A Kubernetes Deployment rollback reverts that Deployment's pod template to a previous revision (Kubernetes docs: Rolling Back a Deployment). An API installed on separate VMs is outside the scope of that command. That's why the two teams' release order table has a column more important than start time: "If only one side succeeds, which combination can we run as-is tonight?" In the table above, the answer is old web plus new API.
If the API side also carries a database change, the table gains a schema axis. For that case, see you rolled the app back, but the DB schema already changed.
- #legacy-deploy
- #kubernetes
- #vm
- #api-compatibility
- #release
- #rollback