Skip to main content
Private connectivity lets pods in your cluster reach ngrok private endpoints by their real URL, such as https://demo.ngrok.direct. Private endpoints are ngrok endpoints on *.ngrok.direct with no public address. Use it when a service your workloads need runs in another network, and you don’t want to expose it to the public internet. In the Helm chart, the feature is ngrok.features.privateEndpoints, and the Operator tracks each endpoint as a PrivateEndpoint resource.
Private connectivity is in preview and off by default. Request access in your ngrok dashboard It requires Helm chart 0.25.0 or later.

How it works

When you enable the feature, the Operator:
  1. Polls your account every 10 seconds for *.ngrok.direct endpoints and mirrors each one as a PrivateEndpoint resource in the Operator namespace.
  2. Creates a ClusterIP Service for each hostname in the Operator namespace. demo.ngrok.direct becomes the Service demo-ngrok-direct, with one port for each endpoint port.
  3. Runs a private-endpoint-forwarder Deployment behind those Services. It accepts connections and opens a private dial connection to the matching endpoint through ngrok.
You configure cluster DNS to resolve demo.ngrok.direct to the demo-ngrok-direct Service. The forwarder copies bytes in both directions. It doesn’t terminate TLS or read headers, so what your client sees depends on the endpoint’s scheme: The Operator doesn’t mirror *.internal endpoints, or endpoints with the kubernetes binding, which bindings handle.

Private connectivity vs. bindings

Kubernetes bindings also let pods reach ngrok endpoints without public exposure. Private connectivity is intended to replace them, so use it for new setups. Both can run in the same install without overlapping.

Prerequisites

  • Helm chart 0.25.0 or later.
  • An access token that includes gateway:endpoints:connect. The Quick select → Kubernetes Operator preset includes it.
  • Permission to change your cluster’s DNS configuration.
  • Outbound access from the forwarder pods to h2.connect-endpoint.ngrok.com on TCP/443. QUIC also uses quic.connect-endpoint.ngrok.com on UDP/443 when it’s allowed. See Network egress.

Enable private connectivity

Add this to your Operator’s Helm values, then install or upgrade as usual (see Update the Operator):
The forwarder uses the same access token as the rest of the Operator. If your credentials come from an existing Secret, add a PRIVATE_ENDPOINTS_ACCESS_TOKEN key to it before upgrading, or the forwarder won’t start. Confirm the forwarder is running:

Configure cluster DNS

Your cluster DNS must resolve each <label>.ngrok.direct name to the ClusterIP of the <label>-ngrok-direct Service in the Operator namespace. The Operator doesn’t change cluster DNS, so you add this yourself. On CoreDNS, one rewrite rule covers every endpoint:
Replace ngrok-operator if you installed into a different namespace, and cluster.local if your cluster uses a different domain. Names that don’t match an existing Service return NXDOMAIN. The rule is the same on every CoreDNS cluster. Where you put it depends on who manages CoreDNS. If Helm, GitOps, or Terraform owns your CoreDNS config, make the change there so it isn’t reverted.
Edit the coredns ConfigMap and add the rule inside the existing .:53 { } block. Don’t add a second server block.
For kind, the Operator repo includes a script that applies the rule for you.
If your cluster DNS can’t apply a rewrite rule or forward to a server that can, add a record for each private endpoint hostname that points at its Service’s ClusterIP. tcp and tls endpoints also work without any DNS change if clients call the Service name directly, such as demo-ngrok-direct.ngrok-operator:5432. http and https endpoints don’t, because ngrok rejects requests whose Host header isn’t the endpoint’s hostname.

Test the connection

Start a private endpoint in the same ngrok account as the Operator, pointing at a service you want to reach. For example, with the agent:
Within about 10 seconds, the Operator mirrors it:
Then send a request from a pod:

Configuration

See Helm values for the rest.

Limitations

  • Every pod in the cluster can reach every mirrored endpoint. Sending the calling pod’s identity, so Traffic Policy can restrict access by namespace, is coming soon.
  • Only single-label hostnames work: <label>.ngrok.direct, where the label starts with a letter, uses lowercase letters, digits, and -, and is at most 50 characters.
  • A cluster supports up to 1,000 endpoint ports.
  • IPv4 only.
  • Only one Operator install per cluster can serve private endpoints, because the DNS rule points at a single namespace.

Troubleshooting

No PrivateEndpoint for an endpoint. Check the hostname ends in .ngrok.direct, the endpoint is in the same account as the Operator, and it doesn’t use the kubernetes binding. PrivateEndpoint isn’t ready. The Ready condition’s reason tells you why: Ready means the Service is configured. It doesn’t confirm the endpoint is reachable. Forwarder pod isn’t ready. Check its logs. Common causes are a missing PRIVATE_ENDPOINTS_ACCESS_TOKEN key, a token without gateway:endpoints:connect, or blocked egress.
421 Misdirected Request. The request’s Host header isn’t the endpoint’s hostname, usually because the client called the Service name instead of the *.ngrok.direct URL. DNS doesn’t resolve. If every *.ngrok.direct name returns NXDOMAIN, the DNS rule is missing or wasn’t loaded. If only one does, check its Service exists and the namespace in the rule matches.

Disable or uninstall

Disabling the feature or uninstalling the Operator leaves the per-hostname Services behind. Delete them, then remove the DNS rule:
If you only disabled the feature, also run kubectl -n ngrok-operator delete privateendpoints --all.