Knowledge is Power

Sitewide Search

Search Bare Metal Cyber

Search exact control and technique identifiers, Cyber Wiki articles, framework records, playbooks, books, podcasts, Academy courses, individual lessons, and BMC Cyber Challenge activities.

Complete course · Deployment, Observability and Recovery · S01E72

Replace a service without dropping all capacity

A grocery ordering service updates twelve application instances during a busy evening. The replacement software starts successfully, but customers cannot place orders because too many old instances were taken out of service before their replacements were ready. This episode inve…

CompTIA AutoOps+ Transcript available February 22, 2026
Lesson72

Listen Now

Lesson Focus

What this lesson covers

A grocery ordering service updates twelve application instances during a busy evening. The replacement software starts successfully, but customers cannot place orders because too many old instances were taken out of service before their replacements were ready. This episode investigates how a rolling deployment can preserve availability and why the label itself offers no guarantee. You'll learn how replacement batch size, temporarily added capacity, startup time, health signals, and the ability to finish existing requests influence what shoppers experience as a service is exchanged beneath them.

Using the interrupted checkout as a practical case, the lesson distinguishes readiness from merely running, explains graceful termination, and traces how retries and insufficient headroom can amplify an outage. It also covers mixed-version compatibility, background workers that may receive messages again, failure conditions that should pause a rollout, and how to rehearse the change under realistic load. You'll finish able to explain when rolling replacement is a sensible approach, what evidence should govern each batch, and why a successful deployment status is narrower than a successful customer transaction. This episode is produced by baremetalcyber.com.

Companion Books

Reinforce this lesson with the course books.

Use the study guide to organize the ideas from the audio lesson, then use the flashcards book for active recall and rapid review.

Read the transcript2,563 words · about 13 minutes

At five thirty on a Friday afternoon, an online grocery service starts an application update that its operations team expects customers to barely notice. Twelve identical service instances handle orders and pickup reservations. The deployment job is supposed to replace them gradually. Instead, each instance receives a shutdown request almost at once. New requests begin waiting, shoppers see failed checkouts, and pickup slots briefly appear unavailable even though the stores are still taking orders. The new software is healthy when it eventually starts. The outage came from how the replacement was carried out.

This is the basic problem a rolling deployment is intended to prevent. Rather than prepare an entirely separate full-sized environment and switch users to it, the delivery system replaces a running group of service instances in controlled batches. Old and new instances may serve work at the same time during the transition. The system can maintain availability if enough healthy capacity remains, the replacement instances become ready before they are relied upon, and the old instances finish or transfer their existing work appropriately. None of those conditions happens automatically just because the deployment is called rolling.

The grocery team had verified the new application build and approved its release. The deployment pipeline had permission to update the production service. Those are necessary controls, but neither determines how many instances can safely be unavailable at one time. The team trusted a default update behavior that had worked at quieter times. On this busy evening, the orchestrator took the old instances out of service more quickly than their replacements could become ready. The business experienced a sudden capacity shortage even though the software candidate itself was valid.

A rolling deployment is easier to understand when you think about a store with several checkout lanes. If every cashier closes at once for a shift change, shoppers cannot pay until the new cashiers are ready. Closing a few lanes while the others stay open may work, provided the remaining lanes have enough staff for the line. Opening replacement lanes before closing old ones works better, but requires space and people. The same tradeoff appears in software. The organization chooses how much temporary reduction in capacity it can tolerate and whether it can run additional instances during the exchange.

For optional review, bring the checkout-lane capacity problem to the Bare Metal Cyber AutoOps+ Study Guide. Picture a service with several replicas, a predictable burst of customer demand, and replacement instances that take time to warm up. Ask whether the deployment should permit any loss of capacity, how much temporary extra capacity is available, and what the team would monitor before changing the next group. The goal is to understand the operational budget behind the update, without needing to memorize a configuration file.

The grocery service processes two kinds of work. Its web-facing application accepts shopping carts and reserves pickup windows. Separate workers send confirmed orders to stores. The failure begins in the web-facing group, where request routing should avoid instances that are stopping. Some instances still have requests in progress as they receive termination signals. Others have already stopped accepting new work. If all of them become unavailable together, the load balancer has nowhere healthy to send fresh customers. Even a perfect new application cannot help until at least one replacement is ready and accepting traffic.

The team's first investigation separates a failure of software behavior from a failure of rollout orchestration. Did the new instances crash when they started? Did they fail a required health check? Were there enough machines to create replacement capacity? Did the routing system remove the old instances before new ones were available? Those possibilities lead to different repairs. Rebuilding the application would not fix a controller that replaced too many instances simultaneously. Increasing the number of retries from the customers' browsers could increase load on a service that was already short of capacity.

One control establishes the amount of unavailability the deployment can permit while replacing instances. The team might require that nearly all of its normal capacity remain available throughout the change. Another control limits how many extra instances can exist above the normal target during the transition. In Kubernetes, these ideas are commonly represented by maximum unavailable and maximum surge settings. The exact values depend on the service's size, resource limits, and demand. A plan that permits a quarter of the instances to be unavailable may be too risky if the remaining instances were already running near their capacity limit.

The presence of twelve instances does not mean all twelve have spare room for the same workload. Suppose most are busy with normal pickup traffic. If several stop at once, the others must absorb new customers and unfinished requests. Response times may rise even before errors appear. Once those responses slow, clients might retry, creating additional demand. The system can enter a cycle in which capacity falls, requests accumulate, and repeated work makes recovery harder. A safe batch size is therefore based on operating headroom and failure consequences, not on the comfort of seeing many replicas in a configuration.

Extra capacity can help, but it has limits too. The deployment may be able to start a new instance before removing an old one, temporarily increasing the number of instances. That reduces the period during which the service runs below its intended size. Yet the infrastructure must have enough processing power, memory, network capacity, and quota to host the extra instances. A plan that expects new capacity but cannot provision it may stall. An organization should understand whether its capacity is genuinely available, or whether the rollout simply hopes an autoscaling system will react quickly enough.

The grocery application also takes time to become ready after starting. It loads a catalog cache, establishes connections to the inventory service, and waits for initial price information. A process can be running without being able to serve a real checkout. A startup check may establish that it has finished its initialization. A readiness check should establish whether it is prepared to receive traffic. A liveness check concerns whether the process is still functioning or needs intervention. Those checks answer different questions. If the router sends customers to a process solely because it exists, it may direct requests to a service that has not finished warming up.

An overly optimistic readiness signal can be as harmful as a missing one. Imagine that the new grocery instance reports ready as soon as its web listener opens, before the inventory connection has been established. The load balancer immediately starts sending customers to it, and orders fail because the instance cannot confirm available items. The deployment controller may count the instance as available and proceed to remove more old capacity. A misleading readiness check therefore turns a local startup problem into a broader rollout failure. The check should reflect the work the service must be able to perform, while avoiding heavy tests that themselves destabilize it.

At the other extreme, an unnecessarily strict check can stall a safe deployment. A temporary reporting-service outage might not prevent the grocery checkout from accepting and safely recording orders. If the application refuses to report ready whenever that unrelated report service is slow, it can make the entire checkout pool unavailable for a secondary problem. Health criteria require a reasoned choice about which dependencies are essential to the primary customer workflow and which have acceptable degraded behavior. The team's first task is to understand what a healthy instance means for this service, not to mark every dependency equally critical.

When an old instance is being removed, graceful termination deserves the same care as startup. The routing layer should stop assigning it new work, and the application should have an opportunity to finish or safely hand off requests already underway. A grocery shopper may be in the final step of reserving a pickup window. Killing the instance during that step can leave the customer uncertain whether the reservation succeeded. The system should record the transaction durably and support safe retry or status checking so that a disconnected session does not silently duplicate a pickup order.

The Bare Metal Cyber Cyber Challenge AutoOps+ practice offers a useful variation. Imagine a deployment whose new processes pass their startup checks, but shoppers see intermittent checkout failures during each replacement batch. Work through what that pattern suggests about readiness, graceful shutdown, available capacity, and routing. Then decide what evidence would distinguish a defect in the new code from an interruption caused by the exchange itself. A thoughtful answer follows the customer transaction through the transition rather than stopping at the deployment job's green status.

The operations team discovers that its previous rollout procedure effectively treated every instance as immediately replaceable and had inadequate constraints on the unavailable group. The fix begins with a deployment policy that preserves enough healthy capacity. In a system using Kubernetes, the team can set appropriate rolling update limits and verify the observed behavior. It should also check that the readiness signal matches actual order processing and that termination allows in-flight transactions to reach a safe outcome. A configuration change without a rehearsal would leave the team uncertain whether those controls work together.

Now the group tests a smaller replacement. One new application instance starts while the stable service continues handling most requests. The new instance finishes preparing its cache and confirms its required inventory connection before entering the routing pool. One old instance stops receiving fresh requests, completes its remaining work, and exits. The operators observe both the deployment's state and the customer experience. They can continue only when the replacement behaves correctly and the overall service remains within acceptable limits. The intended pace is controlled by evidence, not solely by a timer.

The team also needs a stop condition. If checkout latency climbs sharply, order-confirmation mismatches appear, or replacement instances fail to become ready, continuing the rolling update would increase the exposure. A controller may pause or stall under particular conditions, but the organization must know which failures it detects and how it reports them. A rollout can be stuck with old and new versions mixed together. That is not necessarily a disaster if the versions are compatible and enough capacity remains, but it requires an operator who can explain the service state and decide whether to pause, revert, or repair the problem.

Compatibility becomes especially important during a rolling update because coexistence is normal, not an exception. If the new grocery application stores pickup windows in a format the old version cannot read, old instances may fail as soon as a new instance writes the first changed record. The release team should arrange data and interface changes so both versions work during the replacement window. Adding compatible data fields before relying on them, maintaining old interfaces until consumers have moved, and delaying destructive changes can make a rolling deployment possible. A rollout strategy cannot repair incompatible application contracts.

The warehouse workers expose another subtlety. Unlike web requests, queue messages are often claimed and processed by background workers. Terminating a worker while it holds a message can cause that message to be redelivered after a lease expires, depending on the queue design. The worker should acknowledge work only after the appropriate durable result, and repeated delivery should not result in duplicate packing slips or multiple reservations of the same item. A rolling replacement of web instances alone may leave the worker fleet untouched; a separate worker deployment requires its own interruption and ownership plan. The operator needs to know which workloads the release actually changes.

A grocery service may also rely on long-lived client connections. An application update that repeatedly disconnects store devices or delivery drivers can create operational disruption even when ordinary short web requests succeed. The team should know how these connections recover, whether clients reconnect to compatible instances, and whether messages can be resumed without losing position. Reducing the batch size may lessen the frequency of simultaneous disconnections, but some protocol changes require coordinated client compatibility. Serving live customers is broader than receiving a successful response from a health endpoint.

Rolling updates are sometimes described as zero-downtime deployments. That is an aspiration supported by good architecture, not an automatic property of a scheduling method. Availability depends on enough capacity, accurate health signals, safe request draining, compatible versions, and dependable surrounding services. If a database migration locks a critical table, a carefully managed application rollout can still cause a customer-visible interruption. If all instances depend on an external authentication service that is unavailable, keeping more application replicas alive does not restore that dependency. The delivery strategy controls only part of the system.

How does this compare with the previous two release strategies? A canary deliberately exposes a limited population or traffic share to measure behavior under real conditions. Blue-green prepares a separate environment and redirects users when it is ready, at the cost of maintaining parallel capacity and coordinating shared state. A rolling update replaces the serving pool in batches while trying to preserve enough availability throughout. The strategies can be combined or adapted by a platform, but they answer different questions. The grocery team is concerned primarily with maintaining capacity during replacement, while still checking whether the candidate is safe.

The right strategy changes with the workload. A small stateless service with ample spare capacity and backward-compatible interfaces may be an excellent rolling-update candidate. A tightly coupled legacy application that cannot tolerate mixed versions may require a more coordinated cutover. A system where a rare but serious user path needs explicit exposure monitoring may benefit from a canary, potentially alongside rolling replacement mechanics. The names should guide an initial design conversation, not replace the need to describe the actual handoff, user impact, and recovery route.

The grocery team chooses to rehearse under demand that resembles its busy period. It measures whether the minimum healthy capacity is preserved, whether startup takes longer under load, and whether draining old requests leaves any ambiguous orders. It tests failure as well: a replacement instance never becomes ready, a node lacks room for temporary capacity, and a shopper's request crosses the termination window. The team expects the deployment to stop advancing safely in those conditions, rather than continuing until every instance has been replaced. An update that handles failure predictably deserves more trust than one tested only along a smooth path.

On the next Friday, the revised deployment proceeds in controlled batches. A new instance joins only after it can perform the required work. An old one leaves after the routing system has stopped giving it new requests and the application has dealt with its in-flight transactions. The operators watch successful checkouts, actual reservation outcomes, response delay, and the workload carried by the remaining instances. They do not rely solely on the number of replacement instances marked complete. If a signal crosses the agreed limit, the rollout pauses while the team determines what changed.

The release finishes without a checkout outage. That result does not prove the team discovered a perfect universal rollout setting. It proves that for the tested workload and demand, the combination of available capacity, replacement pacing, health checks, and request handling preserved the required service. The team records those conditions and will revisit them if customer traffic grows or the application starts using a more demanding dependency. A safe rolling deployment is a controlled exchange of running capacity, not a mass restart with a reassuring label.