Skip to main content

Endpoint Pooling with the Kubernetes Operator

Endpoint pooling is the concept of creating two or more endpoints that share the same URL and have pooling enabled (if you don't enable pooling for an endpoint it cannot have the same URL as another endpoint). The endpoint pooling page goes over concepts and details of pooling in more depth. This guide focuses on how to use and configure endpoint pooling while using the ngrok Kubernetes operator.

Note that while endpoint pooling is supported by the ngrok Kubernetes operator, endpoint pools are not specific to the environment in which they were created. This means that you can pool endpoints created with the Kubernetes operator with endpoints started using the CLI, etc. This is a powerful and important concept to keep in mind to avoid unwanted pooling.

note

Pooling must be enabled by all endpoints that share the same URL. Any attempt to create a pooled endpoint for a URL already in-use by a non-pooled endpoint will fail. Similarly, any endpoint attempting to create an endpoint that does not enable pooling and uses a URL that is already in-use by one or more endpoints with pooling enabled will fail.

Endpoint Pooling with AgentEndpoints

Within the Kubernetes operator, AgentEndpoint resources are currently Always Pooled. This means that if you create the same AgentEndpoint in two different Kubernetes clusters, or with a URL shared by any other type of endpoint that has pooling enabled, then they will all be part of the same pool. When the Kubernetes operator creates AgentEndpoint resources for you by translating Ingress and Gateway API resources, it will prefix the generated AgentEndpoint URL with a special hash to avoid unintended pooling.

Endpoint Pooling with CloudEndpoints

CloudEndpoint resources default to having pooling disabled, but you can enable it with the spec.poolingEnabled: true field such as with the following example.

Loading…

Endpoint Pooling with Ingresses

If you are using Ingress resources with the operator, you can enable endpoint pooling for an Ingress using the k8s.ngrok.com/pooling-enabled: "true" annotation. The following will create an Ingress that creates a CloudEndpoint with pooling enabled. Any other endpoint created with the same URL and pooling enabled will be pooled with the CloudEndpoint that this Ingress creates.

Loading…

Since the operator collapses Ingress resources that share the same hostname, you must make sure that all Ingress resources that use a given hostname use the same pooling enabled or disabled configuration. See the using Ingresses guide for more information.

Endpoint Pooling with Gateway API

If you are using Gateway API for configuration, you can enable pooling using the using the k8s.ngrok.com/pooling-enabled: "true" annotation on Gateway resources. The following will create a CloudEndpoint with pooling enabled. Any other endpoint created with the same URL and pooling enabled will be pooled with the CloudEndpoint.

Loading…