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

Submariner Gateway Cable Driver IPsec SA State Sentinel

Audits Submariner gateway metrics to detect cable driver IPsec SA disconnects, cross-cluster peer RTT latency spikes, and link drops.

Categories
CloudInfrastructure

Automates continuous health and cross-cluster connectivity surveillance for Submariner multi-cluster networking gateways.

How it works

  1. A schedule trigger executes the Submariner gateway health audit workflow every 15 minutes.
  2. The Python task queries the Submariner gateway Prometheus metrics endpoint on port 8080.
  3. The script extracts cable driver IPsec connection states, cross-cluster RTT latencies, and tunnel byte counters.
  4. An evaluation gate determines whether active cable connections drop below minimum bounds or RTT latencies exceed limits.
  5. When multi-cluster tunnel degradation is detected, a high-priority Slack alert is dispatched to Multi-Cluster NetOps.
  6. When inter-cluster pod-to-pod IPsec tunnels transmit packets cleanly without packet drop or re-key stalls, nominal telemetry is logged.
  7. A structured JSON audit manifest is emitted for multi-cluster networking compliance and cross-connect governance archives.

Architecture diagram

graph TD
    Trigger[Schedule Trigger: 15m] --> ScanMetrics[Python Script: Scrape Submariner Metrics]
    ScanMetrics --> EvalBreach{Connections < 1 OR RTT > 120ms OR SA Disconnect?}
    EvalBreach -- Yes --> SlackAlert[Slack: High-Urgency NetOps Alert]
    EvalBreach -- No --> LogNominal[Log: Nominal Submariner State]
    SlackAlert --> EmitManifest[Debug Return: NetOps Audit Manifest]
    LogNominal --> EmitManifest

Architecture components

  • Trigger: Automated schedule polling at 15-minute recurring intervals.
  • Script Task: Scrapes Submariner gateway Prometheus metrics endpoints using Docker container runners.
  • Decision Gate: Evaluates whether active cable driver connections drop to zero or cross-cluster RTT breaches limits.
  • Notification Task: Dispatches structured Slack alerts with remote cluster identifier and RTT metrics.
  • Audit Manifest: Emits JSON execution payloads containing multi-cluster tunnel health and timestamps.

Key capabilities

  • Continuous surveillance of Submariner Gateway pods, libreswan/strongSwan IPsec engines, and WireGuard drivers.
  • Early warning detection for NAT-T traversal failures and UDP port 4500/500 firewall packet drop.
  • Automated tracking of cross-cluster round-trip latency preventing distributed service call timeouts.
  • Zero host dependency execution via isolated containerized Python runners.

What you get

  • Real-time visibility into multi-cluster Kubernetes pod-to-pod networking and encrypted interconnect health.
  • Proactive alerts preventing cross-region service discovery blackholes and split-cluster data divergence.
  • Standardized audit manifests containing exact byte throughput, RTT values, and execution timestamps.
  • Zero-overhead deployment compatible with Submariner Operator and Lighthouse multi-cluster service discovery.

Who it's for

  • Multi-cluster network architects connecting hybrid on-premise and public cloud Kubernetes clusters.
  • Site Reliability Engineers ensuring uninterrupted inter-cluster database replication and microservice calls.
  • Security leads auditing end-to-end IPsec/WireGuard cryptographic tunnel integrity across cluster boundaries.
  • Enterprise cloud operations teams managing geo-distributed Kubernetes disaster recovery pairs.

Why orchestrate this with Kestra

  • Serverless Docker Isolation: Executes telemetry scraping in ephemeral Docker environments without persistent workers.
  • Centralized Secrets Governance: Protects sensitive Slack webhooks using encrypted namespace secrets.
  • Declarative YAML Workflows: Manages multi-cluster network surveillance as versioned code in Git repositories.
  • Comprehensive Audit History: Preserves historical cross-cluster network metrics in searchable Kestra execution logs.

Use cases

  • IPsec IKE Rekey Failure Detection: Identifies when mismatched crypto proposals prevent automatic tunnel renewal.
  • Cross-Region WAN Degradation Alarm: Alerts engineers when transit provider congestion inflates RTT past 120ms.
  • Gateway Failover Verification: Measures packet disruption during active-standby gateway leader transitions.

Inputs

Name Type Default Description
submariner_metrics_url STRING http://submariner-gateway.submariner-operator.svc.cluster.local:8080 Internal HTTP URL exposing Prometheus metrics for Submariner.
remote_cluster_id STRING cloud-eu-secondary Identifier of the target remote Kubernetes cluster monitored.
max_gateway_rtt_ms INT 120 Maximum allowable cross-cluster network round-trip time in milliseconds.
min_active_connections INT 1 Minimum allowable active cable driver tunnel connections.
alert_on_sa_disconnect BOOL true Toggle whether IPsec SA disconnect triggers an incident alert.

Expected outputs

  • {{ outputs.scan_submariner_telemetry.vars.active_connections_count }}: Count of active cable driver connections.
  • {{ outputs.scan_submariner_telemetry.vars.gateway_rtt_ms }}: Maximum observed cross-cluster round-trip latency.
  • {{ outputs.scan_submariner_telemetry.vars.bytes_in_total }}: Ingress traffic volume across the encrypted cable tunnel.
  • {{ outputs.scan_submariner_telemetry.vars.is_alerting }}: Boolean flag indicating if tunnel health bounds are breached.
  • {{ outputs.scan_submariner_telemetry.vars.audit_timestamp }}: ISO-8601 UTC timestamp of the Submariner audit run.

Prerequisites

  • Submariner deployed across multi-cluster estate with Prometheus metrics enabled on gateway nodes.
  • Network connectivity from the Kestra worker to the Submariner gateway metrics service.
  • Configured Slack incoming webhook URL with permissions to post in network alert channels.

Secrets

  • SLACK_WEBHOOK_URL: Secure webhook URL for routing multi-cluster network alerts to the NetOps Slack channel.

Quick start

  1. Verify that Submariner gateway exposes Prometheus metrics on HTTP port 8080.
  2. Add the SLACK_WEBHOOK_URL secret within your Kestra namespace settings.
  3. Specify your remote cluster identifier in remote_cluster_id.
  4. Run a manual flow execution via the Kestra UI to validate metric ingestion.
  5. Enable the periodic_submariner_audit schedule trigger to establish automated monitoring.

Common pitfalls and troubleshooting

  • UDP 4500 NAT Traversal Blocking: Cloud security groups must permit inbound and outbound UDP ports 4500 and 500.
  • MTU Size Discrepancies: Encrypted IPsec tunnels require lower MTU (default 1440) to prevent packet fragmentation.
  • CIDR Block Overlaps: Submariner requires non-overlapping PodCIDR and ServiceCIDR ranges across peered clusters.
  • Gateway Node EIP Assignment: Public cloud gateways require public Elastic IPs or transparent NAT forwarding.

How to extend

  • Automated Gateway Failover: Trigger failover to a secondary gateway node via Kestra CLI task if RTT spikes.
  • PagerDuty Escalation: Escalate to on-call network engineers if all cable connections drop to zero for 2 runs.
  • Multi-Mesh Mesh Audit: Expand script parameters to monitor all connected cluster pairs in the Submariner broker.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.