Commands icon
If icon
SlackIncomingWebhook icon
Schedule icon

Kubernetes API Server Request Latency Spike Sentinel

Monitors Kubernetes API Server request duration metrics to detect control plane latency spikes and client throttling.

Categories
CloudInfrastructure

How it works

This workflow scrapes the Kubernetes API server /metrics endpoint, measuring apiserver_request_duration_seconds for p99 LIST requests. When operators, CI/CD pipelines, or rogue controllers flood the API server with non-cached wide-scope queries, etcd and API server CPU saturate, causing kubelet heartbeats to drop and admission webhooks to time out. When latency spikes above the threshold, Slack is notified immediately.

What you get

  • Continuous monitoring of core Kubernetes control plane response times.
  • Prevents cluster-wide controller stalls and client request timeouts.
  • Early warning of abusive client LIST calls before node NotReady states occur.

Who it's for

  • Kubernetes Cluster Administrators and Platform SREs managing multi-tenant clusters.
  • Infrastructure Architects ensuring control plane scalability.

Why orchestrate this with Kestra

  • Native In-Cluster Scraping: Uses service account credentials natively.
  • Precision Latency Metrics: Tracks p99 quantiles directly from official API server instrumentation.
  • Rapid Incident Routing: Dispatches formatted Slack diagnostics to control plane operators.

Prerequisites

  • Kubernetes cluster with RBAC allowing service account to read /metrics.
  • Secret SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import blueprint into Kestra.
  2. Configure API server URL and latency threshold.
  3. Run the workflow to inspect control plane health.

How to extend

  • Query apiserver_current_inflight_requests to monitor concurrency limits.
  • Identify client user-agents causing request surges via API audit logs.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.