Skip to content

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

License

Notifications You must be signed in to change notification settings

PowerBootWS/cloudflare-operator

Repository files navigation

Cloudflare Operator

Go Report Card

This is not an official operator provided/backed by Cloudflare Inc.

NOTE: This project is currently in Alpha

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:

  • Ability to create new and use existing Tunnels for Cloudflare for Teams using Custom Resources (CR/CRD) which will:
    • Accept a Secret for Cloudflare API Tokens and Keys
    • Run a scaled (configurable) Deployment of cloudflared
    • Manage a ConfigMap for the above Deployment
  • A Service controller which monitors Service Resources for Annotations and do the following:
    • Update the cloudflared ConfigMap to include the new Service to be served
    • Restart the cloudflared Deployment to make the configuration change take effect
    • Add a DNS entry in Cloudflare for the specified domain to be a proxied CNAME to the referenced tunnel
    • Reverse the above when the Service is deleted using Finalizers

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.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 90.6%
  • Makefile 7.9%
  • Dockerfile 1.5%