Schedule icon
Request icon
Switch icon
SlackIncomingWebhook icon
If icon
Log icon

Tyk API Gateway Ingress Health & Hot-Reload Sentinel

Audit Tyk Gateway health and canary ingress routes, detect configuration drift, alert via Slack, and execute safe hot-reloads.

Categories
Infrastructure

Continuously audits Tyk Open Source API Gateway instances on a schedule by probing daemon health endpoints and verifying canary ingress routing status, detecting control plane degradation, route desynchronization, and cache drift while providing dual-gated automated hot-reload remediation.

How it works

  1. periodic_gateway_audit (io.kestra.plugin.core.trigger.Schedule) triggers every 15 minutes, passing target host, port configuration, and canary route identifiers. Shipped disabled by default for safe initial setup.
  2. probe_tyk_gateway_health (io.kestra.plugin.core.http.Request) invokes the Tyk Gateway REST endpoint GET /hello to verify daemon responsiveness, version metadata, and internal status.
  3. probe_canary_ingress_route (io.kestra.plugin.core.http.Request) sends a synthetic request to the configured canary listen path (/canary-health-probe) to test end-to-end data plane proxy forwarding.
  4. classify_gateway_verdict (io.kestra.plugin.core.flow.Switch) evaluates responses:
    • GATEWAY_UNHEALTHY: Fires when /hello returns a non-200 code or status differs from pass, alerting #gateway-alerts via io.kestra.plugin.slack.notifications.SlackIncomingWebhook.
    • CANARY_ROUTING_FAILED: Fires when the canary endpoint returns 404 or a 5xx error, indicating route desynchronization or a stale internal cache. Dispatches a Slack notification and, if auto_reload is enabled and dry_run is false, sends GET /tyk/reload with X-Tyk-Authorization credentials to resynchronize API definitions from the store.
    • HEALTHY: Confirms compliant operational state and logs status via io.kestra.plugin.core.log.Log.
  5. log_audit_summary (io.kestra.plugin.core.log.Log) records execution completion, verified host address, and parameter state for audit lineage.
  6. The global errors block intercepts connection timeouts or refused sockets, alerting on-call engineers when the Tyk Gateway container or pod is completely offline.

What you get

  • Automated Day 2 health and routing validation for Tyk Open Source API Gateway deployments.
  • Early warning when gateway API definitions drift, become stale, or drop incoming microservice traffic.
  • Safe dual-key automated remediation (auto_reload: true and dry_run: false) preventing unintended hot-reloads in production.
  • Centralized audit lineage tracking gateway availability and ingress routing stability over time.

Who it's for

  • Platform Engineers and Site Reliability Engineers managing API gateway ingress in Kubernetes or Docker environments.
  • DevOps Teams operating Tyk Open Source Gateway standalone or clustered configurations.
  • Microservice and Backend Developers relying on Tyk for zero-trust API ingress and rate limiting.

Why orchestrate this with Kestra

API gateways are critical path infrastructure where stale in-memory routing tables or missed synchronization events silently disconnect downstream consumers. Kestra provides declarative scheduled orchestration, robust multi-branch condition evaluation with Pebble expressions, built-in credential masking via namespace secrets, and safe remediation execution without brittle custom cron scripts.

Prerequisites

  • A running Tyk Open Source Gateway instance (version 5.x+). The official Docker image (tykio/tyk-gateway:v5.3) is free and open-source.
  • A Redis instance reachable by the Tyk Gateway container for session and API definition storage.
  • An incoming Slack webhook URL for routing alerts.

Secrets

  • TYK_SECRET: Gateway secret key used for administrative /tyk/reload authentication (passed in X-Tyk-Authorization header; configured via TYK_GW_SECRET).
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL used by alert_gateway_unhealthy, alert_canary_routing_failed, and alert_connectivity_failure.

Quick start

  1. Start a local Redis and Tyk Gateway container:
    docker network create tyk-net
    docker run -d --name redis --network tyk-net redis:7-alpine
    docker run -d --name tyk-gateway --network tyk-net -p 8080:8080 -e TYK_GW_STORAGE_HOST=redis -e TYK_GW_SECRET=352d20ee67be67f6340b4c0605b044b7 tykio/tyk-gateway:v5.3
    
  2. Configure TYK_SECRET and SLACK_WEBHOOK_URL in your Kestra namespace secrets.
  3. Execute this workflow with default inputs (dry_run: true).
  4. Verify in the execution logs that probe_tyk_gateway_health confirms status=pass.
  5. Enable periodic_gateway_audit to schedule continuous 15-minute evaluations.

How to extend

  • Add multiple canary API listen paths within a parallel task block to audit routing health across your entire API portfolio.
  • Wire a downstream PagerDuty incident trigger via io.kestra.plugin.pagerduty.notifications.PagerDutyAlert when GATEWAY_UNHEALTHY fires.
  • Combine with GitOps webhook triggers (io.kestra.plugin.core.trigger.Webhook) to automatically trigger gateway validation and cache reload immediately after CI/CD API bundle deployments.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.