cloudflare

Expose K3s services via Cloudflare Tunnel and Access policies.

32|5|Updated Oct 6, 2024
One-click install
npx skills add https://github.com/gilesknap/tpi-k3s-ansible --skill cloudflare-gilesknap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cloudflare
Source: https://github.com/gilesknap/tpi-k3s-ansible/tree/main/.claude/skills/cloudflare
Command: npx skills add https://github.com/gilesknap/tpi-k3s-ansible --skill cloudflare-gilesknap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expose K3s services securely to the internet without direct public exposure.

Core Features & Use Cases

  • Cloudflare Tunnel runs as a pod in the cluster to expose services externally
  • Cloudflare Access wildcard policy on *.gkcluster.org protects all subdomains
  • End-to-end flow: Internet -> Cloudflare edge -> Tunnel pod -> NGINX Ingress -> Service
  • Exposed services include grafana, headlamp, open-webui, oauth2-proxy, argocd, echo, supabase (Studio + API)
  • Supabase endpoints: supabase.gkcluster.org (Studio UI behind OAuth) and supabase-api.gkcluster.org (Kong API gateway)

Quick Start

Enable the Cloudflare tunnel and Access policy manifests in kubernetes-services to bring the tunnel online.

Frequently Asked Questions about cloudflare

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose K3s services to the internet without direct public exposure?

You can expose K3s services securely by running a Cloudflare Tunnel pod inside your cluster to route internet traffic through the Cloudflare edge, avoiding direct public exposure of your nodes.

How does Cloudflare Tunnel integrate with NGINX Ingress to route external traffic?

Cloudflare Tunnel integrates with NGINX Ingress by routing traffic from the Cloudflare edge through the tunnel pod directly to the NGINX Ingress controller, which then forwards it to the target K3s service.

Can I protect Kubernetes dashboards and admin UIs using Cloudflare Access on K3s?

Yes, you can protect Kubernetes dashboards and admin UIs by applying a Cloudflare Access wildcard policy to secure all subdomains routed through the tunnel.

What is the best way to configure DNS for multiple K3s subdomains through a Cloudflare Tunnel?

The best way to configure DNS for multiple K3s subdomains is to use a wildcard policy on your domain, routing all subdomains through the Cloudflare Tunnel to the NGINX Ingress controller.

Does this Cloudflare Tunnel setup support exposing API gateways like the Supabase Kong API?

Yes, the setup supports exposing API gateways like the Supabase Kong API by routing the specific subdomain through the tunnel and NGINX Ingress to the backend service.

Do I need a separate Cloudflare Tunnel pod for each service I expose on my K3s cluster?

No, you do not need a separate tunnel pod for each service; a single Cloudflare Tunnel pod runs in the cluster and routes traffic to multiple services through the NGINX Ingress controller.