cloudflared

by Community Helm Charts

Helm chartv2.2.19App 2026.9.3Apache-2.0Verified publisher

A Helm chart for cloudflare tunnel

About this chart

cloudflared

A Helm chart for cloudflare tunnel

Official Documentation

For detailed usage instructions, configuration options, and additional information about the cloudflared Helm chart, refer to the official documentation.

Get Helm Repository Info

helm repo add community-charts https://community-charts.github.io/helm-charts
helm repo update

See helm repo for command documentation.

Installing the Chart

Tip: The creation of a Cloudflare account and the setup of a Cloudflared tunnel are prerequisites for using this chart. These steps are not included as part of the chart installation process and must be completed beforehand.

Prerequisites

  1. Create a Cloudflare Account If you do not yet have a Cloudflare account, please refer to Cloudflare's official documentation to create one.

  2. Set Up a Cloudflared Tunnel If you already have a Cloudflare account and have added your domain to it, follow the first three steps in this guide to create a Cloudflared tunnel using the CLI.

  3. Store Tunnel Files After creating your Cloudflared tunnel via CLI, ensure the following files are stored in the ~/.cloudflared directory under your home directory:

    • Your tunnel credentials JSON file.
    • Your tunnel certificate PEM file.

Encoding and Configuring Tunnel Files

To configure the chart, encode the required tunnel files using the following commands and set their values accordingly:

  1. Encode the Tunnel Credentials JSON File Use the following command to obtain the base64-encoded version of your tunnel credentials JSON file and set it in the tunnelSecrets.base64EncodedConfigJsonFile configuration:

    base64 -b 0 -i ~/.cloudflared/*.json
    

    If the above command did not work due to OS differences, you can simply use the command below.

    cat ~/.cloudflared/*.json | base64
    
  2. Encode the Tunnel Certificate PEM File Use the following command to obtain the base64-encoded version of your tunnel certificate PEM file and set it in the tunnelSecrets.base64EncodedPemFile configuration:

    base64 -b 0 -i ~/.cloudflared/cert.pem
    

    If the above command did not work due to OS differences, you can simply use the command below.

    cat ~/.cloudflared/cert.pem | base64
    
  3. Set the Tunnel Name Pass the name of your tunnel, as created earlier via the Cloudflared CLI, to the tunnelConfig.name configuration.

Setting Credentials to Kubernetes Secrets and working with Existing Secrets

cp ~/.cloudflared/*.json ./credentials.json
kubectl create secret generic config-json-file-secret -n cloudflare --from-file=credentials.json

kubectl create secret generic cert-pem-file-secret -n cloudflare --from-file=~/.cloudflared/cert.pem

And use the following configuration rather than base64 versions.

tunnelSecrets:
  existingConfigJsonFileSecret:
    name: config-json-file-secret
  existingPemFileSecret:
    name: cert-pem-file-secret

Configuring Ingress

The default ingress configuration is shown below. Replace the placeholder values with your domain and server settings. It is recommended to use a separate values.yaml file to manage this configuration.

ingress:
  - hostname: example.com # or "*.example.com" (ensure a CNAME record for "*" is defined in your DNS)
    service: http://traefik.kube-system.svc.cluster.local:80

  - service: http_status:404

Installing the Chart

Use the following helm command to install or upgrade the chart. Replace the placeholders with your specific values:

helm upgrade --install -f values.yaml [RELEASE_NAME] community-charts/cloudflared -n [NAMESPACE] --create-namespace \
  --set=tunnelSecrets.base64EncodedConfigJsonFile=$(base64 -b 0 -i ~/.cloudflared/*.json) \
  --set=tunnelSecrets.base64EncodedPemFile=$(base64 -b 0 -i ~/.cloudflared/cert.pem) \
  --set=tunnelConfig.name=[TUNNEL_NAME]

See configuration below.

See helm install for command documentation.

Tip: Search all available chart versions using helm search repo community-charts -l. Please don't forget to run helm repo update before the command.

Upgrading

This section outlines major updates and breaking changes for each version of the Helm Chart to help you transition smoothly between releases.


Version-Specific Upgrade Notes

Upgrading to 2.x.x

Breaking Changes

  • Your Kubernetes server must be at or later than version v1.21.

Requirements

Kubernetes: >=1.21.0-0

Uninstall Helm Chart

helm uninstall [RELEASE_NAME]

This removes all the Kubernetes components associated with the chart and deletes the release.

See helm uninstall for command documentation.

Upgrading Chart

helm upgrade [RELEASE_NAME] community-charts/cloudflared

Values

KeyTypeDefaultDescription
affinityobject{}For more information checkout: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity
fullnameOverridestring""
imageobject{"pullPolicy":"IfNotPresent","repository":"cloudflare/cloudflared","tag":""}This sets the container image more information can be found here: https://kubernetes.io/docs/concepts/containers/images/
image.pullPolicystring"IfNotPresent"This sets the pull policy for images.
image.repositorystring"cloudflare/cloudflared"The docker image repository to use
image.tagstring""Overrides the image tag whose default is the chart appVersion.
imagePullSecretslist[]This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
ingresslist[{"hostname":"example.com","service":"http://traefik.kube-system.svc.cluster.local:80"},{"service":"http_status:404"}]Cloudflare ingress rules. More information can be found here: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/configure-tunnels/local-management/configuration-file/#how-traffic-is-matched
livenessProbeobject{"failureThreshold":1,"httpGet":{"path":"/ready","port":2000},"initialDelaySeconds":10,"periodSeconds":10}This is for configuring the liveness probe. For more information checkout: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
nameOverridestring""This is to override the chart name.
nodeSelectorobject{"kubernetes.io/os":"linux"}For more information checkout: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector
podAnnotationsobject{}This is for setting Kubernetes Annotations to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
podLabelsobject{}This is for setting Kubernetes Labels to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
podSecurityContextobject{"fsGroup":65532,"fsGroupChangePolicy":"OnRootMismatch","sysctls":[{"name":"net.ipv4.ping_group_range","value":"0 2147483647"}]}This is for setting Security Context to a Pod. For more information checkout: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
readinessProbeobject{"httpGet":{"path":"/ready","port":2000},"initialDelaySeconds":10,"periodSeconds":10}This is for configuring the readiness probe. For more information checkout: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
replicaobject{"allNodes":true,"count":1}This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/
replica.allNodesbooltrueThis will use DaemonSet to deploy cloudflared to all nodes
replica.countint1If previous flag disabled, this will use Deployment to deploy cloudflared only number of following count
resourcesobject{}This block is for setting up the resource management for the pod more information can be found here: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
securityContextobject{"allowPrivilegeEscalation":false,"capabilities":{"add":[],"drop":["ALL"]},"privileged":false,"readOnlyRootFilesystem":true,"runAsGroup":65532,"runAsNonRoot":true,"runAsUser":65532}This is for setting Security Context to a Container. For more information checkout: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/
serviceAccountobject{"annotations":{},"automount":true,"create":true,"name":""}This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.automountbooltrueAutomatically mount a ServiceAccount's API credentials?
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
terminationGracePeriodSecondsint30
tolerationslist[{"effect":"NoSchedule","operator":"Exists"}]For more information checkout: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
tunnelConfigobject{"autoUpdateFrequency":"24h","connectTimeout":"30s","gracePeriod":"30s","logLevel":"info","metricsUpdateFrequency":"5s","name":"","noAutoUpdate":true,"protocol":"auto","retries":5,"transportLogLevel":"warn","warpRouting":false}Please find more configuration from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/configuration/arguments/
tunnelConfig.namestring""cloudflared tunnel name
tunnelSecretsobject{"base64EncodedConfigJsonFile":"","base64EncodedPemFile":"","existingConfigJsonFileSecret":{"key":"credentials.json","name":""},"existingPemFileSecret":{"key":"cert.pem","name":""}}This is for setting up the cloudflared tunnel secrets. For more information checkout: https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/do-more-with-tunnels/local-management/create-local-tunnel/
tunnelSecrets.base64EncodedConfigJsonFilestring""This is for cloudflared tunnel configuration JSON file.
tunnelSecrets.base64EncodedPemFilestring""This is for cloudflared tunnel certificate PEM file.
tunnelSecrets.existingConfigJsonFileSecretobject{"key":"credentials.json","name":""}This is for setting up the existing secret for the cloudflared tunnel configuration JSON file. If not set, the base64EncodedConfigJsonFile will be used.
tunnelSecrets.existingConfigJsonFileSecret.keystring"credentials.json"This is the key of the configuration JSON file in the existing secret.
tunnelSecrets.existingConfigJsonFileSecret.namestring""This is the name of the existing secret.
tunnelSecrets.existingPemFileSecretobject{"key":"cert.pem","name":""}This is for setting up the existing secret for the cloudflared tunnel certificate PEM file. If not set, the base64EncodedPemFile will be used.
tunnelSecrets.existingPemFileSecret.keystring"cert.pem"This is the key of the certificate PEM file in the existing secret.
tunnelSecrets.existingPemFileSecret.namestring""This is the name of the existing secret.
updateStrategy.rollingUpdate.maxUnavailableint1
updateStrategy.typestring"RollingUpdate"

Homepage: https://github.com/cloudflare/cloudflared

Source Code

Chart Development

Please install unittest helm plugin with helm plugin install https://github.com/helm-unittest/helm-unittest.git command and use following command to run helm unit tests.

helm unittest --strict --file 'unittests/**/*.yaml' charts/cloudflared

Maintainers

NameEmailUrl
burakince[email protected]https://www.burakince.com

Deploy cloudflared with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has 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 chartcloudflared is pinned at v2.2.19 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