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

1

Install the KTube CLI

$ curl -sSL https://ktube.dev/install.sh | bash

Verify the installation:

$ ktube version
2

Install KTube in Your Cluster

If you have an existing cluster:

$ ktube install

If you do not have a cluster:

$ ktube cluster create
$ ktube install
3

Open the Dashboard

$ ktube dashboard

Opens the KTube dashboard at https://console.ktube.dev

4

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_AUTHTOKEN

3. Create a TunnelProvider:

apiVersion: ktube.dev/v1alpha1
kind: TunnelProvider
metadata:
  name: ngrok-provider
spec:
  type: ngrok
  ngrok:
    authTokenSecretRef:
      name: ngrok-credentials
      key: authtoken
5

Create a Tunnel

Create a test deployment if you do not have one:

$ kubectl create deployment nginx --image=nginx
$ kubectl expose deployment nginx --port=80

Create 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: 80

Check the tunnel status:

$ kubectl get tunnelbindings
🎉 Your service is now accessible from the internet!

Next Steps

Troubleshooting

Binding stuck in Pending status?

Check that your provider credentials are correct:

kubectl describe tunnelprovider ngrok-provider

Need more help? Open an issue on GitHub.