annotations

package
v0.0.0-...-981805a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ComputedURLAnnotation is the annotation key for the computed URL of an endpoint.
	// This is temporarily used by the Service controller to store reserved TCP addresses,
	// while we work to add support for assigning TCP addresses to Cloud/Agent Endpoints
	// when their URL is specified as 'tcp://', for example.
	ComputedURLAnnotation = "k8s.ngrok.com/computed-url"
	ComputedURLKey        = "computed-url"

	// DeniedKeyName name of the key that contains the reason to deny a location
	DeniedKeyName = "Denied"

	// This annotation can be used on services to listen on a specific domain(i.e. a TLS endpoint)
	// Deprecated: Use the URL annotation instead
	DomainAnnotation = "k8s.ngrok.com/domain"
	DomainKey        = "domain"

	// This annotation can be used on ingress/gateway resources to control which ngrok resources (endpoints/edges) get created from it
	MappingStrategyAnnotation    = "k8s.ngrok.com/mapping-strategy"
	MappingStrategyAnnotationKey = "mapping-strategy"

	EndpointPoolingAnnotation    = "k8s.ngrok.com/pooling-enabled"
	EndpointPoolingAnnotationKey = "pooling-enabled"

	// This annotation can be used on a service to control whether the endpoint is a TCP or TLS endpoint.
	// Examples:
	//   * tcp://1.tcp.ngrok.io:12345
	//   * tls://my-domain.com
	//
	URLAnnotation = "k8s.ngrok.com/url"
	URLKey        = "url"
)

Variables

This section is empty.

Functions

func ExtractComputedURL

func ExtractComputedURL(obj client.Object) (string, error)

ExtractComputedURL extracts the computed URL from the annotation "k8s.ngrok.com/computed-url" if it is present. Otherwise, it returns an error.

func ExtractDomain

func ExtractDomain(obj client.Object) (string, error)

ExtractDomain extracts the domain from the annotation "k8s.ngrok.com/domain" if it is present. Otherwise, it returns an error.

func ExtractNgrokTrafficPolicyFromAnnotations

func ExtractNgrokTrafficPolicyFromAnnotations(obj client.Object) (string, error)

Extracts a single traffic policy str from the annotation k8s.ngrok.com/traffic-policy: "module1"

func ExtractURL

func ExtractURL(obj client.Object) (string, error)

Retrieves the value of the annotation "k8s.ngrok.com/url" if it is present. Otherwise, it returns an error.

func ExtractUseBindings

func ExtractUseBindings(obj client.Object) ([]string, error)

Determines which traffic is allowed to reach an endpoint from the annotation "k8s.ngrok.com/bindings" if it is present. Otherwise, it defaults to public

func ExtractUseEndpointPooling

func ExtractUseEndpointPooling(obj client.Object) (bool, error)

Whether or not we should use endpoint pooling from the annotation "k8s.ngrok.com/pooling-enabled" if it is present. Otherwise, it defaults to false

Types

type MappingStrategy

type MappingStrategy string
const (
	// The default strategy when translating resources into AgentEndpoint / CloudEndpoint that prioritizes collapsing into a single public AgentEndpoint when possible
	MappingStrategy_EndpointsDefault MappingStrategy = "endpoints"

	// Alternative strategy when translating resources into AgentEndpoint / CloudEndpoint that always creates CloudEndpoints for hostnames and only internal AgentEndpoints for each unique upstream
	MappingStrategy_EndpointsVerbose MappingStrategy = "endpoints-verbose"
)

Directories

Path Synopsis
Test Utilities for Ingress Annotations
Test Utilities for Ingress Annotations

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL