Orchestration and rollout
What you need to know
An orchestrator replaces and scales application instances, but a rollout is safe only when the application is ready to receive traffic, can finish in-flight work, and remains compatible with its data and clients.
By the end, you can: define readiness and rollback; document cleanup.
Rolling-update fragment inside Deployment spec
replicas: 2strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 0 maxSurge: 1progressDeadlineSeconds: 180Expected behavior: The controller may add one extra Pod during rollout. It still needs scheduling capacity and successful readiness.
How it works
Kubernetes Deployments manage replica sets and rolling updates. A Service selects eligible Pods; a readiness probe helps decide which endpoints can receive traffic. Liveness failure can cause a restart, so do not make a transient database outage a universal liveness failure. A startup probe can allow a slow initial startup before other probes run. Use a small health endpoint for process checks and a bounded readiness check for essential dependencies. maxUnavailable: 0 with maxSurge: 1 can keep old capacity while adding one new Pod, subject to resource capacity and health. Termination grace must cover the selected shutdown/drain behavior; verify actual in-flight requests rather than assuming no interruptions. A progress deadline reports stalled rollout progress through a Deployment status condition; it does not automatically roll back the application. An authorized operator or release controller must decide the next step. Roll back to a known compatible artifact; reverting a Deployment does not revert database changes. Use explicit namespace, ClusterIP Service and synthetic resources only.
Minimal app/api/ready/route.ts for a dependency-free fixture
export const dynamic='force-dynamic';export function GET(){return Response.json({ready:true},{headers:{'Cache-Control':'no-store'}});}Expected behavior: Only proves this simple dependency-free handler can respond. A real application must check bounded critical dependencies and return 503 when not ready.
Common mistake
A Pod can be Running but not ready. A successful readiness response is not a full end-to-end authorization or database integrity test.
Practice and verification
Use the staged Deployment and Service templates to design a failed rollout, a compatible rollback and a cleanup inventory. Include a long-running request during a replacement; record what a real test must observe.
Scope: Proposed Next.js 16.x / React 19, App Router with Cache Components disabled unless noted. Framework and browser examples are staged, not executed. Hypothetical costs are not actual provider rates.