Skip to content

Support configurable preStop / graceful shutdown for RestateCluster pods #155

Description

@shamil

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions