adyanth / cloudflare-operator

A Kubernetes Operator to create and manage Cloudflare Tunnels and DNS records for (HTTP/TCP/UDP*) Service Resources
https://adyanth.site/posts/migration-compose-k8s/cloudflare-tunnel-operator-architecture/
Apache License 2.0
355 stars 37 forks source link
cloudflare cloudflare-tunnel cloudflared kubernetes kubernetes-operator operator operator-sdk

Cloudflare Operator

Logo

A Kubernetes Operator to create and manage Cloudflare Tunnels and DNS records
for (HTTP/TCP/UDP*) Service Resources

Getting Started Guide »

Report Bug · Request Feature

GitHub license GitHub forks GitHub stars GitHub issues Go Report Card

NOTE: This project is currently in Alpha

UDP*: UDP support for Cloudflare Tunnels is in Early Access

Motivation

The Cloudflare Tunnels guide for deployment on Kubernetes provides a manifest which is very bare bones and does not hook into Kubernetes in any meaningful way. The operator started out as a hobby project of mine to deploy applications in my home lab and expose them to the internet via Cloudflare Tunnels without doing a lot of manual work every time a new application is deployed.

Overview

The Cloudflare Operator aims to provide a new way of dynamically deploying the cloudflared daemon on Kubernetes. Scaffolded and built using operator-sdk. Once deployed, this operator provides the following:

Bird's eye view

Here is how the operator and the Tunnel Resource fit into your deployment.

Operator Architecture

There is more detailed information on this architecture and the thought process behind it in my blog post.

Getting Started

Go through the dedicated documentation on Getting Started to learn how to deploy this operator and a sample tunnel along with a service to expose.

Look into the Configuration documentation to understand various configurable parameters of this operator.

NOTE: This is NOT an official operator provided/backed by Cloudflare Inc. It utilizes their v4 API and their cloudflared to automate setting up of tunnels on Kubernetes.