Welcome to this example project for setting up a Cloudflare Tunnel on a home Raspberry Pi cluster! This guide assumes you have a Raspberry Pi cluster running with K3s installed using the K3s Ansible script. Note that the K3s installation is not covered in this example. For additional guidance, you may find Nima Mahmoudi's blog post and Cloudflare's official Kubernetes example helpful for building your solution.
Great news! The official Cloudflare Docker Hub repository now supports the arm64 architecture, so you can confidently use the official images for your Raspberry Pi setup. This Helm chart has been updated to leverage these images. Feel free to explore and use this chart to simplify your Cloudflare Tunnel deployment. Happy deploying!
For production environments, we recommend using the well-maintained community-charts Cloudflared Helm chart instead of this example chart. It offers robust features and ongoing support from the community, ensuring a reliable and secure deployment.
- Helm Chart: Cloudflared on ArtifactHub
- Documentation: Official Community Charts Documentation
- Source Code: Community Charts GitHub Repository
To get started, install the Cloudflare CLI (cloudflared) on your local machine:
brew update && brew install cloudflaredAuthenticate with Cloudflare and create a tunnel for your Raspberry Pi cluster:
cloudflared tunnel logincloudflared tunnel create pi-clusterYou can deploy the Cloudflare Tunnel to your Kubernetes cluster using the provided Helm chart. Simply run the following command to execute the deployment script:
./run.shAlternatively, if you prefer manual deployment, copy your tunnel credentials to the files folder and run the following Helm command:
helm upgrade --install \
--namespace cloudflare \
--create-namespace \
cloudflare \
./charts/cloudflaredYou can customize your deployment by creating a values.yaml file to specify your settings. Below is an example values.yaml configuration:
replica:
allNodes: true
tunnelConfig:
name: "pi-cluster"
protocol: quic
ingress:
- hostname: "*.example.com"
service: http://traefik.kube-system.svc.cluster.local:80
- service: http_status:404Note: Changes to the values.yaml file are ignored in this repository to maintain consistency.

