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
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 can not 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: |
SessionPersistence defines and configures session persistence for the backend. Support: Extended |
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 |
ListenerEntry
Appears in:
| Field | Description |
|---|---|
nameSectionName Validations: |
Name is the name of the Listener. This name MUST be unique within a ListenerSet. Name is not required to be unique across a Gateway and ListenerSets. Routes can attach to a Listener by having a ListenerSet as a parentRef and setting the SectionName |
hostnameHostname Validations: |
Hostname specifies the virtual hostname to match for protocol types that define this concept. When unspecified, all hostnames are matched. This field is ignored for protocols that don’t require hostname based matching. Implementations MUST apply Hostname matching appropriately for each of the following protocols:
For HTTPRoute and TLSRoute resources, there is an interaction with the Hostnames that are prefixed with a wildcard label ( |
portPortNumber Default: 0 Validations: |
Port is the network port. Multiple listeners may use the same port, subject to the Listener compatibility rules. If the port is not set or specified as zero, the implementation will assign a unique port. If the implementation does not support dynamic port assignment, it MUST set |
protocolProtocolType Validations: |
Protocol specifies the network protocol this listener expects to receive. |
tlsListenerTLSConfig Validations: |
TLS is the TLS configuration for the Listener. This field is required if the Protocol field is "HTTPS" or "TLS". It is invalid to set this field if the Protocol field is "HTTP", "TCP", or "UDP". The association of SNIs to Certificate defined in ListenerTLSConfig is defined based on the Hostname field for this listener. The GatewayClass MUST use the longest matching SNI out of all available certificates for any TLS handshake. |
allowedRoutesAllowedRoutes Default: Validations: |
AllowedRoutes defines the types of routes that MAY be attached to a Listener and the trusted namespaces where those Route resources MAY be present. Although a client request may match multiple route rules, only one rule may ultimately receive the request. Matching precedence MUST be determined in order of the following criteria:
All valid rules within a Route attached to this Listener should be implemented. Invalid Route rules can be ignored (sometimes that will mean the full Route). If a Route rule transitions from valid to invalid, support for that Route rule should be dropped to ensure consistency. For example, even if a filter specified by a Route rule is invalid, the rest of the rules within that Route should still be supported. |
ListenerEntryStatus
ListenerStatus is the status associated with a Listener.
Appears in:
| Field | Description |
|---|---|
nameSectionName Validations: |
Name is the name of the Listener that this status corresponds to. |
portPortNumber Validations: |
Port is the network port the listener is configured to listen on. |
supportedKindsRouteGroupKind array Validations: |
SupportedKinds is the list indicating the Kinds supported by this listener. This MUST represent the kinds an implementation supports for that Listener configuration. If kinds are specified in Spec that are not supported, they MUST NOT appear in this list and an implementation MUST set the "ResolvedRefs" condition to "False" with the "InvalidRouteKinds" reason. If both valid and invalid Route kinds are specified, the implementation MUST reference the valid Route kinds that have been specified. |
attachedRoutesinteger Validations: |
AttachedRoutes represents the total number of Routes that have been successfully attached to this Listener. Successful attachment of a Route to a Listener is based solely on the combination of the AllowedRoutes field on the corresponding Listener and the Route’s ParentRefs field. A Route is successfully attached to a Listener when it is selected by the Listener’s AllowedRoutes field AND the Route has a valid ParentRef selecting the whole Gateway resource or a specific Listener as a parent resource (more detail on attachment semantics can be found in the documentation on the various Route kinds ParentRefs fields). Listener or Route status does not impact successful attachment, i.e. the AttachedRoutes field count MUST be set for Listeners with condition Accepted: false and MUST count successfully attached Routes that may themselves have Accepted: false conditions. Uses for this field include troubleshooting Route attachment and measuring blast radius/impact of changes to a Listener. |
conditionsCondition array Validations: |
Conditions describe the current condition of this listener. |
ListenerSetSpec
ListenerSetSpec defines the desired state of a ListenerSet.
Appears in:
| Field | Description |
|---|---|
parentRefParentGatewayReference Validations: |
ParentRef references the Gateway that the listeners are attached to. |
listenersListenerEntry array Validations: |
Listeners associated with this ListenerSet. Listeners define logical endpoints that are bound on this referenced parent Gateway’s addresses. Listeners in a Implementations MUST treat the parent Gateway as having the merged list of all listeners from itself and attached ListenerSets using the following precedence:
An implementation MAY reject listeners by setting the ListenerEntryStatus If a listener has a conflict, this will be reported in the Status.ListenerEntryStatus setting the Implementations SHOULD be cautious about what information from the parent or siblings are reported to avoid accidentally leaking sensitive information that the child would not otherwise have access to. This can include contents of secrets etc. |
ListenerSetStatus
Appears in:
| Field | Description |
|---|---|
conditionsCondition array Default: Validations: |
Conditions describe the current conditions of the ListenerSet. Implementations MUST express ListenerSet conditions using the Known condition types are:
|
listenersListenerEntryStatus array Validations: |
Listeners provide status for each unique listener port defined in the Spec. |
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. |
ParentGatewayReference
ParentGatewayReference identifies an API object including its namespace, defaulting to Gateway.
Appears in:
| Field | Description |
|---|---|
groupGroup Default: gateway.networking.k8s.io Validations: |
Group is the group of the referent. |
kindKind Default: Gateway Validations: |
Kind is kind of the referent. For example "Gateway". |
nameObjectName Validations: |
Name is the name of the referent. |
namespaceNamespace Validations: |
Namespace is the namespace of the referent. If not present, the namespace of the referent is assumed to be the same as the namespace of the referring object. |
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 |
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. |
XListenerSet
XListenerSet defines a set of additional listeners to attach to an existing Gateway. This resource provides a mechanism to merge multiple listeners into a single Gateway.
The parent Gateway must explicitly allow ListenerSet attachment through its AllowedListeners configuration. By default, Gateways do not allow ListenerSet attachment.
Routes can attach to a ListenerSet by specifying it as a parentRef, and can optionally target specific listeners using the sectionName field.
Policy Attachment:
- Policies that attach to a ListenerSet apply to all listeners defined in that resource
- Policies do not impact listeners in the parent Gateway
- Different ListenerSets attached to the same Gateway can have different policies
- If an implementation cannot apply a policy to specific listeners, it should reject the policy
ReferenceGrant Semantics:
- ReferenceGrants applied to a Gateway are not inherited by child ListenerSets
- ReferenceGrants applied to a ListenerSet do not grant permission to the parent Gateway’s listeners
- A ListenerSet can reference secrets/backends in its own namespace without a ReferenceGrant
Gateway Integration:
- The parent Gateway’s status will include an “AttachedListenerSets” condition
- This condition will be:
- True: when AllowedListeners is set and at least one child ListenerSet is attached
- False: when AllowedListeners is set but no valid listeners are attached, or when AllowedListeners is not set or false
- Unknown: when no AllowedListeners config is present
| Field | Description |
|---|---|
apiVersion string |
gateway.networking.x-k8s.io/v1alpha1 |
kind string |
XListenerSet |
metadataObjectMeta Validations: |
Refer to Kubernetes API documentation for fields of metadata. |
specListenerSetSpec Validations: |
Spec defines the desired state of ListenerSet. |
statusListenerSetStatus Default: Validations: |
Status defines the current state of ListenerSet. |
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. |