TunnelBindings

A TunnelBinding connects a Kubernetes Service to a Tunnel, making the service accessible via the tunnel public URL.

TunnelBinding Resource

apiVersion: ktube.dev/v1alpha1
kind: TunnelBinding
metadata:
  name: my-app-binding
  namespace: default
spec:
  tunnelRef:
    name: my-tunnel
  hostname: my-app.example.com
  protocol: https
  enabled: true
  service:
    name: my-app-svc
    port: 8080
status:
  phase: Active
  url: https://my-app.example.com

Spec Fields

FieldTypeRequiredDescription
tunnelRef.namestringYesName of Tunnel to bind to
hostnamestringNoPublic hostname (provider may auto-generate)
protocolstringNohttp, https (default: https)
enabledbooleanNoEnable/disable binding (default: true)
service.namestringYesKubernetes Service name
service.portintegerYesService port to expose

Enable/Disable Feature

TunnelBindings can be enabled or disabled without deletion. When enabled: false, the binding is paused and the URL becomes inaccessible.

# Disable a binding
kubectl patch tunnelbinding my-app-binding \
  --type='merge' -p '{"spec":{"enabled":false}}'

# Re-enable
kubectl patch tunnelbinding my-app-binding \
  --type='merge' -p '{"spec":{"enabled":true}}'

Tip: Use the dashboard toggle to enable/disable bindings with one click.

Status Fields

FieldDescription
phasePending, Active, Disabled, Failed
urlPublic URL when active
messageStatus message or error details

Examples

Basic Binding

apiVersion: ktube.dev/v1alpha1
kind: TunnelBinding
metadata:
  name: web-binding
spec:
  tunnelRef:
    name: prod-tunnel
  protocol: https
  enabled: true
  service:
    name: web-frontend
    port: 80

With Custom Hostname

apiVersion: ktube.dev/v1alpha1
kind: TunnelBinding
metadata:
  name: api-binding
spec:
  tunnelRef:
    name: prod-tunnel
  hostname: api.mycompany.com
  protocol: https
  enabled: true
  service:
    name: api-server
    port: 8080

Related