-
-
Couldn't load subscription status.
- Fork 68
InternalvsExternalcloudflared.md
Chris edited this page Apr 22, 2025
·
4 revisions
DockFlare can operate in two distinct modes regarding the cloudflared agent (the software that establishes the connection to Cloudflare's edge):
-
How it works: DockFlare takes full responsibility for the
cloudflaredagent lifecycle.- It creates a Cloudflare Tunnel resource using the
TUNNEL_NAMEyou provide. - It retrieves the tunnel's unique credentials (Tunnel Token).
- It deploys and manages a dedicated
cloudflaredDocker container (namedcloudflared-agent-<your-tunnel-name>). This container uses the retrieved token to connect to Cloudflare. - DockFlare ensures this agent container is running and restarts it if necessary.
- DockFlare configures ingress rules directly on the tunnel it manages.
- It creates a Cloudflare Tunnel resource using the
-
Configuration:
-
USE_EXTERNAL_CLOUDFLARED=false(or omitted, as this is the default). -
TUNNEL_NAMEenvironment variable is required.
-
-
Pros:
- Simplest setup: DockFlare handles everything tunnel-related.
- Self-contained: No need to manage a separate
cloudflaredinstance.
-
Cons:
- Creates a dedicated tunnel just for DockFlare's managed services. May not be ideal if you already have existing tunnels you want to reuse.
-
How it works: You manage the
cloudflaredagent yourself, and DockFlare only handles the configuration within that existing tunnel.- You must have an existing Cloudflare Tunnel created (either manually via the dashboard or using
cloudflaredcommands). - You must run the
cloudflaredagent yourself (as a service, another Docker container, etc.) and ensure it's connected to Cloudflare using your tunnel's credentials. - DockFlare connects to the Cloudflare API and modifies the configuration (ingress rules) and associated DNS records for the existing tunnel you specify.
- DockFlare does not create a tunnel or run the
cloudflaredagent container itself.
- You must have an existing Cloudflare Tunnel created (either manually via the dashboard or using
-
Configuration:
-
USE_EXTERNAL_CLOUDFLARED=trueenvironment variable is required. -
EXTERNAL_TUNNEL_IDenvironment variable is required. You need to provide the UUID of your existing tunnel. See Finding Your Tunnel ID. -
TUNNEL_NAMEenvironment variable is ignored.
-
-
Pros:
- Allows integration with existing
cloudflaredsetups. - Enables sharing a single tunnel across multiple applications or controllers.
- Gives you more control over the
cloudflaredagent's deployment and configuration.
- Allows integration with existing
-
Cons:
- Requires more setup: You are responsible for creating the tunnel and running the agent correctly.
- Requires finding and providing the
EXTERNAL_TUNNEL_ID.
-
Use Internal Mode if:
- You are new to Cloudflare Tunnels and want the easiest setup.
- You want DockFlare to manage the entire tunnel lifecycle for the services it exposes.
-
Use External Mode if:
- You already have a
cloudflaredtunnel running for other purposes and want DockFlare to add rules to it. - You prefer to manage the
cloudflaredagent deployment separately. - You need fine-grained control over the
cloudflaredagent's parameters.
- You already have a
See also:
-
External
cloudflaredMode for setup details. - Switching Between Modes for migration steps.