Skip to main content
logoTetrate Service BridgeVersion: next

Annotation Reference

Complete reference of all annotations supported by the Tetrate Hosted Agent

Gateway Annotations (gateway.tetrate.io/*)

Gateway annotations are applied to Kubernetes Service objects to expose them via north-south (ingress) gateways.

Core Service Exposure

AnnotationTypeDefaultRequiredDescription
gateway.tetrate.io/hoststring-YesExternal hostname (supports comma-separated list, max 10)
gateway.tetrate.io/hostsstring-NoAlias for /host
gateway.tetrate.io/exposestringlocalNoExposure mode: local, global, false
gateway.tetrate.io/pathstring/NoURL path prefix for routing
gateway.tetrate.io/protocolstringHTTPNoProtocol: HTTP, HTTPS (TCP/TLS currently disabled)
gateway.tetrate.io/portuint3280 (HTTP), 443 (HTTPS)NoExternal gateway port

Local Routing

AnnotationTypeDefaultDescription
gateway.tetrate.io/local-hoststring{service}.{namespace}.svc.cluster.localBackend service hostname
gateway.tetrate.io/local-pathstringSame as pathBackend path (for path rewriting)
gateway.tetrate.io/local-protocolstringAuto-detectedBackend service protocol
gateway.tetrate.io/local-portuint32First service portBackend service port

Global Multi-Cluster Exposure

AnnotationTypeDefaultRequiredDescription
gateway.tetrate.io/edge-clusterstring-Yes (if expose=global)Single edge cluster name (use for single-cluster global exposure)
gateway.tetrate.io/edge-clustersstring-Yes (if expose=global)Comma-separated edge cluster names with optional weights (use for multi-cluster)
note

Use either edge-cluster (singular) for exposing through a single edge cluster, or edge-clusters (plural) for multi-cluster exposure with optional weighted traffic distribution. Do not use both annotations together.

Weighted Traffic Distribution Format:

  • "cluster1:70,cluster2:30" - Explicit weights (70% to cluster1, 30% to cluster2)
  • "cluster1,cluster2" - Default weight 0 each (enables locality-based routing)
  • "cluster1:70,cluster2" - Mixed (cluster1=70, cluster2=0)

Gateway Selection & Deployment

AnnotationTypeDefaultDescription
gateway.tetrate.io/gateway-namespacestringtetrate-systemNamespace where gateway pods run
gateway.tetrate.io/gateway-namestringgw-{host}Override gateway name
gateway.tetrate.io/gateway-setstring-Gateway grouping identifier (future use)
gateway.tetrate.io/workload-selectorstringapp=gatewayPod label selector (format: key=value,key2=value2)
gateway.tetrate.io/auto-deployboolfalseEnable automatic gateway.install creation

TLS Configuration

AnnotationTypeDefaultRequiredDescription
gateway.tetrate.io/tls-modestringSIMPLENoTLS mode: SIMPLE, MUTUAL, PASSTHROUGH
gateway.tetrate.io/tls-secretstring-Yes (HTTPS)Kubernetes secret name with TLS cert/key
gateway.tetrate.io/tls-secret-namespacestringGateway namespaceNoNamespace of TLS secret (creates ReferenceGrant if different). Requires shared gateway functionality to be enabled.
gateway.tetrate.io/traffic-modestringAUTONoTraffic mode: AUTO, INGRESS, EGRESS, TRANSIT

HTTPS Redirect

AnnotationTypeDefaultDescription
gateway.tetrate.io/https-redirectbooltrue (for HTTPS)Enable HTTP→HTTPS redirect
gateway.tetrate.io/https-redirect-portuint32Main portTarget HTTPS port for redirect
gateway.tetrate.io/http-portuint3280Source HTTP port for redirect server

Authentication & Authorization

AnnotationTypeDefaultDescription
gateway.tetrate.io/jwt-issuersYAML-JWT issuer configurations (list)
gateway.tetrate.io/oidc-enabledboolfalseEnable OIDC authentication
gateway.tetrate.io/oidc-configYAML-OIDC provider configuration
gateway.tetrate.io/authz-externalstring (URL)-External authorization service URL

JWT Issuer YAML Format:

- issuer: "https://auth.example.com"
jwksUri: "https://auth.example.com/.well-known/jwks.json"
audiences: ["api.example.com"]

OIDC Config YAML Format:

grantType: "AUTHORIZATION_CODE"
clientId: "my-client-id"
clientTokenSecret: "my-secret"
redirectUri: "https://api.example.com/callback"
provider:
issuer: "https://auth.example.com"
authorizationEndpoint: "https://auth.example.com/oauth2/authorize"
tokenEndpoint: "https://auth.example.com/oauth2/token"
jwksUri: "https://auth.example.com/.well-known/jwks.json"

Rate Limiting & Policies

AnnotationTypeDefaultDescription
gateway.tetrate.io/rate-limitsYAML-Rate limiting rules (dimensions + limits)
gateway.tetrate.io/cors-policyYAML-CORS policy configuration
gateway.tetrate.io/retry-policyYAML-Retry policy configuration

Rate Limit YAML Format:

- dimensions:
- remoteAddress:
value: "*"
limit:
requestsPerUnit: 100
unit: MINUTE

CORS Policy YAML Format:

allowOrigin: ["https://example.com"]
allowMethods: ["GET", "POST"]
allowHeaders: ["Content-Type", "Authorization"]
exposeHeaders: ["X-Custom-Header"]
maxAge: "86400s"
allowCredentials: true

Retry Policy YAML Format:

attempts: 3
perTryTimeout: "10s"
retryOn: "5xx,reset,connect-failure,refused-stream"

Advanced Features

AnnotationTypeDefaultDescription
gateway.tetrate.io/waf-enabledboolfalseEnable Web Application Firewall (OWASP ModSecurity rules)
gateway.tetrate.io/extensionsYAML-Custom extensions (future use)
gateway.tetrate.io/custom-configYAML-Custom configuration overrides
gateway.tetrate.io/cloud-annotationsYAML-Cloud provider LoadBalancer annotations
gateway.tetrate.io/gateway-statusJSON-Read-only - Gateway status written by agent

Cloud Annotations YAML Format (supports AWS, GCP, Azure):

# AWS
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
service.beta.kubernetes.io/aws-load-balancer-internal: "true"

# GCP
cloud.google.com/load-balancer-type: "Internal"

# Azure
service.beta.kubernetes.io/azure-load-balancer-internal: "true"

Traffic Annotations (traffic.tetrate.io/*)

Traffic annotations are applied to Kubernetes Namespace objects to enable east-west (service-to-service) traffic management.

Important: traffic.tetrate.io/global Has Two Different Uses

The key traffic.tetrate.io/global is used in two different ways depending on the resource type:

ResourceTypeKeyEffect
NamespaceAnnotationtraffic.tetrate.io/global: "true"Enables namespace-level exposure (ALL services in namespace are exposed)
ServiceLabeltraffic.tetrate.io/global: "true"Enables service-level exposure (only THIS service is exposed)

Key differences:

  • On Namespace: Must be an annotation (metadata.annotations)
  • On Service: Must be a label (metadata.labels)
  • Using the wrong type (annotation on Service or label on Namespace) will have no effect

See East-West Traffic Management for detailed usage examples.

East-West Gateway Control

AnnotationTypeDefaultDescription
traffic.tetrate.io/globalboolfalseEnable namespace-level east-west exposure (all services)
traffic.tetrate.io/eastwest-gateway-deploybooltrueAuto-deploy east-west gateway.install resource
traffic.tetrate.io/eastwest-gateway-namespacestringtetrate-systemGateway namespace
traffic.tetrate.io/eastwest-gateway-namestringeast-west-gatewayGateway resource name
traffic.tetrate.io/eastwest-gateway-workload-selectorstringapp=east-west-gatewayPod label selector
traffic.tetrate.io/eastwest-gateway-cloud-annotationsYAML-Cloud provider annotations for gateway LoadBalancer

Annotation Derivation Logic:

  • Both provided: Use both independently (full control)
  • Only gateway-name: Workload selector derived as app={gateway-name}
  • Only workload-selector: Gateway name derived from app label in selector
  • Neither provided: Defaults to gateway-name=east-west-gateway with app=east-west-gateway

Service Labels (East-West)

Service-level east-west exposure uses a label (not annotation):

LabelApplied ToDescription
traffic.tetrate.io/global: "true"ServiceExpose this specific service cross-cluster

Important: This must be a label, not an annotation!

apiVersion: v1
kind: Service
metadata:
name: payment-api
namespace: payments
labels:
traffic.tetrate.io/global: "true" # LABEL (not annotation)
spec:
selector:
app: payment-api
ports:
- port: 8080
targetPort: 8080
name: http

Workspace and Tenant Annotations (tetrate.io/*)

Workspace and tenant annotations are applied to Kubernetes Namespace objects to customize the TSB workspace and tenant used for that namespace.

Custom Workspace and Tenant

AnnotationTypeDefaultDescription
tetrate.io/workspacestringws-{namespace}Custom workspace name
tetrate.io/tenantstringTSB_TENANT env varCustom tenant name (auto-created if needed)

Quick Start

Custom Workspace Name Only

Override the default ws-{namespace} workspace naming pattern:

apiVersion: v1
kind: Namespace
metadata:
name: payments
annotations:
tetrate.io/workspace: "payment-services" # Custom workspace instead of "ws-payments"
labels:
tetrate.io/rev: default
istio-injection: enabled

Custom Tenant with Auto-Creation

Use a custom tenant instead of the default:

apiVersion: v1
kind: Namespace
metadata:
name: payments
annotations:
tetrate.io/tenant: "production" # Auto-creates tenant if needed
labels:
tetrate.io/rev: default
istio-injection: enabled

Both Custom Workspace and Tenant

apiVersion: v1
kind: Namespace
metadata:
name: payments
annotations:
tetrate.io/workspace: "payment-services"
tetrate.io/tenant: "production"
labels:
tetrate.io/rev: default
istio-injection: enabled

Workspace Sharing

Multiple namespaces can share the same workspace by using the same tetrate.io/workspace annotation value:

# Frontend namespace
apiVersion: v1
kind: Namespace
metadata:
name: frontend
annotations:
tetrate.io/workspace: "shared-app"
labels:
tetrate.io/rev: default
---
# Backend namespace
apiVersion: v1
kind: Namespace
metadata:
name: backend
annotations:
tetrate.io/workspace: "shared-app"
labels:
tetrate.io/rev: default

Both namespaces share the shared-app workspace, allowing unified traffic policies and service mesh configuration.

Tenant Auto-Creation

When using a custom tenant annotation:

  1. Existence Check: Agent queries TSB API for the tenant
  2. Auto-Creation: If tenant doesn't exist, creates it with:
    • deletionProtectionEnabled: true (prevents accidental deletion)
    • Standard tenant configuration
  3. Workspace Creation: Creates workspace in the custom tenant
warning

Custom tenants have deletion protection enabled. To delete them manually in TSB, you must first disable deletion protection.

Edge Cases

ScenarioBehavior
No annotationsUses default workspace (ws-{namespace}) and default tenant
Only tetrate.io/workspaceCustom workspace, default tenant
Only tetrate.io/tenantDefault workspace name (ws-{namespace}), custom tenant
Both annotationsCustom workspace and custom tenant
Namespace removes annotationFalls back to defaults on next reconciliation
Namespace changes workspace annotationService moved to new workspace

Kubernetes Object Mapping

Annotation PrefixApplied ToCreates
gateway.tetrate.io/*ServiceTSB Gateway, gateway.install, ReferenceGrant
traffic.tetrate.io/*NamespaceTSB WorkspaceSettings, gateway.install
traffic.tetrate.io/global (label)ServiceUpdates WorkspaceSettings exposedServices
tetrate.io/workspaceNamespaceTSB Workspace (custom name)
tetrate.io/tenantNamespaceTSB Tenant (auto-created if needed)

Exposure Mode Comparison

ModeTriggerWorkspaceSettings FieldBehavior
Namespace-LevelNamespace annotation: traffic.tetrate.io/global: "true"exposedServices: null (omitted)All services exposed
Service-LevelService label: traffic.tetrate.io/global: "true"serviceLabels selectorOnly labeled services exposed

TSB API Paths

ResourceAPI Path
Gatewayorganizations/{org}/tenants/{tenant}/workspaces/{ws}/gatewaygroups/{cluster}-gateway-services/gateways/gw-{name}
Edge Gatewayorganizations/{org}/tenants/{tenant}/workspaces/{ws}/gatewaygroups/{edge-cluster}-gateway-services/gateways/egw-{name}
WorkspaceSettingsorganizations/{org}/tenants/{tenant}/workspaces/{ws}/settings/{ws}-settings

Quick Reference

Minimum Required (HTTP)

annotations:
gateway.tetrate.io/host: "api.example.com"

Minimum Required (HTTPS)

annotations:
gateway.tetrate.io/host: "api.example.com"
gateway.tetrate.io/protocol: "HTTPS"
gateway.tetrate.io/tls-secret: "my-tls-secret"

Minimum Required (East-West Namespace)

# On Namespace
annotations:
traffic.tetrate.io/global: "true"

Minimum Required (East-West Service)

# On Service
labels:
traffic.tetrate.io/global: "true"