Skip to main content

How the ngrok Operator uses LoadBalancer services

By default, the Operator exposes services of type LoadBalancer using a TCP Endpoint. The Operator automatically creates a reserved address for the service and updates the service’s status with the reserved address. You can use other projects like external-dns to create a CNAME record for the reserved address automatically. See the TCP Endpoint and TLS Endpoint pages for more information about how ngrok handles these kinds of endpoints. For example, the Operator exposes the following LoadBalancer service using a TCP Endpoint.
If you’d like a TLS Endpoint instead, the following example shows how to create one. Set the k8s.ngrok.com/url annotation to a tls:// URL with your domain to expose the service as a TLS Endpoint. The endpoint passes TLS traffic through to your service without terminating it, so the service must serve TLS itself. Once the reserved domain is ready and the endpoint is created, the Operator updates the service’s status with the ngrok address.
While using Services offers simplicity, using the CloudEndpoint and AgentEndpoint resources directly instead of translating LoadBalancer services into them using the Operator offers more configuration options and flexibility for configuring TCP and TLS endpoints.