API Reference
gateway.networking.x-k8s.io/v1alpha1
Package v1alpha1 contains API Schema definitions for the gateway.networking.k8s-x.io API group.
Resource Types
Attribute
Attribute defines a single flat key-value pair to attach to traces.
This allows users to enrich spans with context like HTTP headers (e.g., “X-User-ID”), static tags, or built-in variables.
Support: Core
Appears in:
| Field | Description |
|---|---|
nameAttributeName Validations: |
Name is the key of the attribute as it will appear in the output (i.e., as a span tag). |
sourceTypeAttributeSourceType Validations: |
SourceType specifies where the attribute value comes from. Valid values are "Header", "Literal", or "Attribute". |
headerNameHTTPHeaderName Validations: |
HeaderName specifies the HTTP header to extract the value from. This is required if SourceType is "Header". |
literalValuestring Validations: |
LiteralValue specifies a static string value to attach. This is required if SourceType is "Literal". |
attributeKeystring Validations: |
AttributeKey refers to a standard OpenTelemetry attribute. For example: "http.response.status_code" or "http.request.method". This is required if SourceType is "Attribute". See: https://opentelemetry.io/docs/specs/semconv/ |
AttributeName
Underlying type: string
AttributeName defines the key of a span attribute or tag.
Validation:
- MaxLength: 256
- MinLength: 1
- Pattern:
^[a-zA-Z0-9_.:/-]+$
Appears in:
AttributeSourceType
Underlying type: string
AttributeSourceType defines the source from which a telemetry attribute value is retrieved.
Appears in:
| Enum Value | Description |
|---|---|
Header |
AttributeSourceHeader indicates that the attribute value should be extracted from a specific HTTP header in the request or response. Support: Core |
Literal |
AttributeSourceLiteral indicates that the attribute value is a static string provided directly in the policy configuration. Support: Core |
Attribute |
AttributeSourceAttribute extracts the value from a proxy-builtin reference variable mapped to OpenTelemetry Semantic Conventions (e.g., “http.request.method”). See: https://opentelemetry.io/docs/specs/semconv/ Support: Extended Feature Name: TelemetryPolicyAttribute |
BackendAncestorStatus
BackendAncestorStatus describes the status of a Backend with respect to a specific ancestor resource (typically a Gateway).
Appears in:
| Field | Description |
|---|---|
controllerNameGatewayController Validations: |
ControllerName is a domain/path string that indicates the name of the controller that manages the Backend. Example: "example.net/gateway-controller". The format of this field is DOMAIN "/" PATH, where DOMAIN and PATH are valid Kubernetes names (https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names). |
ancestorRefParentReference Validations: |
AncestorRef identifies the ancestor resource that this status is associated with. |
conditionsCondition array Validations: |
For Kubernetes API conventions, see: https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#typical-status-properties conditions represent the current state of the Backend resource. Each condition has a unique type and reflects the status of a specific aspect of the resource. Defined condition types include:
The status of each condition is one of True, False, or Unknown. |
BackendPort
BackendPort describes the port the implementation should use when connecting to a Backend.
Validation:
- MinProperties: 1
Appears in:
| Field | Description |
|---|---|
numberPortNumber Validations: |
Number represents the port number of the destination. |
BackendProtocol
Underlying type: string
BackendProtocol defines the protocol used when connecting to a backend.
Validation:
- Enum: [TCP HTTP HTTP2 HTTP11 H2C MCP GRPC WSS]
Appears in:
| Enum Value | Description |
|---|---|
MCP |
BackendProtocolMCP indicates the Model Context Protocol. Support: Extended |
TCP |
BackendProtocolTCP indicates plain TCP. Support: Extended |
HTTP |
BackendProtocolHTTP indicates HTTP (version negotiated via ALPN or implementation default). Support: Core |
HTTP2 |
BackendProtocolHTTP2 indicates HTTP/2. Support: Core |
HTTP11 |
BackendProtocolHTTP11 indicates HTTP/1.1. Support: Core |
H2C |
BackendProtocolH2C indicates HTTP/2 over cleartext (h2c). Support: Core |
GRPC |
BackendProtocolGRPC indicates gRPC Support: Extended |
WSS |
BackendProtocolWSS indicates WebSocket over TLS as described in RFC6445. Support: Extended |
BackendSpec
BackendSpec defines the desired state of a Backend.
Appears in:
| Field | Description |
|---|---|
typeBackendType Validations: |
Type defines the backend type. |
portBackendPort Validations: |
Port defines the port to connect to on this backend. For ExternalHostname, this is the port on the external host. For EndpointSelector, this specifies which endpoint port to connect to. |
externalHostnameExternalHostnameBackend Validations: |
ExternalHostname specifies the configuration for an ExternalHostname backend. This field must be set when type is ExternalHostname and must be unset otherwise. Support: Extended |
endpointSelectorEndpointSelectorBackend Validations: |
EndpointSelector specifies the configuration for an EndpointSelector backend. This field must be set when type is EndpointSelector and must be unset otherwise. |
sessionPersistenceSessionPersistence Validations: |
SessionPersistence defines and configures session persistence across the endpoints selected by this backend. This field can only be configured when type is EndpointSelector. Support: Extended |
protocolBackendProtocol Validations: |
Protocol defines the protocol for backend communication. In the common case, the underlying transport protocol for the proxied traffic will already have been determined and processed by the dataplane at the routing step. Where this field is useful is either for higher level protocols or asymmetrical protocol configurations (e.g. version upgrades or h2c). When set, the implementation uses the specified protocol when connecting to this backend. When not set, the implementation will use the protocol determined by the route or listener configuration. Support: Core - HTTP, HTTP2, H2C, and HTTP11 Support: Extended - GRPC, MCP, TCP, WSS |
tlsBackendTLS Default: Validations: |
TLS defines the TLS configuration that the implementation should use when connecting to the backend. ExternalHostname backends SHOULD have TLS configured; the lack of TLS for external hostnames should be considered insecure and a security risk. Support: Core - for TLS mode None Support: Extended - for TLS mode ServerOnly and ClientAndServer |
BackendStatus
BackendStatus defines the observed state of a Backend.
Appears in:
| Field | Description |
|---|---|
ancestorsBackendAncestorStatus array Validations: |
Ancestors is a list of ancestor resources (usually Gateways) that are associated with this Backend, and the status of the Backend with respect to each ancestor. A maximum of 32 ancestors will be represented in this list. An empty list indicates that the Backend is not associated with any ancestors. |
BackendTLS
BackendTLS defines TLS configuration for connecting to a backend.
Appears in:
| Field | Description |
|---|---|
modeBackendTLSMode Validations: |
Mode defines the TLS mode for the backend connection. Support: Core - None Support: Extended - ServerOnly, ClientAndServer |
clientCertificateRefSecretObjectReference Validations: |
ClientCertificateRef is a reference to a Secret containing the client TLS certificate and private key for mutual TLS. This field is required when mode is ClientAndServer and must be unset otherwise. |
validationBackendTLSPolicyValidation Validations: |
Validation contains TLS validation configuration for the backend connection. |
BackendTLSMode
Underlying type: string
BackendTLSMode defines the TLS mode for backend connections.
Validation:
- Enum: [None ServerOnly ClientAndServer]
Appears in:
| Enum Value | Description |
|---|---|
None |
BackendTLSModeNone disables TLS when connecting to the backend. |
ServerOnly |
BackendTLSModeServerOnly enables TLS with server certificate verification. |
ClientAndServer |
BackendTLSModeClientAndServer enables mutual TLS (mTLS). |
BackendTrafficPolicySpec
BackendTrafficPolicySpec define the desired state of BackendTrafficPolicy Note: there is no Override or Default policy configuration.
Appears in:
| Field | Description |
|---|---|
targetRefsLocalPolicyTargetReference array Validations: |
TargetRefs identifies API object(s) to apply this policy to. Currently, Backends (A grouping of like endpoints such as Service, ServiceImport, or any implementation-specific backendRef) are the only valid API target references. Currently, a TargetRef cannot be scoped to a specific port on a Service. |
retryConstraintRetryConstraint ⚠️ Experimental Validations: |
RetryConstraint defines the configuration for when to allow or prevent further retries to a target backend, by dynamically calculating a ‘retry budget’. This budget is calculated based on the percentage of incoming traffic composed of retries over a given time interval. Once the budget is exceeded, additional retries will be rejected. For example, if the retry budget interval is 10 seconds, there have been 1000 active requests in the past 10 seconds, and the allowed percentage of requests that can be retried is 20% (the default), then 200 of those requests may be composed of retries. Active requests will only be considered for the duration of the interval when calculating the retry budget. Retrying the same original request multiple times within the retry budget interval will lead to each retry being counted towards calculating the budget. Configuring a RetryConstraint in BackendTrafficPolicy is compatible with HTTPRoute Retry settings for each HTTPRouteRule that targets the same backend. While the HTTPRouteRule Retry stanza can specify whether a request will be retried, and the number of retry attempts each client may perform, RetryConstraint helps prevent cascading failures such as retry storms during periods of consistent failures. After the retry budget has been exceeded, additional retries to the backend MUST return a 503 response to the client. Additional configurations for defining a constraint on retries MAY be defined in the future. Support: Extended |
sessionPersistenceSessionPersistence Validations: |
Deprecated: use the Backend resource for session persistence (GEP-4894). SessionPersistence defines and configures session persistence for the backend. Support: Extended |
BackendType
Underlying type: string
BackendType defines the type of backend destination.
Validation:
- Enum: [ExternalHostname EndpointSelector]
Appears in:
| Enum Value | Description |
|---|---|
ExternalHostname |
BackendTypeExternalHostname indicates that the backend is an external hostname destination. This type provides first-class support for external FQDNs, replacing the need for synthetic ExternalName Services. Support: Extended |
EndpointSelector |
BackendTypeEndpointSelector indicates that the backend routes to a selected set of in-cluster endpoints. This type behaves equivalently to a Service backendRef but provides a dedicated resource where backend-level configuration can live and grow. Support: Core |
BudgetDetails
BudgetDetails specifies the details of the budget configuration, like the percentage of requests in the budget, and the interval between checks.
Appears in:
| Field | Description |
|---|---|
percentinteger Default: 20 Validations: |
Percent defines the maximum percentage of active requests that may be made up of retries. Support: Extended |
intervalDuration Default: 10s Validations: |
Interval defines the duration in which requests will be considered for calculating the budget for retries. Support: Extended |
EndpointSelectorBackend
EndpointSelectorBackend specifies the configuration for a backend that selects a set of pods by label.
Appears in:
| Field | Description |
|---|---|
matchLabelsobject (keys:LabelKey, values:LabelValue) Validations: |
MatchLabels contains a set of required {key,value} pairs. An object must match every label in this map to be selected. The matching logic is an AND operation on all entries. |
ExternalHostnameBackend
ExternalHostnameBackend specifies the configuration for a backend that represents an external hostname destination.
Appears in:
| Field | Description |
|---|---|
hostnamePreciseHostname Validations: |
Hostname specifies the FQDN used to reach this backend. IP addresses are not allowed in this field. |
LabelSelector
LabelSelector defines a query for resources based on their labels.
Appears in:
| Field | Description |
|---|---|
matchLabelsobject (keys:LabelKey, values:LabelValue) Validations: |
MatchLabels contains a set of required {key,value} pairs. An object must match every label in this map to be selected. The matching logic is an AND operation on all entries. |
MeshSpec
MeshSpec defines the desired state of an XMesh.
Appears in:
| Field | Description |
|---|---|
controllerNameGatewayController Validations: |
ControllerName is the name of a controller that is managing Gateway API resources for mesh traffic management. The value of this field MUST be a domain prefixed path. Example: "example.com/awesome-mesh". This field is not mutable and cannot be empty. Support: Core |
parametersRefParametersReference Validations: |
ParametersRef is an optional reference to a resource that contains implementation-specific configuration for this Mesh. If no implementation-specific parameters are needed, this field MUST be omitted. ParametersRef can reference a standard Kubernetes resource, i.e. ConfigMap, or an implementation-specific custom resource. The resource can be cluster-scoped or namespace-scoped. If the referent cannot be found, refers to an unsupported kind, or when the data within that resource is malformed, the Mesh MUST be rejected with the "Accepted" status condition set to "False" and an "InvalidParameters" reason. Support: Implementation-specific |
descriptionstring Validations: |
Description optionally provides a human-readable description of a Mesh. |
MeshStatus
MeshStatus is the current status for the Mesh.
Appears in:
| Field | Description |
|---|---|
conditionsCondition array Default: Validations: |
Conditions is the current status from the controller for this Mesh. Controllers should prefer to publish conditions using values of MeshConditionType for the type of each Condition. |
supportedFeaturesSupportedFeature array Validations: |
SupportedFeatures is the set of features the Mesh support. It MUST be sorted in ascending alphabetical order by the Name key. |
ParentBasedSampling
ParentBasedSampling defines the sampling behavior when a request has a pre-existing upstream trace parent.
Support: Extended
Appears in:
| Field | Description |
|---|---|
modeParentBasedSamplingMode Default: ImplementationDefault Validations: |
Mode explicitly controls if parent-based sampling is enabled. Valid values are "Enabled", "Disabled", "ImplementationDefault". In the absence of this field, it defaults to "ImplementationDefault". Support: Extended |
samplingRateFraction Default: Validations: |
SamplingRate is the sampling rate to apply when parent-based sampling is active. This acts as a downsampling governor. It allows an operator to say: "I want to respect the parent’s decision, but only for 50% of those requests". Even if a parent is already marked as "Sampled", this allows the Gateway to apply a secondary filter so that it can respect the parent’s intent while still controlling the volume of spans reported. In the absence of this field, it defaults to 100% ({numerator: 100}). Support: Extended |
ParentBasedSamplingMode
Underlying type: string
ParentBasedSamplingMode defines the enablement mode for parent-based sampling.
Appears in:
| Enum Value | Description |
|---|---|
Enabled |
ParentBasedSamplingModeEnabled explicitly enables parent-based sampling. |
Disabled |
ParentBasedSamplingModeDisabled explicitly disables parent-based sampling. |
ImplementationDefault |
ParentBasedSamplingModeImplementationDefault means that the code should use the implementation’s default behavior for parent-based sampling. |
PortNumber
Underlying type: integer
PortNumber defines a network port.
Validation:
- Maximum: 65535
- Minimum: 1
Appears in:
RequestRate
RequestRate expresses a rate of requests over a given period of time.
Appears in:
| Field | Description |
|---|---|
countinteger Validations: |
Count specifies the number of requests per time interval. Support: Extended |
intervalDuration Validations: |
Interval specifies the divisor of the rate of requests, the amount of time during which the given count of requests occur. Support: Extended |
RetryConstraint
RetryConstraint defines the configuration for when to retry a request.
Appears in:
- BackendTrafficPolicySpec ⚠️ Experimental in
retryConstraintfield
| Field | Description |
|---|---|
budgetBudgetDetails Default: Validations: |
Budget holds the details of the retry budget configuration. |
minRetryRateRequestRate Default: Validations: |
MinRetryRate defines the minimum rate of retries that will be allowable over a specified duration of time. The effective overall minimum rate of retries targeting the backend service may be much higher, as there can be any number of clients which are applying this setting locally. This ensures that requests can still be retried during periods of low traffic, where the budget for retries may be calculated as a very low value. Support: Extended |
TelemetryPolicySpec
TelemetryPolicySpec defines the desired state and target of TelemetryPolicy.
Specifying at least one target resource in targetRefs is required.
Tracing behavior can be configured via the tracing field.
Validation:
- AtLeastOneOf: [tracing]
Appears in:
| Field | Description |
|---|---|
targetRefsLocalObjectReference array Validations: |
TargetRefs identifies the gateways to which this policy applies (GEP-713). When configured, the telemetry settings defined in this policy are applied uniformly to the referenced resources. In the absence of targetRefs, the policy is invalid and will not be accepted. TargetRefs must be distinct. Support: Core for Gateway |
tracingTracingConfig Validations: |
Tracing defines the configuration for distributed tracing. When configured, distributed tracing spans are generated and exported. In the absence of this configuration, tracing behavior is determined by implementation defaults. Support: Extended Feature Name: TelemetryPolicyTracing |
TelemetryPolicyStatus
TelemetryPolicyStatus defines the observed state of TelemetryPolicy.
Appears in:
| Field | Description |
|---|---|
ancestorsPolicyAncestorStatus array Validations: |
For Policy Status API conventions, see: https://gateway-api.sigs.k8s.io/geps/gep-713/#the-status-stanza-of-policy-objects Ancestors is a list of ancestor resources (specifically Gateway resources) that are associated with the policy, and the status of the policy with respect to each ancestor. When this policy attaches to a parent, the controller that manages the parent and the ancestors MUST add an entry to this list when the controller first sees the policy and SHOULD update the entry as appropriate when the relevant ancestor is modified. For TelemetryPolicy, the ancestor MUST be the Gateway resource referenced in spec.targetRefs. Note also that implementations MUST ONLY populate ancestor status for the Ancestor resources they are responsible for. Implementations MUST use the ControllerName field to uniquely identify the entries in this list that they are responsible for. Note that to achieve this, the list of PolicyAncestorStatus structs MUST be treated as a map with a composite key, made up of the AncestorRef and ControllerName fields combined. A maximum of 16 ancestors will be represented in this list. An empty list means the Policy is not relevant for any ancestors. If this slice is full, implementations MUST NOT add further entries. Instead they MUST consider the policy unimplementable and signal that on any related resources such as the ancestor that would be referenced here. |
TracingConfig
TracingConfig defines the configuration for distributed tracing.
Support: Extended
Appears in:
| Field | Description |
|---|---|
modeTracingMode Default: ImplementationDefault Validations: |
Mode explicitly controls if tracing is enabled. Valid values are "Enabled", "Disabled", "ImplementationDefault". In the absence of this field, it defaults to "ImplementationDefault". Support: Core (within TelemetryPolicy feature) |
providerTracingProvider Validations: |
Provider specifies the tracing collector or backend endpoint receiving OTLP spans. When configured, spans generated by the Gateway proxy are exported to this destination. In the absence of this field, spans are exported to an implementation-defined default sink. Support: Core (within Tracing feature) |
samplingRateFraction Validations: |
SamplingRate specifies the base probability of sampling new traces. The sampling probability is represented as a fraction. For example, a Numerator of 5 and Denominator of 100 represents a 5% sampling rate.
Support: Extended |
parentBasedSamplingParentBasedSampling Validations: |
ParentBasedSampling configures whether to respect the sampling decision of the parent span.
Support: Extended Feature Name: TelemetryPolicyParentBasedSampling |
serviceNamestring Validations: |
ServiceName is the "service.name" attribute of the OpenTelemetry resource. If absent, the implementation’s default service name will be used. Support: Extended |
spanNamestring Validations: |
SpanName defines a custom name for the OTel span. By default, the name is implementation-specific. Support: Extended |
attributesAttribute array Validations: |
Attributes is a list of custom key-value pairs (or variables) attached to every span. When configured, these attributes are injected into every generated tracing span. In the absence of attributes, only standard proxy-defined attributes are emitted. Support: Extended |
TracingMode
Underlying type: string
TracingMode defines the enablement state of tracing.
Appears in:
| Enum Value | Description |
|---|---|
Enabled |
TracingModeEnabled explicitly enables tracing. |
Disabled |
TracingModeDisabled explicitly disables tracing. |
ImplementationDefault |
TracingModeImplementationDefault means that the code should use the implementation’s default behavior for tracing. |
TracingProvider
TracingProvider identifies the tracing backend that receives generated spans.
Support: Core for Service
Support: Implementation-specific for any other resource
Appears in:
| Field | Description |
|---|---|
backendRefBackendObjectReference Validations: |
BackendRef is a reference to a Kubernetes Service or other supported backend that receives OTLP traces. When configured, tracing data is exported to the referenced backend. If the reference is invalid (e.g., the Service does not exist), the implementation should update the policy’s status conditions to indicate an unresolved reference. TLS configuration for the connection to the backend is managed by the referenced object. For example, if the BackendRef points to a Service, a BackendTLSPolicy can be attached to configure TLS. Alternatively, the referenced backend could be a custom resource (e.g., XBackend) that natively manages TLS. Support: Core |
headersHTTPHeader array Validations: |
Headers specifies a list of custom headers to be added to the telemetry export requests (e.g., for authentication). Support: Extended |
XBackend
XBackend is a Gateway API resource that represents a backend destination for routing traffic. It serves as a Gateway-native way to define where and how a Gateway should connect to a backend.
Support: Extended
| Field | Description |
|---|---|
apiVersion string |
gateway.networking.x-k8s.io/v1alpha1 |
kind string |
XBackend |
metadataObjectMeta Validations: |
Refer to Kubernetes API documentation for fields of metadata. |
specBackendSpec Validations: |
Spec defines the desired state of XBackend. |
statusBackendStatus Validations: |
Status defines the current state of XBackend. |
XBackendTrafficPolicy
XBackendTrafficPolicy defines the configuration for how traffic to a target backend should be handled.
| Field | Description |
|---|---|
apiVersion string |
gateway.networking.x-k8s.io/v1alpha1 |
kind string |
XBackendTrafficPolicy |
metadataObjectMeta Validations: |
Refer to Kubernetes API documentation for fields of metadata. |
specBackendTrafficPolicySpec Validations: |
Spec defines the desired state of BackendTrafficPolicy. |
statusPolicyStatus Validations: |
Status defines the current state of BackendTrafficPolicy. |
XMesh
XMesh defines mesh-wide characteristics of a GAMMA-compliant service mesh.
| Field | Description |
|---|---|
apiVersion string |
gateway.networking.x-k8s.io/v1alpha1 |
kind string |
XMesh |
metadataObjectMeta Validations: |
Refer to Kubernetes API documentation for fields of metadata. |
specMeshSpec Validations: |
Spec defines the desired state of XMesh. |
statusMeshStatus Default: Validations: |
Status defines the current state of XMesh. |
XTelemetryPolicy
TelemetryPolicy defines a Direct Attached Policy to configure telemetry/observability signals for Gateways.
By applying a TelemetryPolicy, platform operators and developers can ensure consistent collection, formatting, and export of observability signals.
Notes for implementors:
TelemetryPolicy is a Direct Attached Policy. Implementing controllers MUST adhere to the Policy Attachment guidelines (GEP-713).
Precedence and Conflict Resolution:
- To prevent complex merging semantics, only a single TelemetryPolicy is permitted to apply to a specific Gateway resource at any given time.
- If multiple TelemetryPolicy resources target the same Gateway, precedence
MUST be determined using the following criteria, continuing on ties:
- The older policy by creation timestamp takes precedence.
- The policy appearing first in alphabetical order by {namespace}/{name}.
- For any TelemetryPolicy that does not take precedence, the controller
MUST set the
Acceptedcondition on the policy status tostatus: Falsewith ReasonConflicted.
Conformance:
Implementations MUST support the core resource structure and targetRefs.
Support for the tracing block is Extended, but if supported,
its respective conformance profile must be met.
Support: Extended
| Field | Description |
|---|---|
apiVersion string |
gateway.networking.x-k8s.io/v1alpha1 |
kind string |
XTelemetryPolicy |
metadataObjectMeta Validations: |
Refer to Kubernetes API documentation for fields of metadata. |
specTelemetryPolicySpec Validations: |
Spec defines the desired state of TelemetryPolicy. |
statusTelemetryPolicyStatus Validations: |
Status defines the observed state of TelemetryPolicy. |