Spectrum
import { Render, DashButton } from "~/components";
You can configure Spectrum with Load Balancing to bring resiliency to your TCP or UDP based applications.
Leverage health monitors, failover, and traffic steering by selecting a load balancer as Origin when creating your Spectrum application.
The exact settings will vary depending on your use case. Refer to the following steps to understand the workflow.
Set up
1. Configure your load balancer
-
In the Cloudflare dashboard, go to the Load Balancing page.
-
Select an account where the Load Balancing add-on is enabled.
-
Go to Load Balancing and select Create load balancer.
-
On the Load Balancer Setup, select Public load balancer
-
Choose the website to which you want to add this load balancer.
-
On the Hostname page, define the settings presented and select Next.
-
Enter a Hostname, which is the DNS name at which the load balancer is available. For more details on record priority, refer to DNS records for load balancing. :::caution
To prevent issues with DNS resolution, the load balancer hostname should be different from the hostname (or domain) you intend to define for your Spectrum application. :::
-
Keep the orange cloud icon enabled, meaning the load balancer is proxied. This refers to the proxy mode and, with Spectrum, traffic is always proxied.
-
Keep Session Affinity and Failover across pools disabled as these features are not supported with Spectrum.
-
-
On the Add a Pool page, define the settings presented and select Next.
- Select one or more existing pools or create a new pool [^1].
- If needed, update the fallback pool [^2].
-
On the Monitors page, define the settings presented and select Next.
- Review the monitors attached to your pools.
- If needed, you can attach an existing monitor or create a new monitor. :::caution[IP Access Rules and health checks] If your Spectrum application is used as a Load Balancer endpoint and has IP Access Rules enabled, Cloudflare's health check probes must be allowed by your rules. Otherwise, health checks will be blocked and all endpoints will be marked as unhealthy. To resolve this, add Cloudflare IP addresses to your IP Access Rules allowlist. Refer to Spectrum Troubleshooting for details. This does not apply when the Spectrum application's origin is a Load Balancer hostname. In that architecture, the monitor probes the origin directly and is not affected by IP Access Rules on the Spectrum app. :::
-
On the Traffic Steering page, choose an option for Traffic steering and select Next.
-
Keep Custom Rules page empty as this feature is not supported with Spectrum.
-
On the Review page:
- Review your configuration and make any changes.
- If you set traffic steering to Off, re-order the pools in your load balancer to adjust the fallback order.
- If you chose to set traffic steering to Random, you can set weights to your pools (via the API) to determine the percentage of traffic sent to each pool.
- Choose whether to Save as Draft or Save and Deploy.
2. Configure your Spectrum application
Limitations
[^1]: Within Cloudflare, pools represent your endpoints and how they are organized. As such, a pool can be a group of several endpoints, or you could also have only one endpoint (an origin server, for example) per pool.
[^2]: A fallback pool is the pool of last resort. When all pools are disabled or unhealthy, this is where the load balancer will send traffic.
谢谢你的反馈!