Summary
Support configurable graceful shutdown behavior for RestateCluster pods so users do not need to manually patch the operator-managed StatefulSet.
Problem
After a RestateCluster was provisioned by the operator, I had to manually patch the generated StatefulSet to add a preStop sleep. Without that delay, during a rolling restart the cluster becomes briefly unavailable, which causes errors for Restate services.
Because the StatefulSet is operator-managed, manual patches are not a durable solution.
Current behavior
The operator-generated StatefulSet appears to set a fixed pod-level termination grace period, but it does not expose a way to configure a container lifecycle.preStop hook for Restate pods.
Today the generated pod spec includes termination_grace_period_seconds: Some(60), but no configurable lifecycle.preStop for the Restate container.
Expected behavior
RestateCluster should expose a declarative way to configure graceful shutdown behavior for the managed pods so rolling restarts do not briefly interrupt cluster availability.
Possible approaches:
- Add a simple field such as
spec.compute.preStopSleepSeconds
- Or expose a more general field such as
spec.compute.lifecycle.preStop
- Optionally also allow configuring
spec.compute.terminationGracePeriodSeconds
Additional context
I observed this when the cluster had already been provisioned and then later underwent a rolling restart. Adding a preStop sleep manually to the managed StatefulSet avoided the brief unavailability window.
Summary
Support configurable graceful shutdown behavior for
RestateClusterpods so users do not need to manually patch the operator-managedStatefulSet.Problem
After a
RestateClusterwas provisioned by the operator, I had to manually patch the generatedStatefulSetto add apreStopsleep. Without that delay, during a rolling restart the cluster becomes briefly unavailable, which causes errors for Restate services.Because the
StatefulSetis operator-managed, manual patches are not a durable solution.Current behavior
The operator-generated
StatefulSetappears to set a fixed pod-level termination grace period, but it does not expose a way to configure a containerlifecycle.preStophook for Restate pods.Today the generated pod spec includes
termination_grace_period_seconds: Some(60), but no configurablelifecycle.preStopfor the Restate container.Expected behavior
RestateClustershould expose a declarative way to configure graceful shutdown behavior for the managed pods so rolling restarts do not briefly interrupt cluster availability.Possible approaches:
spec.compute.preStopSleepSecondsspec.compute.lifecycle.preStopspec.compute.terminationGracePeriodSecondsAdditional context
I observed this when the cluster had already been provisioned and then later underwent a rolling restart. Adding a
preStopsleep manually to the managedStatefulSetavoided the brief unavailability window.