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.comSpec Fields
| Field | Type | Required | Description |
|---|---|---|---|
| tunnelRef.name | string | Yes | Name of Tunnel to bind to |
| hostname | string | No | Public hostname (provider may auto-generate) |
| protocol | string | No | http, https (default: https) |
| enabled | boolean | No | Enable/disable binding (default: true) |
| service.name | string | Yes | Kubernetes Service name |
| service.port | integer | Yes | Service 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
| Field | Description |
|---|---|
| phase | Pending, Active, Disabled, Failed |
| url | Public URL when active |
| message | Status 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: 80With 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: 8080Related
- Tunnels - Parent tunnel resource
- Architecture - How it all works together