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

Docker Hub Rate Limit and Image Pull Backpressure Sentinel

Audits Docker Hub rate limit headers to prevent HTTP 429 pull errors, alerting DevOps teams before CI/CD pipelines and Kubernetes nodes stall.

Categories
CloudInfrastructure

Containerized CI/CD pipelines and Kubernetes clusters depend heavily on base images hosted on Docker Hub. However, Docker Hub enforces strict rate limits (100 pulls per 6 hours for anonymous IPs, 200 pulls per 6 hours for free authenticated accounts). When engineering teams trigger concurrent test matrix runs or Kubernetes nodes experience mass rescheduling, registries return HTTP 429 Too Many Requests (toomanyrequests: You have reached your pull rate limit). This sentinel audits active Docker Hub rate limit headers on a scheduled interval, computes quota saturation, and notifies platform teams via Slack before production deployments halt.

How it works

  1. Scheduled interrogation: Triggers hourly via io.kestra.plugin.core.trigger.Schedule or runs on-demand before heavy deployment batches.
  2. Registry token acquisition: Requests an ephemeral inspection token from auth.docker.io using optional personal access tokens (PAT).
  3. Rate limit header extraction: Issues a lightweight HTTP HEAD request against the registry endpoint to parse ratelimit-limit, ratelimit-remaining, and docker-ratelimit-source headers without downloading layers.
  4. Threshold evaluation: An io.kestra.plugin.core.flow.If task evaluates whether remaining pulls have dropped below the safety margin.
  5. Slack incident notification: When quota is near exhaustion, dispatches an incident card to #platform-alerts detailing remaining capacity, source IP, and reset duration.
  6. Audit manifest export: Outputs a structured JSON telemetry payload for observability and historical capacity planning.

What you get

  • Proactive visibility into container pull quotas before CI runners or Kubernetes pods hit image pull backpressure.
  • Automated Slack notifications with remaining request counts, source IP tracking, and exact window reset seconds.
  • Prevention of unexpected developer build blocks and costly deployment outages.

Who it's for

  • Platform Engineers and DevOps teams managing shared CI/CD runners.
  • Site Reliability Engineers safeguarding container infrastructure against third-party rate limits.
  • Release Managers coordinating high-concurrency software deployments.

Why orchestrate this with Kestra

  • Declarative reliability: Replaces ad-hoc cron jobs with a declarative, auditable workflow.
  • Native alerting: Automatically branches based on metric values and routes alerts through official Kestra notification plugins.
  • Secret protection: Securely masks Docker Hub PATs and Slack Webhook URLs inside Kestra's encrypted secret store.

Prerequisites

  • Outbound internet access from Kestra workers to auth.docker.io and registry-1.docker.io.
  • A Slack Incoming Webhook configured for your platform alerts channel.

Secrets

  • DOCKERHUB_PAT: Docker Hub Personal Access Token (optional if auditing anonymous egress IP limits).
  • SLACK_WEBHOOK_URL: Slack Incoming Webhook endpoint used to dispatch alerts.

Quick start

  1. Add DOCKERHUB_PAT and SLACK_WEBHOOK_URL into your Kestra namespace secrets.
  2. Import this blueprint into your Kestra instance under company.infrastructure.
  3. Click Execute to run an initial quota health check and inspect the output variables.
  4. Enable the hourly_docker_rate_limit_monitor schedule trigger.

How to extend

  • Automated mirror failover: If remaining quota drops below 10%, automatically trigger an AWS ECR or GCP Artifact Registry mirror sync.
  • PagerDuty integration: Escalate to on-call platform engineers if anonymous egress IP capacity drops to 0.
  • Multi-region monitoring: Use a ForEach loop to query egress NAT gateways across multiple AWS/GCP regions.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.