tfy-cloudflared

by TrueFoundry

Helm chartv0.6.0App 2026.3.0MITVerified publisher

Cloudflare Tunnel client for secure, outbound-only connections between Kubernetes services and Cloudflare's network

About this chart

Tfy-cloudflared helm chart packaged by TrueFoundry

Tfy-cloudflared vendors the upstream Cloudflare Tunnel chart into this repository so it can be maintained and released from the TrueFoundry charts repo.

It deploys cloudflared for secure, outbound-only connections between services in your cluster and Cloudflare's network.

This chart also deploys Caddy resources for private endpoint routing.

Caddy private endpoint routing

When caddy.enabled=true, a Caddy reverse proxy is deployed alongside cloudflared. It accepts inbound requests forwarded by the Cloudflare tunnel and proxies them to in-cluster services.

URL scheme

All requests must include a <tunnel-identifier> prefix segment immediately followed by the target address. Four address formats are supported:

FormatExample URLBackend transport
/<tunnel-identifier>/http://host:port[/path]/my-tunnel/http://svc.ns.svc.cluster.local:8080/apiPlain HTTP
/<tunnel-identifier>/https://host:port[/path]/my-tunnel/https://svc.ns.svc.cluster.local:443/apiTLS (SNI from host)
/<tunnel-identifier>/https/host:port[/path]/my-tunnel/https/svc.ns.svc.cluster.local:443/apiTLS (SNI from host)
/<tunnel-identifier>/host:port[/path]/my-tunnel/svc.ns.svc.cluster.local:8080/apiPlain HTTP

The <tunnel-identifier> segment is consumed by Caddy and is not forwarded to the upstream service. The remaining path after the host:port is forwarded as-is.

Restricting upstream hosts (caddy.allowedHosts)

By default Caddy proxies to whatever host:port is present in the request path, i.e. any address reachable from the Caddy pod's network. In a shared cluster this means the blast radius is "anything the pod can reach", not just the services you intend to expose.

Set caddy.allowedHosts to lock routing down to an explicit allowlist:

caddy:
  allowedHosts:
    - my-mcp-server.internal
    - some-svc.my-namespace.svc.cluster.local

When the list is non-empty, only those hostnames are routable across all four URL formats; requests to any other target return 404. Entries are hostnames only — do not include a port (the port is still taken from the request path). Hostnames are matched exactly (regex metacharacters are escaped), so svc.ns.svc.cluster.local will not match evil-svc.ns.svc.cluster.local.

Onboarding a new host is a values change followed by helm upgrade. The Caddy config is mounted via subPath (which does not hot-reload), but the deployment carries a checksum/config annotation, so the upgrade rolls the Caddy pods automatically to pick up the new allowlist.

An empty list (the default) preserves the previous behaviour of proxying to any reachable host.

Parameters

Configuration values for tfy-cloudflared

NameDescriptionValue
nameOverrideName override""
fullnameOverrideFull name override for the tfy-cloudflared chart""
commonLabelsCommon labels added to all resources{}
commonAnnotationsCommon annotations added to all resources{}
image.repositoryImage repository for cloudflaredtfy.jfrog.io/tfy-mirror/cloudflare/cloudflared
image.tagImage tag for cloudflared2026.3.0
image.pullPolicyImage pull policyIfNotPresent
imagePullSecretsImage pull secrets[]
tunnel.tokenTunnel token obtained from the Cloudflare dashboard""
tunnel.existingSecretName of an existing secret containing the tunnel token""
tunnel.existingSecretKeyKey inside the existing secret that stores the tunnel tokentoken
cloudflared.logLevelLog level for the cloudflared processinfo
cloudflared.noAutoupdateDisable auto-update for cloudflaredtrue
cloudflared.metricsPortMetrics listen port used for /ready and /metrics2000
cloudflared.extraArgsExtra arguments appended to the cloudflared command[]
cloudflared.extraEnvExtra environment variables for the cloudflared container[]
cloudflared.networkPolicy.enabledCreate a NetworkPolicy on the cloudflared pods so incoming tunnel requests can only be forwarded to the Caddy router (port 80) and no other in-cluster pod. DNS and the external Cloudflare edge are allowed separately (see below). Ingress is restricted to the metrics port (which also serves the probes). Requires a CNI that enforces NetworkPolicy; it is inert otherwise.true
cloudflared.networkPolicy.ingress.allowedFromNetworkPolicyPeer entries allowed to reach the cloudflared metrics port. Empty (default) allows ingress from anywhere to that port only.

Deploy tfy-cloudflared with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has tfy-cloudflared on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the charttfy-cloudflared is pinned at v0.6.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply