Skip to content

ngrok

Let's see how to run ngrok in a Kubernetes cluster with the ngrok Kubernetes Operator.

Introduction

ngrok Kubernetes Operator was announced in June of 2023, read the blog post to know more about it.

Authentication

Log in dashboard.ngrok.com and retrieve the information:

KeyDashboard page
AUTHTOKENYour Authtoken
API_KEYAPI Keys

Domain reservation

Go to dashboard.ngrok.com/domains and click New Domain.

Repository

We'll use the official Helm chart:

bash
helm repo add ngrok https://charts.ngrok.com
helm repo update

Configuration

Create the values.yaml file to override default parameters.yaml.

yaml
# replicaCount: 1
# image:
#   registry: docker.io
#   repository: ngrok/ngrok-operator
#   tag: ""
# log:
#   format: json
#   level: info
#   stacktraceLevel: error
yaml
# kubectl create secret generic --namespace ngrok ngrok-operator-credentials --from-literal=AUTHTOKEN=[AUTHTOKEN] --from-literal=API_KEY=[API_KEY]
credentials:
  secret:
    name: "ngrok-credentials"
yaml
credentials:
  apiKey: "[AUTHTOKEN]"
  authtoken: "[API_KEY]"

Deployment

Install the application:

bash
helm upgrade --install ngrok-operator ngrok/ngrok-operator -f values.yaml --namespace ngrok --create-namespace

Watch objects being created:

bash
kubectl get pod -n ngrok

TIP

A new ingress class has been created with the default name ngrok

Usecases

Clean-up

Uninstall the application and delete the namespace:

bash
helm uninstall ngrok-operator -n ngrok
kubectl delete ns ngrok

Integrations