Overview of Cloudflare Operator
mainThe Cloudflare Operator is a Kubernetes Operator designed to automate the deployment and management of Cloudflare Tunnels and DNS records for Kubernetes Service resources (supporting HTTP, TCP, and early-access UDP).
Built using operator-sdk, it provides a dynamic way to run the cloudflared daemon on Kubernetes. Key capabilities include:
- Tunnel Management: Create and use existing Tunnels for Cloudflare for Teams via Custom Resources (CR/CRD). This includes managing Cloudflare API credentials via Secrets, running scaled
cloudflaredDeployments, and managing associated ConfigMaps. Tunnels can be scoped to either the Cluster or a Namespace. - TunnelBinding Controller: Automates the connection between a Tunnel and a Service. It updates the
cloudflaredConfigMap, restarts thecloudflaredDeployment to apply changes, and creates a proxied CNAME DNS entry in Cloudflare. It also handles cleanup (reversing these actions) when aTunnelBindingis deleted using Kubernetes Finalizers.