Getting Started
Get KTube running and expose your first service in under 5 minutes.
No Kubernetes cluster? No problem! KTube can create a local Kind cluster for you automatically.
Prerequisites
- Kubernetes cluster (v1.25+) - Or let KTube create one for you
- Docker - Only needed if creating a local cluster
Quick Start
Install the KTube CLI
$ curl -sSL https://ktube.dev/install.sh | bashVerify the installation:
$ ktube versionInstall KTube in Your Cluster
If you have an existing cluster:
$ ktube installIf you do not have a cluster:
$ ktube cluster create$ ktube installOpen the Dashboard
$ ktube dashboardOpens the KTube dashboard at https://console.ktube.dev
Create a Provider
Get credentials from your tunnel provider. We will use ngrok (free tier available).
1. Sign up for ngrok and get your authtoken
2. Create a Kubernetes secret:
kubectl create secret generic ngrok-credentials \ --from-literal=authtoken=YOUR_NGROK_AUTHTOKEN3. Create a TunnelProvider:
apiVersion: ktube.dev/v1alpha1
kind: TunnelProvider
metadata:
name: ngrok-provider
spec:
type: ngrok
ngrok:
authTokenSecretRef:
name: ngrok-credentials
key: authtokenCreate a Tunnel
Create a test deployment if you do not have one:
$ kubectl create deployment nginx --image=nginx$ kubectl expose deployment nginx --port=80Create a TunnelBinding to expose it:
apiVersion: ktube.dev/v1alpha1
kind: TunnelBinding
metadata:
name: nginx-binding
spec:
tunnelRef:
name: shared-tunnel
hostname: my-nginx.example.com
protocol: https
enabled: true
service:
name: nginx
port: 80Check the tunnel status:
$ kubectl get tunnelbindingsNext Steps
Try Cloudflare Tunnel
Set up for production with custom domains
CLI Reference
Discover all available CLI commands
Troubleshooting
Binding stuck in Pending status?
Check that your provider credentials are correct:
kubectl describe tunnelprovider ngrok-providerNeed more help? Open an issue on GitHub.