Script icon
Docker icon
If icon
SlackIncomingWebhook icon
Log icon
Return icon
Schedule icon

Rook Ceph Operator Reconciliation Loop Stall Sentinel

Monitors Rook Ceph operator reconciliation latency and CRD sync errors to prevent Kubernetes persistent storage volume provisioning stalls.

Categories
CloudInfrastructure

Audits Rook Ceph Kubernetes operator telemetry to detect reconciliation loop stalls, controller-runtime sync errors, and blocked CephCluster custom resource updates.

How it works

  1. A schedule trigger executes the storage operator audit workflow every 15 minutes.
  2. The Python task queries the Rook Ceph operator Prometheus metrics endpoint (rook-ceph-operator:9090).
  3. The script extracts cumulative controller reconciliation errors, 99th percentile loop duration, and cluster progress status.
  4. An evaluation gate determines whether reconciliation latency or error counts breach operational safety bounds.
  5. When thresholds are breached, a high-priority Slack alert is dispatched to storage reliability engineers.
  6. When the operator reconciles custom resources within nominal duration margins, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for Kubernetes storage platform audit archives and SLA tracking.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Rook Operator Metrics]
    ScanMetrics --> EvalBreach{Reconcile Errors >= Threshold OR Duration > 120s?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency Storage SRE Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Operator Reconcile State]
    SlackAlert --> EmitManifest[Debug Return: Storage Operator Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute intervals.
  • Script Task: Scrapes Rook Ceph operator Prometheus metrics using Docker container isolation.
  • Decision Gate: Evaluates whether operator reconciliation duration or errors exceed stability bounds.
  • Notification Task: Dispatches structured Slack alerts with namespace identity and duration seconds.
  • Audit Manifest: Emits JSON execution payloads containing reconcile metrics and timestamps.

Key capabilities

  • Continuous surveillance of Rook Ceph controller-runtime reconciliation loops.
  • Rapid detection of blocked OSD provisioning and crashed Ceph monitor deployment updates.
  • Early isolation of Kubernetes API server lock contention affecting storage operator workers.
  • Zero external dependency execution via isolated containerized Python runners.

What you get

  • Preemptive alerting on Kubernetes cloud-native storage management plane lockups.
  • Automated detection of failing CephCluster custom resource reconciliation loops.
  • Real-time audit manifests capturing operator reconciliation latency for platform governance.
  • Configurable tolerance thresholds adaptable to large multi-node storage clusters.

Who it's for

  • Kubernetes storage administrators managing Ceph, CSI plugins, and Rook operators.
  • Cloud platform engineers responsible for PersistentVolume (PV/PVC) availability.
  • SREs maintaining mission-critical database stateful sets backed by Ceph RBD and CephFS.
  • DevOps engineers diagnosing stuck Kubernetes storage pool scaling and node maintenance operations.

Why orchestrate this with Kestra

  • Deterministic Scheduling: Guarantees regular operator health audits without fragile local cron scripts.
  • Containerized Runners: Runs Python tasks inside isolated Docker containers without host library dependencies.
  • Condition Branching: Flowable If tasks route alerts and nominal logging cleanly without custom logic.
  • Enterprise Secret Safety: Securely injects Slack webhook credentials without plain-text exposure.

Use cases

  • OSD Node Disk Addition Stall: Detects operator hangs when raw disk preparation jobs fail to complete.
  • Ceph Monitor Quorum Tie: Alerts when the operator cannot establish a new monitor pod during node cordoning.
  • CRD Schema Migration Failure: Identifies reconciliation crashes occurring immediately after a Rook operator Helm upgrade.
  • Kubernetes API Throttling: Surfaces operator reconcile queue backpressure caused by client-side rate limiting.

Inputs

Name Type Default Description
rook_metrics_url STRING http://rook-ceph-operator.rook-ceph.svc.cluster.local:9090 Base HTTP URL exposing Rook operator Prometheus metrics.
cluster_namespace STRING rook-ceph Kubernetes namespace housing Rook Ceph resources.
max_reconciliation_errors_threshold INT 2 Maximum allowable reconciliation errors before alerting.
lookback_minutes INT 15 Lookback evaluation window in minutes for reconcile rate.
alert_on_operator_stall BOOL true Toggle Slack alert dispatch upon detecting operator stalls.

Expected outputs

  • {{ outputs.scan_rook_operator_metrics.vars.reconcile_errors_count }}: Cumulative number of controller reconcile errors.
  • {{ outputs.scan_rook_operator_metrics.vars.reconcile_duration_seconds }}: 99th percentile reconcile loop duration in seconds.
  • {{ outputs.scan_rook_operator_metrics.vars.is_operator_stalled }}: Boolean flag indicating if operator loop is currently stalled.
  • {{ outputs.scan_rook_operator_metrics.vars.is_alerting }}: Boolean flag indicating whether error thresholds were breached.
  • {{ outputs.emit_audit_manifest.value }}: Structured JSON audit manifest emitted for compliance archives.

Prerequisites

  • Rook Ceph operator deployed with Prometheus metrics enabled (ROOK_ENABLE_PROMETHEUS: true).
  • Operator metrics port 9090 reachable from the Kestra worker execution environment.
  • Docker daemon running on the Kestra host to execute containerized Python tasks.

Secrets

  • SLACK_WEBHOOK_URL: Incoming webhook URL for the target Storage SRE Slack alerting channel.

Quick start

  1. Verify that the Rook Ceph operator Service exposes port 9090 in your cluster.
  2. Configure the SLACK_WEBHOOK_URL secret in your Kestra namespace settings.
  3. Specify your Rook namespace in cluster_namespace.
  4. Execute a manual test run via the Kestra UI to verify metric ingestion.
  5. Enable the periodic_rook_audit trigger to establish automated continuous surveillance.

Common pitfalls and troubleshooting

  • RBAC ClusterRole Permissions: Operator reconcile loops fail if RBAC rules miss new Ceph custom resource definitions.
  • Ceph Daemon Crash Loops: If an OSD or MON pod enters CrashLoopBackOff, the operator reconciliation loop waits for timeout.
  • Disk Discovery DaemonSet: Ensure rook-ceph-discover pods are healthy on all storage nodes.
  • Node Cordon Blocking: Ceph drain policies can block reconciliation if minimum replica failure domains are violated.

How to extend

  • Operator Pod Auto-Restart: Trigger an automated Kubernetes pod delete task to bounce the operator if stuck > 10 minutes.
  • Ceph CLI Status Extraction: Chain a ceph status diagnostic task via the Rook toolbox pod when stalls occur.
  • PagerDuty Escalation: Escalate to on-call storage SREs when reconciliation errors persist across three evaluation windows.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.