Skip to main content
You can use the following custom annotations with the ngrok Kubernetes Operator to extend the functionality of various resources.
Operator 0.22 (Helm chart 0.24) moved these annotations from the k8s.ngrok.com/ prefix to ngrok.com/. The legacy keys, such as k8s.ngrok.com/traffic-policy, still work until Operator 1.0, but the Operator emits a LegacyAnnotation warning event for each Ingress, Gateway, or LoadBalancer Service that uses them. If a resource sets both keys, the ngrok.com/ key wins. Operator versions before 0.22 only read the k8s.ngrok.com/ prefix.

ngrok.com/traffic-policy

Allows you to supply an NgrokTrafficPolicy to an Ingress or Gateway resource. For more information about using Traffic Policies with Ingresses and Gateway API, see the using Ingresses page and the using Gateway API page. Usable On: Ingress/Gateway Example:

ngrok.com/mapping-strategy

Allows you to control the way that the Operator translates Ingress, Gateway, and LoadBalancer type Services into ngrok custom resources. These resources are always translated into CloudEndpoint and AgentEndpoint custom resources. By default ("endpoints"), when a hostname routes to only one upstream service, the Operator creates a single public AgentEndpoint for it instead of a CloudEndpoint that routes to an internal AgentEndpoint. With "endpoints-verbose", every hostname gets a CloudEndpoint and each unique upstream service gets an internal AgentEndpoint, which can cost less when you run more than one agent replica. For more information about how the Operator translates resources, see the using Ingresses page and the using Gateway API page. Usable On: Ingress/Gateway Allowed Values: "endpoints"/"endpoints-verbose"

ngrok.com/pooling-enabled

Allows you to configure whether pooling should be enabled/disabled when the Operator translates Ingress and Gateway resources into CloudEndpoints. By default, translated CloudEndpoint resources have poolingEnabled set to false, but this annotation allows you to enable it. For more information about endpoint pooling, see the pooling page. Usable On: Ingress/Gateway Allowed Values: "true"/"false" Example:
Due to how Kubernetes handles annotation values, the value of ngrok.com/pooling-enabled must be a string (“true”). Setting the value to true without surrounding it with quotes doesn’t work.

ngrok.com/bindings

Allows you to specify the binding that should be used when the Operator translates Ingress and Gateway resources into CloudEndpoints. By default, the Operator uses a binding of "public", but this annotation allows you to create internal or Kubernetes bound CloudEndpoints instead. For more information about bindings, see the bindings page. Usable On: Ingress/Gateway Allowed Values: "internal"/"public"/"kubernetes" Example:

ngrok.com/app-protocols

Allows you to specify the protocol of ports on your service. Accepts a value that is a JSON string which maps the name of the ports on your Service to http or https. This annotation is optional, and when not used or a named port is not included in the annotation’s value, the ngrok Kubernetes Operator defaults to using http for that port. Usable On: Service Example: The following example marks the following service as having one port that is https and one port that is http.