﻿# Check persistent-volume retention before scaling workers down

Inspect claim retention and backing-volume reclaim separately; scale-down, replacement and set deletion are different events.

Author: Retrivium editorial team
Updated: 2026-11-03
Canonical URL: https://retrivium.ai/journal/guide-ks-statefulset-pvc-retain/
Language: en

A serving StatefulSet scales down after a quiet period. Its worker disappears, but whether its model cache volume remains depends on more than Pod deletion. Inspect the StatefulSet's claim-retention policy and the storage system's reclaim policy as separate lifecycle layers before assuming the data is retained or removed.

## Separate scale-down from set deletion

persistentVolumeClaimRetentionPolicy has distinct whenScaled and whenDeleted settings. Each can choose Retain or Delete under the documented behavior. The default retains claims. Inspect the actual specification and supported cluster version. A rule for deleting the whole StatefulSet does not automatically describe what happens when only its replica count is reduced.

## Identify template-created claims

The policy applies to claims created from the StatefulSet's volume-claim templates. Map each affected ordinal to its claim and bound PersistentVolume. A manually supplied external claim can have a different ownership path. Do not infer policy coverage solely because a volume is mounted by a StatefulSet Pod.

## Follow the backing storage layer

Deletion of a PVC and reclamation of the underlying volume are separate events. The bound volume's reclaim policy and storage provisioner's behavior determine what happens next. A retained claim is also not an independent backup. Corruption, accidental writes or a later authorized deletion can affect the same data even if scale-down initially preserved it.

## Distinguish replacement from intentional reduction

The documented retention rules distinguish a failed Pod's replacement from removal caused by scaling or deleting the set. A replacement can reuse the existing claim. Treat controller state and ownership records as evidence, especially around interrupted reconciliation. Avoid forcing object deletion to make a diagnostic experiment proceed on live storage.

## Test with disposable data

Use an isolated StatefulSet and disposable synthetic files. Record claim identity, ownership and backing-volume state before scale-down, after reconciliation and after scaling up. Test the intended policy explicitly rather than relying on a familiar default. Acceptance means the observed data lifecycle matches the declared retention design. It does not establish a recovery point, a tested restore procedure or permission to discard any real model-side data merely because it looks like a cache.

## Primary references

[Kubernetes StatefulSets](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/).

[Kubernetes Persistent Volumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/).

[Kubernetes Storage Classes](https://kubernetes.io/docs/concepts/storage/storage-classes/).

Related reading: [Resource stuck Terminating: diagnosing a Kubernetes finalizer](/journal/kubernetes-finalizer-stuck-deletion/); [NVMe for model serving: where a faster disk changes results](/journal/nvme-for-model-serving/).
