cloudflare / cloudflare/cloudflared

tunnel deletion does not clean up associated load balancer origin entries

Open
#572 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
15.6k
Forks
1.4k
PR merge metrics
No merged PRs in 30d

Description

We are using cloudflared/CF tunnel to handle ~30M requests per day (and growing) at AWS instances spread around the globe.

On instance startup, these EC2 instances install cloudflared, retrieve certificate from IAM/Secrets Manager, and automatically add themselves to the relevant load balancer pool for the region they are in.

All is swell!

Except - when they shut down, we've had to write a bash script that executes as a last 'gasp' - this process completely de-registers the tunnel instance using `/usr/bin/cloudflared tunnel delete $(echo $HOSTNAME)` - however we end up with redundant entries in our Cloudflare Load Balancers that eat up quantites of our licensed/paid origins eg:

Pool "foo"
hostname => abc123.cfargotunnel (redundant, tunnel abc123 was deleted)
hostname => def456.cfargotunnel (redundant, tunnel def456 was deleted)
hostname => ghi789.cfargotunnel = ACTIVE, working

We spin up and down tens of EC2 instances per day, so the problem of redundant entries in our load balancer pools is becoming unmanageable.

We have reached out to EntSupport on this one but were told to use the CF API - however, there is currently no Cloudflare API call that permits the removal of a single origin from a load balancer pool.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.