What you’ll need
- A MicroK8s cluster reachable with
kubectl. MicroK8s runs on a local workstation, an IoT device, a cloud virtual machine, or any system running one of the supported Linux flavors. If you don’t have a cluster yet, follow Canonical’s MicroK8s get-started guide. - An ngrok account.
kubectlinstalled on your local workstation.- The ngrok Kubernetes Operator installed on your cluster, along with the Gateway API CRDs.
- A reserved domain from the ngrok dashboard or API; this guide refers to it as
NGROK_DOMAIN.
Confirm your cluster is ready
Check that MicroK8s is running before you deploy anything:If you see
microk8s is running, your cluster is ready.Deploy an example app
Create a manifest named Apply the manifest to your cluster:
tinyllama.yaml with the following YAML.
It defines a service and deployment for the tinyllama demo LLM app.tinyllama.yaml showLineNumbers
Create a GatewayClass
A GatewayClass tells Kubernetes which controller manages your Gateways.
This one assigns them to the ngrok Kubernetes Operator.Create a file named Apply it to your cluster:
gatewayclass.yaml with the following YAML:gatewayclass.yaml
Route traffic to the app
The Gateway listens for requests to Apply the Gateway and HTTPRoute:
NGROK_DOMAIN, and the HTTPRoute sends those requests to the tinyllama service.Create a file named tinyllama-gateway.yaml with the following YAML, replacing NGROK_DOMAIN with your reserved domain:tinyllama-gateway.yaml showLineNumbers