Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions charts/celeborn/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,24 @@ KEDA has settled, or pass `--set worker.replicas=<current>` when upgrading.
For a continuous-delivery tool, tell it to ignore the field - in Argo CD, `ignoreDifferences`
on `/spec/replicas` for the worker statefulsets, with `RespectIgnoreDifferences=true`.

### Scaled-in workers keep their volumes

A statefulset keeps the PVCs of a pod it scales in, by Kubernetes default. With PVC-backed
worker storage (`worker.volumeClaimTemplates`), every scale-in leaves that worker's volumes
behind, still billed and holding expired shuffle data, until someone deletes them. Set
`worker.persistentVolumeClaimRetentionPolicy` to have Kubernetes delete them on scale-in while
keeping them when the statefulset itself is deleted:

```yaml
worker:
persistentVolumeClaimRetentionPolicy:
whenScaled: Delete
whenDeleted: Retain
```

A rolling restart is not a scale-in, so a restarted worker still finds its volumes. Empty, the
default, leaves the Kubernetes default (`Retain` for both).

## Health probes

Both the master and the worker serve `GET /healthz` on their HTTP port, returning `200` when the
Expand Down
4 changes: 4 additions & 0 deletions charts/celeborn/templates/worker/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ spec:
volumeClaimTemplates:
{{- toYaml . | nindent 2 }}
{{- end }}
{{- with .Values.worker.persistentVolumeClaimRetentionPolicy }}
persistentVolumeClaimRetentionPolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
serviceName: {{ include "celeborn.worker.service.name" . }}
template:
metadata:
Expand Down
20 changes: 20 additions & 0 deletions charts/celeborn/tests/worker/statefulset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1041,3 +1041,23 @@ tests:
- equal:
path: spec.podManagementPolicy
value: Parallel

- it: Should not set a PVC retention policy by default
template: worker/statefulset.yaml
asserts:
- notExists:
path: spec.persistentVolumeClaimRetentionPolicy

- it: Should set `worker.persistentVolumeClaimRetentionPolicy`
template: worker/statefulset.yaml
set:
worker:
persistentVolumeClaimRetentionPolicy:
whenScaled: Delete
whenDeleted: Retain
asserts:
- equal:
path: spec.persistentVolumeClaimRetentionPolicy
value:
whenScaled: Delete
whenDeleted: Retain
4 changes: 4 additions & 0 deletions charts/celeborn/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ worker:
# The group ID to use when modifying the ownership and permissions of the mounted volumes.
fsGroup: 10006

# -- What happens to the worker statefulset's PVCs when it is scaled in or deleted, e.g.
# `{whenScaled: Delete, whenDeleted: Retain}`. Empty keeps the Kubernetes default (Retain).
persistentVolumeClaimRetentionPolicy: {}

# -- Volume claim templates for Celeborn worker pods.
volumeClaimTemplates:
# - metadata:
Expand Down
Loading