Skip to content

burakince/cloudflare-tunnel-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cloudflare Tunnel Example for Raspberry Pi Cluster

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!

Production Usage

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.

Install the Cloudflare CLI

To get started, install the Cloudflare CLI (cloudflared) on your local machine:

brew update && brew install cloudflared

Log In to Cloudflare and Create a Tunnel

Authenticate with Cloudflare and create a tunnel for your Raspberry Pi cluster:

cloudflared tunnel login
cloudflared tunnel create pi-cluster

Deploy the Cloudflare Tunnel to Your Raspberry Pi Cluster

You 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.sh

Alternatively, 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/cloudflared

Customizing Your Deployment

You 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:404

Note: Changes to the values.yaml file are ignored in this repository to maintain consistency.

Screenshots

Cloudflare Tunnel Dashboard

Cloudflare Tunnel

Raspberry Pi Cluster

Pi Cluster

About

cloudflare tunnel example for home raspberry pi cluster

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published