Skip to content

OT-CONTAINER-KIT redis-operator reconciles StatefulSet replicas back to 1 after Sablier scales to zero #962

Description

@jlaska

What's happening

I have several homelab applications sitting behind Traefik with Sablier managing scale-to-zero. After enabling the recent CloudNativePG support I tried to extend the same pattern to Redis instances managed by the OT-CONTAINER-KIT redis-operator.

Sablier correctly discovers the StatefulSet (via the sablier.enable: "true" label, which the operator propagates from the Redis CR to the StatefulSet it creates), and scales it to zero on session expiry. But the operator's reconciliation loop sees the replica count drop and immediately restores it to 1 — so the pod never actually stops.

Why it happens

The redis-operator continuously reconciles its managed StatefulSets back to the desired replica count. Unlike CloudNativePG, which Sablier can pause via the hibernation annotation, there's no built-in mechanism for Sablier to tell the operator to stand down.

The operator does ship a pause mechanism: setting redis.opstreelabs.in/skip-reconcile: "true" on the Redis CR causes the controller to skip its reconciliation loop for that resource. Setting this annotation before scaling to zero, and removing it after scale-up, is enough to make scale-to-zero work reliably.

Environment

  • redis-operator: OT-CONTAINER-KIT v0.24.0 (redis.redis.opstreelabs.in/v1beta2)
  • Sablier: 1.13.0 (Kubernetes provider)
  • Observed with standalone Redis kind; RedisCluster/RedisReplication/RedisSentinel are out of scope for this issue

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions