11.10 Kubernetes Deployment Recreate Strategy Management
Kubernetes Deployment Recreate Strategy Management ensures zero-downtime updates by replacing pods in batches, balancing availability and resource usage during deployments.
Kubernetes Deployment Recreate Strategy Management is the practice of correctly selecting, configuring, and operating around the Recreate update strategy, which terminates all existing Pods before creating any replacements, requiring deliberate operational planning to account for the guaranteed downtime window this strategy introduces during every update.
Recognizing When Recreate Is Appropriate
Applications Requiring Exclusive Resource Access
The Recreate strategy is typically chosen for applications that cannot tolerate two versions running simultaneously against a shared resource, such as a workload holding an exclusive lock, performing a schema migration incompatible with a previous version, or otherwise assuming singular, uncontested access to some external dependency.
Simplifying Compatibility Concerns Between Versions
By ensuring the old version is completely terminated before the new version starts, Recreate sidesteps the need to guarantee backward and forward compatibility between two simultaneously running application versions, a compatibility burden that the default RollingUpdate strategy would otherwise impose.
Planning for the Downtime Window
Communicating Expected Unavailability
Because Recreate guarantees a period during which zero Pods are running and serving traffic, effective management of this strategy includes communicating the expected downtime window to relevant stakeholders ahead of time, treating each update as a planned maintenance event rather than a seamless, unnoticed transition.
Scheduling Updates During Low-Impact Windows
Given the guaranteed downtime, updates to Deployments using the Recreate strategy are commonly scheduled during periods of lower traffic or established maintenance windows, minimizing the practical impact of the unavailability on end users or dependent systems.
Coordinating With Upstream and Downstream Dependencies
Managing Downstream Consumer Expectations
Systems that depend on the availability of the workload undergoing a Recreate update need to be designed or configured to tolerate this expected downtime, whether through retry logic, circuit breaking, or queuing, since the Deployment offers no continuous availability guarantee during the transition.
Sequencing With Dependent Updates
When multiple interdependent workloads must be updated together, and one or more use the Recreate strategy, careful sequencing of the overall update process is necessary to ensure dependencies are updated in an order that avoids compounding downtime or introducing incompatible intermediate states.
Monitoring Behavior Distinct From Rolling Updates
Absence of Gradual Progress Indicators
Because Recreate does not gradually transition capacity the way RollingUpdate does, monitoring an update under this strategy involves watching for a complete drop to zero available replicas followed by a return to the full desired count, rather than observing the incremental replica shifts characteristic of a rolling update.
Faster Detection of Startup Failures
One operational advantage of Recreate is that since all new Pods start simultaneously rather than incrementally, any systemic issue preventing the new revision from starting successfully becomes apparent immediately and uniformly across all replicas, rather than being discovered gradually as each incremental batch of a rolling update is attempted.
Rollback Considerations Under Recreate
Rollback Also Incurs Downtime
Because rolling back a Deployment reapplies a previous template through the same update strategy currently configured, a rollback performed while using the Recreate strategy incurs the same downtime characteristics as the original forward update, meaning rollback under this strategy is not a faster or lower-impact operation than the update it is reversing.