Follow these steps to install the controller using Helm and expose a Kubernetes Service through a Cloudflare Tunnel using a standard Ingress resource.
Prerequisites
- Kubernetes Cluster: Version 1.26 or later with
cluster-admin access. - Tools:
kubectl and helm configured for your cluster. - Cloudflare Account: An active zone with Argo Tunnel access enabled.
- Cloudflare API Token: Must have the following permissions:
Account.Cloudflare Tunnel:EditZone.DNS:EditZone.Zone:Read
- Cloudflare Account ID.
- Target Service: A service (e.g.,
kubernetes-dashboard in the kubernetes-dashboard namespace) that you want to expose.
1. Install the controller
Use Helm to install the controller and create the necessary credential Secret. Replace the placeholders with your actual API token, account ID, and desired tunnel name.
helm upgrade --install --wait \
cloudflare-tunnel-ingress-controller \
cloudflare-tunnel-ingress-controller \
--repo https://helm.strrl.dev \
--namespace cloudflare-tunnel-ingress-controller \
--create-namespace \
--set cloudflare.apiToken="<CLOUDFLARE_API_TOKEN>" \
--set cloudflare.accountId="<CLOUDFLARE_ACCOUNT_ID>" \
--set cloudflare.tunnelName="<TUNNEL_NAME>"
2. Create your first Ingress
To expose a service, create an Ingress resource with the ingressClassName set to cloudflare-tunnel.
- Save the following manifest as
dashboard-ingress.yaml. - Replace
dash.example.com with a hostname that exists in your Cloudflare zone.
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: dashboard
namespace: kubernetes-dashboard
spec:
ingressClassName: cloudflare-tunnel
rules:
- host: dash.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: kubernetes-dashboard
port:
number: 80
- Apply the manifest:
kubectl apply -f dashboard-ingress.yaml
3. Verify the Ingress
Access your service via https://<your-chosen-hostname>. If the service is configured correctly, it should load through the Cloudflare Tunnel.
helm upgrade --install --wait \
cloudflare-tunnel-ingress-controller \
cloudflare-tunnel-ingress-controller \
--repo https://helm.strrl.dev \
--namespace cloudflare-tunnel-ingress-controller \
--create-namespace \
--set cloudflare.apiToken="<CLOUDFLARE_API_TOKEN>" \
--set cloudflare.accountId="<CLOUDFLARE_ACCOUNT_ID>" \
--set cloudflare.tunnelName="<TUNNEL_NAME>"