Skip to content

Conversation

ranbel
Copy link
Contributor

@ranbel ranbel commented Oct 1, 2025

PCX-16753

Copy link
Contributor

github-actions bot commented Oct 1, 2025

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/public/__redirects @cloudflare/pcx-content-engineering, @cloudflare/pcx-technical-writing, @kodster28
/src/content/docs/cloudflare-one/connections/connect-networks/ @nikitacano, @ranbel, @cloudflare/pcx-technical-writing
/src/content/docs/learning-paths/ @cloudflare/pcx-technical-writing
/src/content/docs/load-balancing/ @angelampcosta, @cloudflare/pcx-technical-writing
/src/content/docs/reference-architecture/ @securitypedant, @haleycode, @cloudflare/pcx-technical-writing
/src/content/docs/spectrum/ @angelampcosta, @cloudflare/pcx-technical-writing
/src/content/docs/support/ @zeinjaber, @ngayerie, @cloudflare/pcx-technical-writing, @cloudflare/customer-support
* @cloudflare/pcx-technical-writing

Copy link
Contributor

github-actions bot commented Oct 1, 2025

This PR requires additional review attention because it affects the following areas:

Redirects

This PR changes current filenames or deletes current files. Make sure you have redirects set up to cover the following paths:

  • /cloudflare-one/connections/connect-networks/private-net/cloudflared/load-balancing/
  • /cloudflare-one/connections/connect-networks/routing-to-tunnel/lb/
  • /load-balancing/private-network/tunnels-setup/
  • /load-balancing/private-network/warp/

@ranbel ranbel changed the title [ZT] Load Balancing with cloudflared [ZT] Load Balancing traffic to Cloudflare Tunnel endpoints Oct 1, 2025
Copy link
Contributor

github-actions bot commented Oct 1, 2025

Preview URL: https://4ea5c72c.preview.developers.cloudflare.com
Preview Branch URL: https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com

Files with changes (up to 15)

Original Link Updated Link
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/public-load-balancers/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/public-load-balancers/
https://developers.cloudflare.com/load-balancing/private-network/warp-to-tunnel/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/load-balancing/private-network/warp-to-tunnel/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-availability/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-availability/
https://developers.cloudflare.com/load-balancing/private-network/tunnels-setup/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/load-balancing/private-network/tunnels-setup/
https://developers.cloudflare.com/load-balancing/private-network/warp/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/load-balancing/private-network/warp/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/lb/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/lb/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-availability/deploy-replicas/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-availability/deploy-replicas/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/private-net/cloudflared/load-balancing/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/private-net/cloudflared/load-balancing/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/private-net/cloudflared/connect-cidr/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/private-net/cloudflared/connect-cidr/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/dns/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/dns/
https://developers.cloudflare.com/load-balancing/private-network/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/load-balancing/private-network/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/tunnel-useful-commands/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/tunnel-useful-commands/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/migrate-legacy-tunnels/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/migrate-legacy-tunnels/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/update-cloudflared/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/update-cloudflared/
https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/ https://ranbel-load-balancing-with-zt.preview.developers.cloudflare.com/cloudflare-one/connections/connect-networks/routing-to-tunnel/

@ranbel ranbel marked this pull request as ready for review October 10, 2025 21:44
@ranbel ranbel requested review from a team, haleycode and securitypedant as code owners October 10, 2025 21:44
@ranbel ranbel requested review from a team, kodster28 and nikitacano as code owners October 10, 2025 21:44

1. To create a remotely-managed tunnel, follow the [dashboard setup guide](/cloudflare-one/connections/connect-networks/get-started/create-remote-tunnel/).
2. On the **Tunnels** page, select your newly created tunnel. The **Connectors** section shows all of the `cloudflared` instances for that tunnel.
3. Select **Configure**.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to mention that the replicas will have the same config? We can't apply custom config per replica.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


If you notice traffic imbalances across endpoints in different locations, you may have to adjust your load balancer setup.

`cloudflared` connections give preference to tunnels that terminate in the same Cloudflare data center. This behavior can impact how connections are weighted and traffic is distributed.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to be clear that we prefer to serve eyeball using cloudflared connections that are in the same data center.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

attempted to clarify this here: 959a9fc

To create a new tunnel:

<Render file="tunnel/create-tunnel" product="cloudflare-one" />
9. Go to the **CIDR** tab.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @chungthuang would you mind elaborating on what should change? Are you referring to adding VNET details?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/>
When you create a tunnel, Cloudflare generates a subdomain of `cfargotunnel.com` with the UUID of the created tunnel. You can treat `<UUID>.cfargotunnel.com` as if it were an origin target in the Cloudflare dashboard.

Unlike publicly routable IP addresses, `<UUID.cfargotunnel.com` will only proxy traffic for a DNS record in the same Cloudflare account. If someone discovers your subdomain UUID, they will not be able to create a DNS record in another account or system to proxy traffic to the address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Unlike publicly routable IP addresses, `<UUID.cfargotunnel.com` will only proxy traffic for a DNS record in the same Cloudflare account. If someone discovers your subdomain UUID, they will not be able to create a DNS record in another account or system to proxy traffic to the address.
Unlike publicly routable IP addresses, `<UUID>.cfargotunnel.com` will only proxy traffic for a DNS record in the same Cloudflare account. If someone discovers your subdomain UUID, they will not be able to create a DNS record in another account or system to proxy traffic to the address.

/>
When you create a tunnel, Cloudflare generates a subdomain of `cfargotunnel.com` with the UUID of the created tunnel. You can treat `<UUID>.cfargotunnel.com` as if it were an origin target in the Cloudflare dashboard.

Unlike publicly routable IP addresses, `<UUID.cfargotunnel.com` will only proxy traffic for a DNS record in the same Cloudflare account. If someone discovers your subdomain UUID, they will not be able to create a DNS record in another account or system to proxy traffic to the address.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Unlike publicly routable IP addresses, `<UUID.cfargotunnel.com` will only proxy traffic for a DNS record in the same Cloudflare account. If someone discovers your subdomain UUID, they will not be able to create a DNS record in another account or system to proxy traffic to the address.
Unlike publicly routable IP addresses, `<UUID.cfargotunnel.com` will only proxy traffic for a DNS record in the same Cloudflare account. The Tunnel UUID is not secret information; if someone discovers your subdomain UUID, they will not be able to create a DNS record in another account or system to proxy traffic to the address.

| `cloudflared tunnel create <NAME or UUID>` | Creates a tunnel, registers it with the Cloudflare edge and generates a credential file to run this tunnel. |
| `cloudflared tunnel route` | Routes traffic through a tunnel. |
| `cloudflared tunnel route lb <NAME or UUID> <load balancer name> <load balancer pool>` | Creates a Load Balancer with a pool that points to the tunnel. |
| `cloudflared tunnel route lb <NAME or UUID> <hostname> <load balancer pool>` | Adds a tunnel as an endpoint in a [load balancer pool](/cloudflare-one/connections/connect-networks/routing-to-tunnel/public-load-balancers/). A new load balancer and pool will be created if necessary. <ul> <li> `<hostname>`: the public-facing hostname of the load balancer, for example `lb.example.com` </li> <li> `<load balancer pool>`: the name of the [pool](/load-balancing/pools/create-pool/#create-a-pool) that will contain the tunnel endpoint </li> </ul> To load balance traffic to a [published application](/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/configuration-file/#file-structure-for-published-applications), you will also need to specify the application hostname in the [endpoint host header](/load-balancing/additional-options/override-http-host-headers/). |

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clarify that specifying the application hostname in the endpoint host header has to be done via the UI or LB API, not through cloudflared command?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nikitacano I think we can deprecate this page? No one should be using legacy tunnels anymore.


### Optional Cloudflare settings

The application will default to the Cloudflare settings for the load balancer hostname, including [cache rules](/cache/how-to/cache-rules/) and [firewall policies](/firewall/). You can change the settings for your hostname in the [Cloudflare dashboard](https://dash.cloudflare.com/).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change the settings for your hostname
@nikitacano I think this will only be effective if the published application hostname CNAME to the load balancer hostname?


### One app per load balancer

For this example, assume we have a web application that runs on servers in two different data centers. We want to connect the application to Cloudflare so that users can access the application from anywhere in the world. Additionally, we want Cloudflare to load balance between the servers such that if the primary server fails, the secondary server receives all traffic.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we clarify that in the LB pool config, one has to be the fallback pool?


When an end user sends a request to your application, Cloudflare routes their traffic using [Anycast routing](https://www.cloudflare.com/learning/cdn/glossary/anycast-network/) and their request typically goes to the nearest Cloudflare data center. Cloudflare Tunnel will prefer to serve the request using `cloudflared` connections in the same data center. This behavior can impact how connections are weighted and traffic is distributed.

The solution depends on the type of tunnel being used. If running [legacy tunnels](/cloudflare-one/connections/connect-networks/do-more-with-tunnels/migrate-legacy-tunnels/), put your origins in different pools. If running [`cloudflared` replicas](/cloudflare-one/connections/connect-networks/configure-tunnels/tunnel-availability/) (using a shared UUID), switch to separate Cloudflare tunnels as distinct origins.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Legacy tunnel has been deprecated. Using different tunnels is the only way now.

3. Under **Split Tunnels**, check whether your [Split Tunnels mode](/cloudflare-one/connections/connect-devices/warp/configure-warp/route-traffic/split-tunnels/#change-split-tunnels-mode) is set to **Exclude** or **Include**.
4. Select **Manage**. Depending on the mode:

- **Exclude mode**: Delete the IP range that contains your load balancer IP. For example, if your load balancer has a Cloudflare-assigned CGNAT IP, delete `100.64.0.0/10`. We recommend [adding back the IPs](/cloudflare-one/connections/connect-networks/private-net/cloudflared/connect-cidr/#3-route-private-network-ips-through-warp) that are not being used by your load balancer.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use another private IP range to avoid confusion for CGNAT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants