Commands icon
If icon
SlackIncomingWebhook icon
Schedule icon

Kubernetes StatefulSet Replica Health and Quorum Degradation Sentinel

Audits Kubernetes StatefulSets across all namespaces to detect replica count deficits and impending database quorum loss.

Categories
CloudInfrastructure

How it works

This workflow audits all StatefulSet resources across all Kubernetes namespaces using kubectl. It compares the declared .spec.replicas against the observed .status.readyReplicas. When any StatefulSet experiences unready or crashing pods, the difference indicates replica deficit and risk of quorum degradation. When the count of degraded StatefulSets exceeds the configured tolerance, an automated Slack alert is sent.

What you get

  • Continuous cluster-wide health checks for critical stateful systems (e.g., Kafka, Cassandra, Elasticsearch, Postgres).
  • Instant alerting with exact breakdown of desired vs. ready replicas.
  • Prevents silent partition splits and database election deadlocks.

Who it's for

  • Database Administrators (DBAs) and SREs operating distributed databases on Kubernetes.
  • Platform teams ensuring high availability for stateful microservices.

Why orchestrate this with Kestra

  • Declarative Scheduling: Automate periodic stateful audits without maintaining complex cron jobs.
  • Composable Alerting: Dispatch alerts across Slack, PagerDuty, or incident management webhooks effortlessly.
  • Audit Trail: Every execution is recorded with full execution context and historical logs.

Prerequisites

  • Cluster RBAC role with get and list permissions for statefulsets.apps.
  • Secret SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import this blueprint into your Kestra workspace.
  2. Configure the SLACK_WEBHOOK secret.
  3. Run the flow to audit stateful workloads across your clusters.

How to extend

  • Add an automated task to describe unready pods belonging to the degraded StatefulSet and include termination reasons in the Slack payload.
  • Trigger automated scaling or pod recycling workflows conditionally.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.