Recover a Pulumi Stack Wedged by an Interrupted Update
Detect pending operations and a held lock on a Pulumi stack after an interrupted update, then clear them with pulumi cancel and pulumi refresh behind an approval, then verify the stack is clean.
Audits Tailscale mesh networks for nodes falling back to DERP relay servers and elevated peer latency, alerting platform engineers via Slack.
Enterprise zero-trust infrastructure depends on Tailscale to create encrypted, point-to-point WireGuard mesh networks between cloud servers, developer laptops, and on-premises Kubernetes clusters. When local corporate firewalls block outbound UDP traffic or restrictive Symmetric NAT configurations prevent direct hole-punching, Tailscale transparently routes traffic through public or private Designated Encrypted Relay for Packets (DERP) servers. While this fallback guarantees that connections never drop, routing packets through distant HTTP/HTTPS relays dramatically inflates round-trip latency and caps throughput. Consequently, cross-cluster database replication slows down and microservice RPC timeouts occur without explicit error logs. This sentinel audits Tailscale device connectivity every 15 minutes, detects when nodes fall back to DERP relays, and alerts network engineers on Slack with exact node hostnames and firewall remediation steps.
*/15 * * * *) or runs on-demand via manual execution./api/v2/tailnet/{tailnet}/devices to retrieve device metadata and connection states.clientConnectivity and endpoint arrays for each device to verify whether direct WireGuard UDP peering is active or if DERP relay tunneling is in use.max_relayed_nodes_threshold.io.kestra.plugin.core.flow.If flowable checks if relayed nodes exceed the threshold and dispatches a Slack alert to #netops-alerts.flowchart TD
A[fifteen_minute_tailscale_audit Schedule Trigger] --> B[evaluate_tailscale_devices Python Script]
B --> C[check_derp_relay_fallback Flowable If]
C -- High DERP Usage --> D[notify_slack_derp_degradation Webhook]
C -- Mesh Peering Healthy --> E[log_mesh_network_status Log]
D --> E
E --> F[export_tailscale_manifest Return]
Tailscale seamlessly abstracts networking complexities, but its silent fallback to DERP servers obscures performance degradation. Kestra provides the orchestration framework to periodically audit network topologies, parse device connection telemetry, and trigger incident alerts when direct peer-to-peer communication degrades. Using Kestra's containerized Python runner and secret management, network teams gain automated operational guardrails without maintaining separate monitoring scripts.
| Name | Type | Default | Description |
|---|---|---|---|
tailnet_name |
STRING |
company.org.github |
Tailscale organizational tailnet domain identifier or organization name. |
max_relayed_nodes_threshold |
INT |
5 |
Maximum allowable peer nodes falling back to DERP relays before alerting network degradation. |
node_tag_filter |
STRING |
all |
Specific node ACL tag (e.g. tag:prod-server) to filter evaluation, or all to scan all devices. |
alert_on_degraded |
BOOL |
true |
Whether to dispatch automated Slack alerts when excessive DERP relay fallbacks are detected. |
{{ outputs.evaluate_tailscale_devices.vars.total_devices_evaluated }}: Total number of active devices inspected in the tailnet.{{ outputs.evaluate_tailscale_devices.vars.relayed_nodes_count }}: Number of nodes currently routing traffic through DERP relays.{{ outputs.evaluate_tailscale_devices.vars.is_degraded }}: Boolean flag indicating whether the relayed node threshold was breached.{{ outputs.export_tailscale_manifest.value }}: Structured dictionary containing the consolidated mesh health summary.api.tailscale.com.devices:read scope.TAILSCALE_API_KEY: Tailscale API access token with permissions to list devices and connectivity telemetry.SLACK_WEBHOOK_URL: Slack Incoming Webhook URL used to dispatch network incident alerts.TAILSCALE_API_KEY and SLACK_WEBHOOK_URL in your Kestra secret storage.company.network namespace.tailnet_name with your organization tailnet domain (e.g. example.com or example.github).node_tag_filter ensures only persistent production nodes are evaluated.