Notes

Use Recreate when a Deployment cannot overlap its Pods

Fix a rollout that needs the old Pods gone before new ones start. Configure the Deployment strategy, then check what your Helm chart actually renders.

A rolling Deployment update normally creates replacement Pods while older ones are still running. That overlap is useful for availability, but can conflict with a workload that needs exclusive access to a volume or another external resource.

Start with Pod events. A replacement stuck in ContainerCreating can have many causes; changing rollout strategy only helps when the cause is overlapping old and new instances.

Confirm the conflict

For an existing Deployment named app in namespace apps:

kubectl get pods -n apps
kubectl describe deployment app -n apps
kubectl get events -n apps --sort-by=.metadata.creationTimestamp

Look for attachment or mount failures and identify which Pods use the claim. ReadWriteOnce means a volume can be mounted read-write by one node, not necessarily one Pod. Multiple Pods on that node may share it. ReadWriteOncePod is the access mode intended to restrict a supported CSI volume to one Pod. Storage-driver behavior and node placement matter.

If old and new replicas must not overlap during an update, accept the resulting downtime explicitly.

Set the Deployment strategy

The Kubernetes field is spec.strategy, not spec.updateStrategy. In the Deployment manifest, use:

spec:
  strategy:
    type: Recreate

This is a fragment to merge into your existing Deployment. Remove rollingUpdate from the desired manifest. Kubernetes rejects a non-null rollingUpdate configuration alongside type: Recreate.

For a direct change to an existing Deployment in a test environment, a merge patch can both select the strategy and remove the old rolling-update settings:

kubectl patch deployment app -n apps --type=merge \
  -p '{"spec":{"strategy":{"type":"Recreate","rollingUpdate":null}}}'

Put the same decision in the configuration that owns the Deployment. Otherwise a later GitOps sync or Helm upgrade can undo a manual patch. Changing the strategy alone does not restart unchanged Pods; a rollout also needs a Pod-template change.

Helm has no universal strategy value

Helm renders chart templates. A chart might expose strategy, deploymentStrategy, updateStrategy, or no configurable value at all. There is no global Helm updateStrategy field that applies to every chart.

Inspect your chart, then render the proposed change. Here ./chart is the chart directory and values.yaml contains its documented values:

helm show values ./chart
helm template app ./chart -n apps -f values.yaml > rendered.yaml

Check the rendered Deployment’s spec.strategy and confirm it contains no rolling-update configuration. If a chart merges default values, you may need a chart-specific null value to remove defaults, or a template change.

kubectl rollout restart triggers a rollout using the current strategy; it does not change that strategy. Recreate also does not protect against every overlap outside an upgrade, such as manually deleting a Pod while a controller replaces it.

See Deployment strategies and volume access modes for the underlying guarantees.