Commands icon
If icon
SlackIncomingWebhook icon
Schedule icon

Kubernetes Headless Service Orphaned Endpoints and DNS Resolution Sentinel

Audits Kubernetes headless services to detect orphaned endpoints with zero healthy backend pods breaking internal DNS discovery.

Categories
CloudInfrastructure

How it works

This workflow audits all Kubernetes Services configured as headless (clusterIP: None with active pod selectors) across all namespaces. It cross-references them against corresponding Endpoints objects to ensure backend pods are registered and ready. Headless services with zero addresses cause CoreDNS resolution failures for peer discovery in distributed systems (e.g., Elasticsearch, ZooKeeper, Redis Sentinel). Violations trigger a formatted Slack alert.

What you get

  • Proactive auditing of service discovery routing tables.
  • Rapid identification of misconfigured pod label selectors or completely crashed daemon pods.
  • Prevents catastrophic internal RPC and peer gossip network partitions.

Who it's for

  • Kubernetes Network Engineers and SREs supporting service meshes and internal microservice communication.
  • Developers deploying clustered stateful services relying on headless service DNS discovery.

Why orchestrate this with Kestra

  • Reliable Automation: Schedule continuous health checks without manual intervention.
  • Rich Tooling Integration: Combine native shell tools like kubectl and jq with complete workflow logging and monitoring.
  • Enterprise Extensibility: Easily route alerts to PagerDuty or Opsgenie.

Prerequisites

  • Cluster RBAC permissions allowing get and list on services and endpoints.
  • Secret SLACK_WEBHOOK configured in Kestra.

Quick start

  1. Import this blueprint into Kestra.
  2. Add the SLACK_WEBHOOK secret.
  3. Execute the workflow to identify orphaned headless services in your cluster.

How to extend

  • Add a step to inspect the associated Deployment or StatefulSet spec to verify if pod replicas were scaled to zero intentionally.
  • Generate Prometheus metrics from output variables.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.