For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.
AgentgatewayPolicy
Use AgentgatewayPolicy to configure traffic manipulation, observability, security, and more.
Explore the configuration reference by clicking on a property name or expanding the property types. Use the in-field search bar to search for a property. The reference is also available as a table.- apiVersionstring
- kindstring
- metadataobject
- *spec
- backend
- ai
- defaults
- *fieldstring
- *valueobject
- modelAliasesobject
- overrides
- *fieldstring
- *valueobject
- prompt
- append
- *contentstring
- *rolestring
- prepend
- *contentstring
- *rolestring
- promptCaching
- cacheMessageOffsetinteger
- cacheMessagesboolean
- cacheSystemboolean
- cacheToolsboolean
- minTokensinteger
- promptGuard
- request
- bedrockGuardrails
- *identifierstring
- policies
- auth
- aws
- *secretRef
- namestring
- azure
- managedIdentity
- *clientIdstring
- *objectIdstring
- *resourceIdstring
- secretRef
- namestring
- gcp
- audiencestring
- typestring
- keystring
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- passthroughobject
- secretRef
- namestring
- http
- requestTimeoutstring
- versionstring
- tcp
- connectTimeoutstring
- keepalive
- intervalstring
- retriesinteger
- timestring
- tls
- alpnProtocolsstring[]
- caCertificateRefs
- namestring
- insecureSkipVerifystring
- mtlsCertificateRef
- namestring
- snistring
- verifySubjectAltNamesstring[]
- tunnel
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- *regionstring
- *versionstring
- googleModelArmor
- locationstring
- policies
- auth
- aws
- *secretRef
- namestring
- azure
- managedIdentity
- *clientIdstring
- *objectIdstring
- *resourceIdstring
- secretRef
- namestring
- gcp
- audiencestring
- typestring
- keystring
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- passthroughobject
- secretRef
- namestring
- http
- requestTimeoutstring
- versionstring
- tcp
- connectTimeoutstring
- keepalive
- intervalstring
- retriesinteger
- timestring
- tls
- alpnProtocolsstring[]
- caCertificateRefs
- namestring
- insecureSkipVerifystring
- mtlsCertificateRef
- namestring
- snistring
- verifySubjectAltNamesstring[]
- tunnel
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- *projectIdstring
- *templateIdstring
- openAIModeration
- modelstring
- policies
- auth
- aws
- *secretRef
- namestring
- azure
- managedIdentity
- *clientIdstring
- *objectIdstring
- *resourceIdstring
- secretRef
- namestring
- gcp
- audiencestring
- typestring
- keystring
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- passthroughobject
- secretRef
- namestring
- http
- requestTimeoutstring
- versionstring
- tcp
- connectTimeoutstring
- keepalive
- intervalstring
- retriesinteger
- timestring
- tls
- alpnProtocolsstring[]
- caCertificateRefs
- namestring
- insecureSkipVerifystring
- mtlsCertificateRef
- namestring
- snistring
- verifySubjectAltNamesstring[]
- tunnel
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- regex
- actionstring
- builtinsstring[]
- matchesstring[]
- response
- messagestring
- statusCodeinteger
- webhook
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- forwardHeaderMatches
- *namestring
- typestring
- *valuestring
- response
- bedrockGuardrails
- *identifierstring
- policies
- auth
- aws
- *secretRef
- namestring
- azure
- managedIdentity
- *clientIdstring
- *objectIdstring
- *resourceIdstring
- secretRef
- namestring
- gcp
- audiencestring
- typestring
- keystring
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- passthroughobject
- secretRef
- namestring
- http
- requestTimeoutstring
- versionstring
- tcp
- connectTimeoutstring
- keepalive
- intervalstring
- retriesinteger
- timestring
- tls
- alpnProtocolsstring[]
- caCertificateRefs
- namestring
- insecureSkipVerifystring
- mtlsCertificateRef
- namestring
- snistring
- verifySubjectAltNamesstring[]
- tunnel
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- *regionstring
- *versionstring
- googleModelArmor
- locationstring
- policies
- auth
- aws
- *secretRef
- namestring
- azure
- managedIdentity
- *clientIdstring
- *objectIdstring
- *resourceIdstring
- secretRef
- namestring
- gcp
- audiencestring
- typestring
- keystring
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- passthroughobject
- secretRef
- namestring
- http
- requestTimeoutstring
- versionstring
- tcp
- connectTimeoutstring
- keepalive
- intervalstring
- retriesinteger
- timestring
- tls
- alpnProtocolsstring[]
- caCertificateRefs
- namestring
- insecureSkipVerifystring
- mtlsCertificateRef
- namestring
- snistring
- verifySubjectAltNamesstring[]
- tunnel
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- *projectIdstring
- *templateIdstring
- regex
- actionstring
- builtinsstring[]
- matchesstring[]
- response
- messagestring
- statusCodeinteger
- webhook
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- forwardHeaderMatches
- *namestring
- typestring
- *valuestring
- routesobject
- transformations
- *expressionstring
- *fieldstring
- auth
- aws
- *secretRef
- namestring
- azure
- managedIdentity
- *clientIdstring
- *objectIdstring
- *resourceIdstring
- secretRef
- namestring
- gcp
- audiencestring
- typestring
- keystring
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- passthroughobject
- secretRef
- namestring
- health
- eviction
- consecutiveFailuresinteger
- durationstring
- healthThresholdinteger
- restoreHealthinteger
- unhealthyConditionstring
- http
- requestTimeoutstring
- versionstring
- mcp
- authentication
- audiencesstring[]
- issuerstring
- *jwks
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- cacheDurationstring
- *jwksPathstring
- modestring
- providerstring
- resourceMetadataobject
- authorization
- actionstring
- *policy
- *matchExpressionsstring[]
- tcp
- connectTimeoutstring
- keepalive
- intervalstring
- retriesinteger
- timestring
- tls
- alpnProtocolsstring[]
- caCertificateRefs
- namestring
- insecureSkipVerifystring
- mtlsCertificateRef
- namestring
- snistring
- verifySubjectAltNamesstring[]
- transformation
- request
- add
- *namestring
- *valuestring
- bodystring
- metadataobject
- removestring[]
- set
- *namestring
- *valuestring
- response
- add
- *namestring
- *valuestring
- bodystring
- metadataobject
- removestring[]
- set
- *namestring
- *valuestring
- tunnel
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- frontend
- accessLog
- attributes
- add
- *expressionstring
- *namestring
- removestring[]
- filterstring
- otlp
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- pathstring
- protocolstring
- http
- http1IdleTimeoutstring
- http1MaxHeadersinteger
- http2ConnectionWindowSizeinteger
- http2FrameSizeinteger
- http2KeepaliveIntervalstring
- http2KeepaliveTimeoutstring
- http2WindowSizeinteger
- maxBufferSizeinteger
- maxConnectionDurationstring
- metrics
- *attributes
- add
- *expressionstring
- *namestring
- networkAuthorization
- actionstring
- *policy
- *matchExpressionsstring[]
- proxyProtocol
- modestring
- versionstring
- tcp
- keepalive
- intervalstring
- retriesinteger
- timestring
- tls
- alpnProtocolsstring[]
- cipherSuitesstring[]
- handshakeTimeoutstring
- maxProtocolVersionstring
- minProtocolVersionstring
- tracing
- attributes
- add
- *expressionstring
- *namestring
- removestring[]
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- clientSamplingstring
- pathstring
- protocolstring
- randomSamplingstring
- resources
- *expressionstring
- *namestring
- targetRefs
- *groupstring
- *kindstring
- *namestring
- sectionNamestring
- targetSelectors
- *groupstring
- *kindstring
- *matchLabelsobject
- sectionNamestring
- traffic
- apiKeyAuthentication
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- modestring
- secretRef
- namestring
- secretSelector
- *matchLabelsobject
- authorization
- actionstring
- *policy
- *matchExpressionsstring[]
- basicAuthentication
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- modestring
- realmstring
- secretRef
- namestring
- usersstring[]
- cors
- allowCredentialsboolean
- allowHeadersstring[]
- allowMethodsstring[]
- allowOriginsstring[]
- exposeHeadersstring[]
- maxAgeinteger
- csrf
- additionalOriginsstring[]
- directResponse
- bodystring
- *statusinteger
- extAuth
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- failureModestring
- forwardBody
- *maxSizeinteger
- grpc
- contextExtensionsobject
- requestMetadataobject
- http
- addRequestHeadersobject
- allowedRequestHeadersstring[]
- allowedResponseHeadersstring[]
- pathstring
- redirectstring
- responseMetadataobject
- extProc
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- headerModifiers
- request
- add
- *namestring
- *valuestring
- removestring[]
- set
- *namestring
- *valuestring
- response
- add
- *namestring
- *valuestring
- removestring[]
- set
- *namestring
- *valuestring
- hostRewrite
- *modestring
- jwtAuthentication
- location
- cookie
- *namestring
- header
- *namestring
- prefixstring
- queryParameter
- *namestring
- mcp
- providerstring
- resourceMetadataobject
- modestring
- *providers
- audiencesstring[]
- *issuerstring
- *jwks
- inlinestring
- remote
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- cacheDurationstring
- *jwksPathstring
- phasestring
- rateLimit
- global
- *backendRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- *descriptors
- *entries
- *expressionstring
- *namestring
- unitstring
- *domainstring
- failureModestring
- local
- burstinteger
- requestsinteger
- tokensinteger
- *unitstring
- retry
- attemptsinteger
- backoffstring
- codesinteger[]
- timeouts
- requeststring
- transformation
- request
- add
- *namestring
- *valuestring
- bodystring
- metadataobject
- removestring[]
- set
- *namestring
- *valuestring
- response
- add
- *namestring
- *valuestring
- bodystring
- metadataobject
- removestring[]
- set
- *namestring
- *valuestring
- status
- *ancestors
- *ancestorRef
- groupstring
- kindstring
- *namestring
- namespacestring
- portinteger
- sectionNamestring
- *conditions
- *lastTransitionTimestring
- *messagestring
- observedGenerationinteger
- *reasonstring
- *statusstring
- *typestring
- *controllerNamestring
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
Validation
Gateway (optionally, with asectionName indicating the listener), ListenerSet, Route(optionally, with a
sectionName indicating the route rule), or aService or Backend (optionally, with a sectionName indicating theport for
Service, or sub-backend for Backend).resource, like
Gateway, is just a way to easily apply a policy to agroup of backends.
merge. Precedence is given to more precise policies:
Gateway <Listener < Route < Route Rule < Backend or Service. Forexample, if a
Gateway policy sets tcp and tls, and a Backendpolicy sets
tls, the effective policy would be tcp from theGateway, and tls from the Backend.Validation
Documentation References (17)
ai specifies settings for AI workloads. This is only applicable whenconnecting to a
Backend of type ai.Validation
Documentation References (14)
Validation
Validation
Validation
Example:
{"fast": "gpt-3.5-turbo", "smart": "gpt-4-turbo"}.Note: This field is only applicable when using the agentgateway data plane.
Validation
Validation
Validation
Validation
LLM providers that use the
CHAT or CHAT_STREAMING API route type.Documentation References (3)
Documentation References (1)
Documentation References (1)
LLM provider model, such as
SYSTEM or USER in the OpenAI API.Documentation References (1)
Documentation References (3)
Documentation References (3)
LLM provider model, such as
SYSTEM or USER in the OpenAI API.Documentation References (3)
promptCaching enables automatic prompt caching for supportedproviders, currently AWS Bedrock.
Reduces API costs by caching static content like system prompts and tool definitions.
Only applicable for Bedrock Claude 3+ and Nova models.
Documentation References (1)
conversation. 0 (default) places it at the second-to-last message.
Higher values move it N additional messages towards the start, clamped
to bounds.
Validation
Caches all messages in the conversation for cost savings.
Validation
Documentation References (1)
Inserts a cache point after all system messages.
Validation
Documentation References (1)
Inserts a cache point after all tool specifications.
Validation
Documentation References (1)
before caching is enabled. Uses rough heuristic (word count × 1.3) to estimate tokens.
Bedrock requires at least 1,024 tokens for caching to be effective.
Validation
Documentation References (1)
promptGuard enables adding guardrails to LLM requests and responses.Validation
Validation
bedrockGuardrails configures AWS Bedrock Guardrails for promptguarding.
Documentation References (1)
Validation
Documentation References (1)
Documentation References (1)
auth defines settings for managing authentication to the backend.Validation
Documentation References (1)
When omitted, we will try to use the default AWS SDK authentication methods.
Documentation References (1)
secretRef references a Kubernetes Secret containing the AWScredentials. The
Secret must have keys accessKey, secretKey, andoptionally
sessionToken.Validation
Documentation References (1)
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Documentation References (1)
secretRef references a Kubernetes Secret containing the Azurecredentials. The
Secret must have keys clientID, tenantID, andclientSecret.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
When omitted, we will try to use the default AWS SDK authentication methods.
Validation
audience allows explicitly configuring the aud of the ID token. Onlyvalid with
IdToken type. If not set, the aud is automaticallyderived from the backend hostname.
Validation
generally an
AccessToken is used. To authenticate to Cloud Run, anIdToken is used.Validation
key provides an inline key to use as the value of theAuthorization header. This option is the least secure; usage of aSecret is preferred.Validation
location controls where backend credentials are inserted.If omitted, credentials are written to the
Authorization header with the Bearer prefix.This applies to
key, secretRef, and passthrough.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
passthrough passes through an existing token that has been sent by theclient and validated. Other policies, like JWT and API key
authentication, will strip the original client credentials. Passthrough backend authentication
causes the original token to be added back into the request. If there are no client authentication policies on the
request, the original token would be unchanged, so this would have no effect.
secretRef references a Kubernetes Secret storing the key to use asthe authorization value. This must be stored in the
Authorization key.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Validation
version specifies the HTTP protocol version to use when connecting tothe backend.
If not specified, the version is automatically determined:
*
Service types can specify it with appProtocol on the Serviceport.
* If traffic is identified as gRPC,
HTTP2 is used.* If the incoming traffic was plaintext HTTP, the original protocol will
be used.
* If the incoming traffic was HTTPS,
HTTP1 will be used. This isbecause most clients will transparently upgrade HTTPS traffic to
HTTP2, even if the backend doesn't support it.Validation
connectTimeout defines the deadline for establishing a connection tothe destination.
Validation
keepAlive defines settings for enabling TCP keepalives on theconnection.
If unset, this defaults to 180s.
Validation
If unset, this defaults to 9.
Validation
If unset, this defaults to 180s.
Validation
validate the server, and the SNI will automatically be set based on the destination.
Validation
alpnProtocols sets the Application-Layer Protocol Negotiation (ALPN)value to use in the TLS handshake.
["h2", "http/1.1"].Validation
caCertificateRefs defines the CA certificate ConfigMap to use toverify the server certificate.
If unset, the system's trusted certificates are used.
Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
WARNING: This is an insecure option that should only be used if the risks are understood.
*
All disables all TLS verification.*
Hostname verifies the CA certificate is trusted, but ignores anymismatch of hostname or SANs. Note that this method is still insecure;
prefer setting
verifySubjectAltNames to customize the valid hostnamesif possible.
Validation
mtlsCertificateRef enables mutual TLS to the backend, using thespecified key (
tls.key) and cert (tls.crt) from the referencedSecret.ca.cert field, if present, will be used to verify theserver certificate. If
caCertificateRefs is also specified, thecaCertificateRefs field takes priority.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sni specifies the Server Name Indicator (SNI) to be used in the TLShandshake. If unset, the
SNI is automatically set based on thedestination hostname.
Validation
verifySubjectAltNames specifies the Subject Alternative Names (SAN)to verify in the server certificate.
If not present, the destination hostname is automatically used.
Validation
tunnel defines settings for managing tunnel connections (with behavior like HTTPS_PROXY) to the backend.backendRef references the proxy server to reach.Supported types:
Service and Backend.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
us-west-2).Validation
Documentation References (1)
Validation
Documentation References (1)
googleModelArmor configures Google Model Armor for prompt guarding.Documentation References (1)
us-central1).Defaults to
us-central1 if not specified.Validation
Documentation References (1)
Documentation References (1)
auth defines settings for managing authentication to the backend.Validation
Documentation References (1)
When omitted, we will try to use the default AWS SDK authentication methods.
secretRef references a Kubernetes Secret containing the AWScredentials. The
Secret must have keys accessKey, secretKey, andoptionally
sessionToken.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
secretRef references a Kubernetes Secret containing the Azurecredentials. The
Secret must have keys clientID, tenantID, andclientSecret.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
When omitted, we will try to use the default AWS SDK authentication methods.
Validation
Documentation References (1)
audience allows explicitly configuring the aud of the ID token. Onlyvalid with
IdToken type. If not set, the aud is automaticallyderived from the backend hostname.
Validation
generally an
AccessToken is used. To authenticate to Cloud Run, anIdToken is used.Validation
Documentation References (1)
key provides an inline key to use as the value of theAuthorization header. This option is the least secure; usage of aSecret is preferred.Validation
location controls where backend credentials are inserted.If omitted, credentials are written to the
Authorization header with the Bearer prefix.This applies to
key, secretRef, and passthrough.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
passthrough passes through an existing token that has been sent by theclient and validated. Other policies, like JWT and API key
authentication, will strip the original client credentials. Passthrough backend authentication
causes the original token to be added back into the request. If there are no client authentication policies on the
request, the original token would be unchanged, so this would have no effect.
secretRef references a Kubernetes Secret storing the key to use asthe authorization value. This must be stored in the
Authorization key.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Validation
version specifies the HTTP protocol version to use when connecting tothe backend.
If not specified, the version is automatically determined:
*
Service types can specify it with appProtocol on the Serviceport.
* If traffic is identified as gRPC,
HTTP2 is used.* If the incoming traffic was plaintext HTTP, the original protocol will
be used.
* If the incoming traffic was HTTPS,
HTTP1 will be used. This isbecause most clients will transparently upgrade HTTPS traffic to
HTTP2, even if the backend doesn't support it.Validation
connectTimeout defines the deadline for establishing a connection tothe destination.
Validation
keepAlive defines settings for enabling TCP keepalives on theconnection.
If unset, this defaults to 180s.
Validation
If unset, this defaults to 9.
Validation
If unset, this defaults to 180s.
Validation
validate the server, and the SNI will automatically be set based on the destination.
Validation
alpnProtocols sets the Application-Layer Protocol Negotiation (ALPN)value to use in the TLS handshake.
["h2", "http/1.1"].Validation
caCertificateRefs defines the CA certificate ConfigMap to use toverify the server certificate.
If unset, the system's trusted certificates are used.
Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
WARNING: This is an insecure option that should only be used if the risks are understood.
*
All disables all TLS verification.*
Hostname verifies the CA certificate is trusted, but ignores anymismatch of hostname or SANs. Note that this method is still insecure;
prefer setting
verifySubjectAltNames to customize the valid hostnamesif possible.
Validation
mtlsCertificateRef enables mutual TLS to the backend, using thespecified key (
tls.key) and cert (tls.crt) from the referencedSecret.ca.cert field, if present, will be used to verify theserver certificate. If
caCertificateRefs is also specified, thecaCertificateRefs field takes priority.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sni specifies the Server Name Indicator (SNI) to be used in the TLShandshake. If unset, the
SNI is automatically set based on thedestination hostname.
Validation
verifySubjectAltNames specifies the Subject Alternative Names (SAN)to verify in the server certificate.
If not present, the destination hostname is automatically used.
Validation
tunnel defines settings for managing tunnel connections (with behavior like HTTPS_PROXY) to the backend.backendRef references the proxy server to reach.Supported types:
Service and Backend.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Validation
Documentation References (1)
Validation
Documentation References (1)
openAIModeration passes prompt data through the OpenAI Moderationsendpoint.
See https://developers.openai.com/api/reference/resources/moderations for more information.
Documentation References (2)
model specifies the moderation model to use. For example,omni-moderation.Documentation References (2)
Documentation References (2)
auth defines settings for managing authentication to the backend.Validation
Documentation References (2)
When omitted, we will try to use the default AWS SDK authentication methods.
secretRef references a Kubernetes Secret containing the AWScredentials. The
Secret must have keys accessKey, secretKey, andoptionally
sessionToken.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
secretRef references a Kubernetes Secret containing the Azurecredentials. The
Secret must have keys clientID, tenantID, andclientSecret.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
When omitted, we will try to use the default AWS SDK authentication methods.
Validation
audience allows explicitly configuring the aud of the ID token. Onlyvalid with
IdToken type. If not set, the aud is automaticallyderived from the backend hostname.
Validation
generally an
AccessToken is used. To authenticate to Cloud Run, anIdToken is used.Validation
key provides an inline key to use as the value of theAuthorization header. This option is the least secure; usage of aSecret is preferred.Validation
location controls where backend credentials are inserted.If omitted, credentials are written to the
Authorization header with the Bearer prefix.This applies to
key, secretRef, and passthrough.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
passthrough passes through an existing token that has been sent by theclient and validated. Other policies, like JWT and API key
authentication, will strip the original client credentials. Passthrough backend authentication
causes the original token to be added back into the request. If there are no client authentication policies on the
request, the original token would be unchanged, so this would have no effect.
secretRef references a Kubernetes Secret storing the key to use asthe authorization value. This must be stored in the
Authorization key.Validation
Documentation References (2)
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Documentation References (2)
Validation
version specifies the HTTP protocol version to use when connecting tothe backend.
If not specified, the version is automatically determined:
*
Service types can specify it with appProtocol on the Serviceport.
* If traffic is identified as gRPC,
HTTP2 is used.* If the incoming traffic was plaintext HTTP, the original protocol will
be used.
* If the incoming traffic was HTTPS,
HTTP1 will be used. This isbecause most clients will transparently upgrade HTTPS traffic to
HTTP2, even if the backend doesn't support it.Validation
connectTimeout defines the deadline for establishing a connection tothe destination.
Validation
keepAlive defines settings for enabling TCP keepalives on theconnection.
If unset, this defaults to 180s.
Validation
If unset, this defaults to 9.
Validation
If unset, this defaults to 180s.
Validation
validate the server, and the SNI will automatically be set based on the destination.
Validation
alpnProtocols sets the Application-Layer Protocol Negotiation (ALPN)value to use in the TLS handshake.
["h2", "http/1.1"].Validation
caCertificateRefs defines the CA certificate ConfigMap to use toverify the server certificate.
If unset, the system's trusted certificates are used.
Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
WARNING: This is an insecure option that should only be used if the risks are understood.
*
All disables all TLS verification.*
Hostname verifies the CA certificate is trusted, but ignores anymismatch of hostname or SANs. Note that this method is still insecure;
prefer setting
verifySubjectAltNames to customize the valid hostnamesif possible.
Validation
mtlsCertificateRef enables mutual TLS to the backend, using thespecified key (
tls.key) and cert (tls.crt) from the referencedSecret.ca.cert field, if present, will be used to verify theserver certificate. If
caCertificateRefs is also specified, thecaCertificateRefs field takes priority.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sni specifies the Server Name Indicator (SNI) to be used in the TLShandshake. If unset, the
SNI is automatically set based on thedestination hostname.
Validation
verifySubjectAltNames specifies the Subject Alternative Names (SAN)to verify in the server certificate.
If not present, the destination hostname is automatically used.
Validation
tunnel defines settings for managing tunnel connections (with behavior like HTTPS_PROXY) to the backend.backendRef references the proxy server to reach.Supported types:
Service and Backend.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (3)
This setting applies only to request matches.
PromptguardResponsematches are always masked by default.
Defaults to
Mask.Validation
Documentation References (3)
Matches and built-ins are additive.
Documentation References (2)
Matches and built-ins are additive.
Documentation References (2)
The request was rejected due to inappropriate content.Validation
Documentation References (4)
The request was rejected due to inappropriate content.Validation
Documentation References (4)
Validation
Documentation References (1)
Documentation References (3)
Validation
Documentation References (3)
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Documentation References (3)
Validation
Documentation References (3)
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (3)
used to select the headers to forward to the webhook.
Request headers are used when forwarding requests and response headers
are used when forwarding responses.
By default, no headers are forwarded.
case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
entry with an equivalent name MUST be considered for a match. Subsequent
entries with an equivalent header name MUST be ignored. Due to the
case-insensitivity of header names, "foo" and "Foo" are considered
equivalent.
implementation-specific behavior as to how this is represented.
Generally, proxies should follow the guidance from the RFC:
https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2.2 regarding
processing a repeated header, with special handling for "Set-Cookie".
Validation
conformance, implementations can support POSIX, PCRE or any other dialects
of regular expressions. Please read the implementation's documentation to
determine the supported dialect.
Validation
<gateway:experimental:description>
Must consist of printable US-ASCII characters, optionally separated
by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
</gateway:experimental:description>
^[!-~]+([\t ]?[!-~]+)*$>Validation
Validation
bedrockGuardrails configures AWS Bedrock Guardrails for promptguarding.
Documentation References (1)
Validation
Documentation References (1)
Documentation References (1)
auth defines settings for managing authentication to the backend.Validation
Documentation References (1)
When omitted, we will try to use the default AWS SDK authentication methods.
Documentation References (1)
secretRef references a Kubernetes Secret containing the AWScredentials. The
Secret must have keys accessKey, secretKey, andoptionally
sessionToken.Validation
Documentation References (1)
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Documentation References (1)
secretRef references a Kubernetes Secret containing the Azurecredentials. The
Secret must have keys clientID, tenantID, andclientSecret.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
When omitted, we will try to use the default AWS SDK authentication methods.
Validation
audience allows explicitly configuring the aud of the ID token. Onlyvalid with
IdToken type. If not set, the aud is automaticallyderived from the backend hostname.
Validation
generally an
AccessToken is used. To authenticate to Cloud Run, anIdToken is used.Validation
key provides an inline key to use as the value of theAuthorization header. This option is the least secure; usage of aSecret is preferred.Validation
location controls where backend credentials are inserted.If omitted, credentials are written to the
Authorization header with the Bearer prefix.This applies to
key, secretRef, and passthrough.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
passthrough passes through an existing token that has been sent by theclient and validated. Other policies, like JWT and API key
authentication, will strip the original client credentials. Passthrough backend authentication
causes the original token to be added back into the request. If there are no client authentication policies on the
request, the original token would be unchanged, so this would have no effect.
secretRef references a Kubernetes Secret storing the key to use asthe authorization value. This must be stored in the
Authorization key.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Validation
version specifies the HTTP protocol version to use when connecting tothe backend.
If not specified, the version is automatically determined:
*
Service types can specify it with appProtocol on the Serviceport.
* If traffic is identified as gRPC,
HTTP2 is used.* If the incoming traffic was plaintext HTTP, the original protocol will
be used.
* If the incoming traffic was HTTPS,
HTTP1 will be used. This isbecause most clients will transparently upgrade HTTPS traffic to
HTTP2, even if the backend doesn't support it.Validation
connectTimeout defines the deadline for establishing a connection tothe destination.
Validation
keepAlive defines settings for enabling TCP keepalives on theconnection.
If unset, this defaults to 180s.
Validation
If unset, this defaults to 9.
Validation
If unset, this defaults to 180s.
Validation
validate the server, and the SNI will automatically be set based on the destination.
Validation
alpnProtocols sets the Application-Layer Protocol Negotiation (ALPN)value to use in the TLS handshake.
["h2", "http/1.1"].Validation
caCertificateRefs defines the CA certificate ConfigMap to use toverify the server certificate.
If unset, the system's trusted certificates are used.
Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
WARNING: This is an insecure option that should only be used if the risks are understood.
*
All disables all TLS verification.*
Hostname verifies the CA certificate is trusted, but ignores anymismatch of hostname or SANs. Note that this method is still insecure;
prefer setting
verifySubjectAltNames to customize the valid hostnamesif possible.
Validation
mtlsCertificateRef enables mutual TLS to the backend, using thespecified key (
tls.key) and cert (tls.crt) from the referencedSecret.ca.cert field, if present, will be used to verify theserver certificate. If
caCertificateRefs is also specified, thecaCertificateRefs field takes priority.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sni specifies the Server Name Indicator (SNI) to be used in the TLShandshake. If unset, the
SNI is automatically set based on thedestination hostname.
Validation
verifySubjectAltNames specifies the Subject Alternative Names (SAN)to verify in the server certificate.
If not present, the destination hostname is automatically used.
Validation
tunnel defines settings for managing tunnel connections (with behavior like HTTPS_PROXY) to the backend.backendRef references the proxy server to reach.Supported types:
Service and Backend.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
us-west-2).Validation
Documentation References (1)
Validation
Documentation References (1)
googleModelArmor configures Google Model Armor for prompt guarding.Documentation References (1)
us-central1).Defaults to
us-central1 if not specified.Validation
Documentation References (1)
Documentation References (1)
auth defines settings for managing authentication to the backend.Validation
Documentation References (1)
When omitted, we will try to use the default AWS SDK authentication methods.
secretRef references a Kubernetes Secret containing the AWScredentials. The
Secret must have keys accessKey, secretKey, andoptionally
sessionToken.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
secretRef references a Kubernetes Secret containing the Azurecredentials. The
Secret must have keys clientID, tenantID, andclientSecret.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
When omitted, we will try to use the default AWS SDK authentication methods.
Validation
Documentation References (1)
audience allows explicitly configuring the aud of the ID token. Onlyvalid with
IdToken type. If not set, the aud is automaticallyderived from the backend hostname.
Validation
generally an
AccessToken is used. To authenticate to Cloud Run, anIdToken is used.Validation
Documentation References (1)
key provides an inline key to use as the value of theAuthorization header. This option is the least secure; usage of aSecret is preferred.Validation
location controls where backend credentials are inserted.If omitted, credentials are written to the
Authorization header with the Bearer prefix.This applies to
key, secretRef, and passthrough.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
passthrough passes through an existing token that has been sent by theclient and validated. Other policies, like JWT and API key
authentication, will strip the original client credentials. Passthrough backend authentication
causes the original token to be added back into the request. If there are no client authentication policies on the
request, the original token would be unchanged, so this would have no effect.
secretRef references a Kubernetes Secret storing the key to use asthe authorization value. This must be stored in the
Authorization key.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Validation
version specifies the HTTP protocol version to use when connecting tothe backend.
If not specified, the version is automatically determined:
*
Service types can specify it with appProtocol on the Serviceport.
* If traffic is identified as gRPC,
HTTP2 is used.* If the incoming traffic was plaintext HTTP, the original protocol will
be used.
* If the incoming traffic was HTTPS,
HTTP1 will be used. This isbecause most clients will transparently upgrade HTTPS traffic to
HTTP2, even if the backend doesn't support it.Validation
connectTimeout defines the deadline for establishing a connection tothe destination.
Validation
keepAlive defines settings for enabling TCP keepalives on theconnection.
If unset, this defaults to 180s.
Validation
If unset, this defaults to 9.
Validation
If unset, this defaults to 180s.
Validation
validate the server, and the SNI will automatically be set based on the destination.
Validation
alpnProtocols sets the Application-Layer Protocol Negotiation (ALPN)value to use in the TLS handshake.
["h2", "http/1.1"].Validation
caCertificateRefs defines the CA certificate ConfigMap to use toverify the server certificate.
If unset, the system's trusted certificates are used.
Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
WARNING: This is an insecure option that should only be used if the risks are understood.
*
All disables all TLS verification.*
Hostname verifies the CA certificate is trusted, but ignores anymismatch of hostname or SANs. Note that this method is still insecure;
prefer setting
verifySubjectAltNames to customize the valid hostnamesif possible.
Validation
mtlsCertificateRef enables mutual TLS to the backend, using thespecified key (
tls.key) and cert (tls.crt) from the referencedSecret.ca.cert field, if present, will be used to verify theserver certificate. If
caCertificateRefs is also specified, thecaCertificateRefs field takes priority.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
sni specifies the Server Name Indicator (SNI) to be used in the TLShandshake. If unset, the
SNI is automatically set based on thedestination hostname.
Validation
verifySubjectAltNames specifies the Subject Alternative Names (SAN)to verify in the server certificate.
If not present, the destination hostname is automatically used.
Validation
tunnel defines settings for managing tunnel connections (with behavior like HTTPS_PROXY) to the backend.backendRef references the proxy server to reach.Supported types:
Service and Backend.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Validation
Documentation References (1)
Validation
Documentation References (1)
Documentation References (3)
This setting applies only to request matches.
PromptguardResponsematches are always masked by default.
Defaults to
Mask.Validation
Documentation References (3)
Matches and built-ins are additive.
Documentation References (3)
Matches and built-ins are additive.
The response was rejected due to inappropriate content.Validation
The request was rejected due to inappropriate content.Validation
Validation
Documentation References (3)
Validation
Documentation References (3)
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Documentation References (3)
Validation
Documentation References (3)
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (3)
used to select the headers to forward to the webhook.
Request headers are used when forwarding requests and response headers
are used when forwarding responses.
By default, no headers are forwarded.
case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
entry with an equivalent name MUST be considered for a match. Subsequent
entries with an equivalent header name MUST be ignored. Due to the
case-insensitivity of header names, "foo" and "Foo" are considered
equivalent.
implementation-specific behavior as to how this is represented.
Generally, proxies should follow the guidance from the RFC:
https://www.rfc-editor.org/rfc/rfc7230.html#section-3.2.2 regarding
processing a repeated header, with special handling for "Set-Cookie".
Validation
conformance, implementations can support POSIX, PCRE or any other dialects
of regular expressions. Please read the implementation's documentation to
determine the supported dialect.
Validation
<gateway:experimental:description>
Must consist of printable US-ASCII characters, optionally separated
by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
</gateway:experimental:description>
^[!-~]+([\t ]?[!-~]+)*$>Validation
routes defines how to identify the type of traffic to handle.The keys are URL path suffixes matched using ends-with comparison, for
example
"/v1/chat/completions".The special
* wildcard matches any path.If not specified, all traffic defaults to
completions type.The expression result overwrites any existing value for that field.
This has a higher priority than
overrides if both are set for the samekey.
Validation
Documentation References (2)
Validation
Documentation References (2)
Validation
Documentation References (2)
auth defines settings for managing authentication to the backend.Validation
When omitted, we will try to use the default AWS SDK authentication methods.
secretRef references a Kubernetes Secret containing the AWScredentials. The
Secret must have keys accessKey, secretKey, andoptionally
sessionToken.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
secretRef references a Kubernetes Secret containing the Azurecredentials. The
Secret must have keys clientID, tenantID, andclientSecret.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
When omitted, we will try to use the default AWS SDK authentication methods.
Validation
audience allows explicitly configuring the aud of the ID token. Onlyvalid with
IdToken type. If not set, the aud is automaticallyderived from the backend hostname.
Validation
generally an
AccessToken is used. To authenticate to Cloud Run, anIdToken is used.Validation
key provides an inline key to use as the value of theAuthorization header. This option is the least secure; usage of aSecret is preferred.Validation
location controls where backend credentials are inserted.If omitted, credentials are written to the
Authorization header with the Bearer prefix.This applies to
key, secretRef, and passthrough.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
passthrough passes through an existing token that has been sent by theclient and validated. Other policies, like JWT and API key
authentication, will strip the original client credentials. Passthrough backend authentication
causes the original token to be added back into the request. If there are no client authentication policies on the
request, the original token would be unchanged, so this would have no effect.
secretRef references a Kubernetes Secret storing the key to use asthe authorization value. This must be stored in the
Authorization key.Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Documentation References (1)
Documentation References (1)
For example, a value of 5 means the backend must receive 5 unhealthy responses in a row before being evicted.
When both consecutiveFailures and healthThreshold are set, the backend is evicted when either condition is met.
When neither is set, a single unhealthy response can trigger eviction.
Validation
Documentation References (1)
Subsequent evictions use multiplicative backoff (duration * times_evicted).
If all endpoints are evicted, the load balancer falls back to returning evicted endpoints
rather than failing entirely.
If unset, defaults to
3s.Validation
Documentation References (1)
When set, a backend is only evicted if its computed health drops below this value after an unhealthy response.
For example, 50 means the backend is evicted when its EWMA health falls below 50% following failures.
Unlike consecutiveFailures (which counts consecutive failures), this uses a sliding-window average
so a single success in a stream of failures can delay eviction.
When both consecutiveFailures and healthThreshold are set, the backend is evicted when either condition is met.
When neither is set, a single unhealthy response triggers eviction.
Validation
For gradual recovery, set below 100; for full recovery immediately, set 100.
If unset, the backend resumes with the health it had when evicted.
Validation
When the expression evaluates to true, the backend is considered unhealthy and may be evicted.
response.code >= 500.This default lowers the backend's health score but does not trigger eviction on its own.
Validation
Documentation References (1)
Validation
version specifies the HTTP protocol version to use when connecting tothe backend.
If not specified, the version is automatically determined:
*
Service types can specify it with appProtocol on the Serviceport.
* If traffic is identified as gRPC,
HTTP2 is used.* If the incoming traffic was plaintext HTTP, the original protocol will
be used.
* If the incoming traffic was HTTPS,
HTTP1 will be used. This isbecause most clients will transparently upgrade HTTPS traffic to
HTTP2, even if the backend doesn't support it.Validation
mcp specifies settings for MCP workloads. This is only applicable whenconnecting to a
Backend of type mcp.Validation
Documentation References (1)
authentication defines MCPBackend-specific authentication rules.jwtAuthentication.mcp, which ensures authentication runs beforeother policies such as transformation and rate limiting.
audiences specifies the list of allowed audiences that are allowedaccess. This corresponds to the
aud claim([RFC 7519 §4.1.3](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3)).
If unset, any audience is allowed.
Validation
issuer identifies the IdP that issued the JWT. This corresponds to theiss claim ([RFC 7519 §4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1)).Validation
jwks defines the remote JSON Web Key used to validate the signature ofthe JWT.
backendRef references the remote JWKS server to reach.Supported types are
Service and static Backend. AnAgentgatewayPolicy containing backend TLS config can then be attachedto the
Service or Backend in order to set TLS options for aconnection to the remote
jwks source.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Validation
jwks endpoint, relative to the root, commonly".well-known/jwks.json".Validation
mode is the validation mode for JWT authentication.Validation
provider specifies the identity provider to use for authentication.Validation
unauthorized requests with a
403 error, this policy works at theMCPBackend level.list_tools, will have each item evaluated.Items that do not meet the rule will be filtered.
call_tool, will evaluate the specificitem and reject requests that do not meet the rule.
Documentation References (1)
action defines whether the rule allows, denies, or requires the request ifmatched. If unspecified, the default is
Allow.Require policies are conjunctive across merged policies: all require policies must match.
Validation
Documentation References (1)
policy specifies the authorization rule to evaluate.Allow rules: any policy allows the request.* For
Require rules: all policies must match for the request to be allowed.* For
Deny rules: any matching policy denies the request. Note: a CEL expression that fails to evaluate is notconsidered to match, making this a risky policy; prefer to use
Require.Allow rule triggers a deny-by-default policy, requiring at least 1 match to allow.With no rules, all requires are allowed.
Documentation References (1)
These expressions should be in the form of a Common Expression Language
(
CEL) expression.Validation
Documentation References (1)
connectTimeout defines the deadline for establishing a connection tothe destination.
Validation
keepAlive defines settings for enabling TCP keepalives on theconnection.
If unset, this defaults to 180s.
Validation
If unset, this defaults to 9.
Validation
If unset, this defaults to 180s.
Validation
validate the server, and the SNI will automatically be set based on the destination.
Validation
Documentation References (1)
alpnProtocols sets the Application-Layer Protocol Negotiation (ALPN)value to use in the TLS handshake.
["h2", "http/1.1"].Validation
caCertificateRefs defines the CA certificate ConfigMap to use toverify the server certificate.
If unset, the system's trusted certificates are used.
Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
WARNING: This is an insecure option that should only be used if the risks are understood.
*
All disables all TLS verification.*
Hostname verifies the CA certificate is trusted, but ignores anymismatch of hostname or SANs. Note that this method is still insecure;
prefer setting
verifySubjectAltNames to customize the valid hostnamesif possible.
Validation
mtlsCertificateRef enables mutual TLS to the backend, using thespecified key (
tls.key) and cert (tls.crt) from the referencedSecret.ca.cert field, if present, will be used to verify theserver certificate. If
caCertificateRefs is also specified, thecaCertificateRefs field takes priority.Validation
Documentation References (1)
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Documentation References (1)
sni specifies the Server Name Indicator (SNI) to be used in the TLShandshake. If unset, the
SNI is automatically set based on thedestination hostname.
Validation
Documentation References (1)
verifySubjectAltNames specifies the Subject Alternative Names (SAN)to verify in the server certificate.
If not present, the destination hostname is automatically used.
Validation
Validation
request is used to modify the request path.Validation
add is a list of headers to add to the request and what that valueshould be set to. If there is already a header with these values then
append the value as an extra entry.
Validation
Validation
value is the CEL expression to apply to generate the output value forthe header.
Validation
body controls manipulation of the HTTP body.Validation
metadata stores CEL-evaluated values under the metadata CEL variablefor subsequent policy evaluations.
metadata is evaluated before headeror body transformations.
Validation
remove is a list of header names to remove from the request orresponse.
Validation
set is a list of headers and the value they should be set to.Validation
Validation
value is the CEL expression to apply to generate the output value forthe header.
Validation
response is used to modify the response path.Validation
add is a list of headers to add to the request and what that valueshould be set to. If there is already a header with these values then
append the value as an extra entry.
Validation
Validation
value is the CEL expression to apply to generate the output value forthe header.
Validation
body controls manipulation of the HTTP body.Validation
metadata stores CEL-evaluated values under the metadata CEL variablefor subsequent policy evaluations.
metadata is evaluated before headeror body transformations.
Validation
remove is a list of header names to remove from the request orresponse.
Validation
set is a list of headers and the value they should be set to.Validation
Validation
value is the CEL expression to apply to generate the output value forthe header.
Validation
tunnel defines settings for managing tunnel connections (with behavior like HTTPS_PROXY) to the backend.backendRef references the proxy server to reach.Supported types:
Service and Backend.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Gateway. Listener andListenerSet are not valid targets.merge. For example, policy A sets
tcp and tls, and policy B setstls; the effective policy would be tcp from policy A, and tls frompolicy B.
Validation
accessLog contains access logging configuration.Documentation References (2)
attributes specifies customizations to the key-value pairs that arelogged.
Validation
Documentation References (2)
add specifies additional key-value pairs to be added to each entry.The value is a CEL expression. If the CEL expression fails to evaluate,
the pair will be excluded.
Validation
Documentation References (2)
Validation
Documentation References (2)
Validation
Documentation References (2)
remove lists the default fields that should be removed. For example,http.method.Validation
filter specifies a CEL expression that is used to filter logs. A logwill only be emitted if the expression evaluates to
true.Validation
Documentation References (2)
otlp configures OTLP access log export to anOpenTelemetry-compatible backend.
Validation
backendRef references the OTLP server to send access logs to.Supported types:
Service and AgentgatewayBackend.Validation
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
path specifies the OTLP/HTTP path to use. This is only applicablewhen
protocol is HTTP. If unset, this defaults to /v1/logs.Validation
protocol specifies the OTLP protocol variant to use.Validation
Validation
Documentation References (4)
http1IdleTimeout defines the timeout before an unused connection isclosed.
If unset, this defaults to 10 minutes.
Validation
Documentation References (1)
http1MaxHeaders defines the maximum number of headers that are allowedin
HTTP/1.1 requests.If unset, this defaults to 100.
Validation
Documentation References (1)
http2ConnectionWindowSize indicates the initial window size forconnection-level flow control for received data.
Validation
Documentation References (1)
http2FrameSize sets the maximum frame size to use.If unset, this defaults to
16kb.Validation
Documentation References (1)
Validation
Documentation References (1)
Validation
Documentation References (1)
http2WindowSize indicates the initial window size for stream-level flowcontrol for received data.
Validation
Documentation References (1)
maxBufferSize defines the maximum HTTP body size that will be bufferedinto memory.
Bodies will only be buffered for policies which require buffering.
If unset, this defaults to
2mb.Validation
Documentation References (1)
maxConnectionDuration specifies the maximum time a connection is allowed to remain open.After this duration, the connection is gracefully closed after the current in-flight request completes.
Useful for ensuring even traffic distribution behind load balancers during scaling events.
Validation
metrics contains custom Prometheus metric label configuration.CEL expressions are evaluated per-request and added as labels to all
Prometheus metrics exposed by agentgateway.
attributes specifies customizations to the labels that areadded to Prometheus metrics.
Validation
add specifies additional key-value pairs to be added as custom labelsto all Prometheus metrics. The value is a CEL expression evaluated
per-request. If the CEL expression fails to evaluate, the label value
is set to "unknown".
increase Prometheus storage and memory usage. Prefer low-cardinality
dimensions like team or environment.
Validation
Validation
Validation
for example using
source.address with cidr(...).containsIP(...).action defines whether the rule allows, denies, or requires the request ifmatched. If unspecified, the default is
Allow.Require policies are conjunctive across merged policies: all require policies must match.
Validation
policy specifies the authorization rule to evaluate.Allow rules: any policy allows the request.* For
Require rules: all policies must match for the request to be allowed.* For
Deny rules: any matching policy denies the request. Note: a CEL expression that fails to evaluate is notconsidered to match, making this a risky policy; prefer to use
Require.Allow rule triggers a deny-by-default policy, requiring at least 1 match to allow.With no rules, all requires are allowed.
These expressions should be in the form of a Common Expression Language
(
CEL) expression.Validation
normal protocol handling. This can also be configured to allow both
PROXY and non-PROXY traffic on the same listener.
Strict.Validation
V2.Validation
Validation
Documentation References (1)
Documentation References (1)
If unset, this defaults to 180s.
Validation
Documentation References (1)
If unset, this defaults to 9.
Validation
Documentation References (1)
If unset, this defaults to 180s.
Validation
Documentation References (1)
Validation
Documentation References (1)
alpnProtocols sets the Application-Layer Protocol Negotiation (ALPN)value to use in the TLS handshake.
["h2", "http/1.1"].Validation
Documentation References (1)
The value is a comma-separated list of cipher suites, for example
TLS13_AES_256_GCM_SHA384,TLS13_AES_128_GCM_SHA256.Use this in the TLS options field of a TLS listener.
Documentation References (1)
handshakeTimeout specifies the deadline for a TLS handshake tocomplete. If unset, this defaults to
15s.Validation
Documentation References (1)
Validation
Documentation References (1)
Validation
Documentation References (1)
tracing contains various settings for the OpenTelemetry tracer.Validation
Documentation References (1)
attributes specifies customizations to the key-value pairs that areincluded in the trace.
Validation
Documentation References (1)
add specifies additional key-value pairs to be added to each entry.The value is a CEL expression. If the CEL expression fails to evaluate,
the pair will be excluded.
Validation
Documentation References (1)
Validation
Documentation References (1)
Validation
Documentation References (1)
remove lists the default fields that should be removed. For example,http.method.Validation
backendRef references the OTLP server to reach.Supported types:
Service and AgentgatewayBackend.Validation
Documentation References (1)
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
Documentation References (1)
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Documentation References (1)
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (1)
clientSampling is an expression to determine the amount of clientsampling. Client sampling determines whether to initiate a new trace
span if the incoming request does have a trace already. This should
evaluate to a float between
0.0 and 1.0, or a boolean (true orfalse). If unspecified, client sampling is 100% enabled.Validation
Documentation References (1)
path specifies the OTLP path to use. This is only applicable whenprotocol is HTTP. If unset, this defaults to /v1/traces.Validation
protocol specifies the OTLP protocol variant to use.Validation
Documentation References (1)
randomSampling is an expression to determine the amount of randomsampling. Random sampling will initiate a new trace span if the incoming
request does not have a trace initiated already. This should evaluate to
a float between
0.0 and 1.0, or a boolean (true or false). Ifunspecified, random sampling is disabled.
Validation
Documentation References (1)
resources describes the entity producing telemetry and specifies theresources to be included in the trace.
Documentation References (1)
Validation
Documentation References (1)
Validation
Documentation References (1)
targetRefs specifies the target resources by reference to attach thepolicy to.
Validation
For Kubernetes Gateway API resources, the group is
gateway.networking.k8s.io.Validation
Gateway or HTTPRoute.Validation
Validation
Validation
targetSelectors specifies the target selectors used to select resourcesto attach the policy to.
Validation
For Kubernetes Gateway API resources, the group is
gateway.networking.k8s.io.Validation
Gateway or HTTPRoute.Validation
Validation
Gateway (optionally, with asectionName indicating the listener), ListenerSet, or Route(optionally, with a
sectionName indicating the route rule).merge. Precedence is given to more precise policies:
Gateway <Listener < Route < Route Rule. For example, policy A setstimeouts and retries, and policy B sets retries; the effectivepolicy would be
timeouts from policy A, and retries from policy B.Validation
Documentation References (40)
apiKeyAuthentication authenticates users based on a configured APIkey.
Validation
Documentation References (1)
location controls where API keys are read from.If omitted, credentials are read from the
Authorization header with the Bearer prefix.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
mode is the validation mode for API key authentication.Validation
Documentation References (1)
secretRef references a Kubernetes Secret storing a set of API keys.If there are many keys,
secretSelector can be used instead.Secret represents one API key. The key is anarbitrary identifier. The value can either be:
* A string representing the API key.
* A JSON object with two fields,
key and metadata. key containsthe API key.
metadata contains arbitrary JSON metadata associatedwith the key, which may be used by other policies. For example, you
may write an authorization policy allowing
apiKey.group == 'sales'.apiVersion: v1
kind: Secret
metadata:
name: api-key
stringData:
client1: |
{
"key": "k-123",
"metadata": {
"group": "sales",
"created_at": "2024-10-01T12:00:00Z"
}
}
client2: "k-456"Validation
Documentation References (1)
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
Documentation References (1)
secretSelector selects multiple Secret resources containing APIkeys. If the same key is defined in multiple secrets, the behavior is
undefined.
Secret represents one API key. The key is anarbitrary identifier. The value can either be:
* A string representing the API key.
* A JSON object with two fields,
key and metadata. key containsthe API key.
metadata contains arbitrary JSON metadata associatedwith the key, which may be used by other policies. For example, you
may write an authorization policy allowing
apiKey.group == 'sales'.apiVersion: v1
kind: Secret
metadata:
name: api-key
stringData:
client1: |
{
"key": "k-123",
"metadata": {
"group": "sales",
"created_at": "2024-10-01T12:00:00Z"
}
}
client2: "k-456"Documentation References (1)
Documentation References (1)
authorization specifies the access rules based on roles andpermissions.
If multiple authorization rules are applied across different policies (at the same, or different, attahcment points),
all rules are merged.
Documentation References (2)
action defines whether the rule allows, denies, or requires the request ifmatched. If unspecified, the default is
Allow.Require policies are conjunctive across merged policies: all require policies must match.
Validation
Documentation References (2)
policy specifies the authorization rule to evaluate.Allow rules: any policy allows the request.* For
Require rules: all policies must match for the request to be allowed.* For
Deny rules: any matching policy denies the request. Note: a CEL expression that fails to evaluate is notconsidered to match, making this a risky policy; prefer to use
Require.Allow rule triggers a deny-by-default policy, requiring at least 1 match to allow.With no rules, all requires are allowed.
Documentation References (2)
These expressions should be in the form of a Common Expression Language
(
CEL) expression.Validation
Documentation References (2)
basicAuthentication authenticates users based on the Basicauthentication scheme (RFC 7617), where a username and password are
encoded in the request.
Validation
location controls where Basic credentials are read from.If omitted, credentials are read from the
Authorization header with the Basic prefix.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
mode is the validation mode for basic auth authentication.Validation
realm specifies the realm to return in the WWW-Authenticateheader for failed authentication requests. If unset,
Restricted willbe used.
secretRef references a Kubernetes Secret storing the .htaccessfile. The
Secret must have a key named .htaccess, and should containthe complete
.htaccess file.htpasswd or similar commandsto generate a hash. MD5, bcrypt, crypt, and SHA-1 are supported.
apiVersion: v1
kind: Secret
metadata:
name: basic-auth
stringData:
.htaccess: |
alice:$apr1$3zSE0Abt$IuETi4l5yO87MuOrbSE4V.
bob:$apr1$Ukb5LgRD$EPY2lIfY.A54jzLELNIId/Validation
This field is effectively required, but due to backwards compatibility is
allowed to be empty. Instances of this type with an empty value here are
almost certainly wrong.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
users provides an inline list of username and password pairs that willbe accepted. Each entry represents one line of the
htpasswd format:https://httpd.apache.org/docs/2.4/programs/htpasswd.html.
htpasswd or similar commandsto generate a hash. MD5, bcrypt, crypt, and SHA-1 are supported.
users:
- "user1:$apr1$ivPt0D4C$DmRhnewfHRSrb3DQC.WHC."
- "user2:$2y$05$r3J4d3VepzFkedkd/q1vI.pBYIpSqjfN0qOARV3ScUHysatnS0cL2"Validation
Validation
Documentation References (1)
to include credentials.
Access-Control-Allow-Credentialsresponse header with value true (case-sensitive).
Access-Control-Allow-Credentials entirely (this is the standard CORSbehavior).
accessing the requested resource.
Access-Control-Allow-Headersresponse header are separated by a comma (",").
AllowHeaders field is configured with one or more headers, thegateway must return the
Access-Control-Allow-Headers response headerwhich value is present in the
AllowHeaders field.Access-Control-Request-Headers request headeris not included in the list of header names specified by the response
header
Access-Control-Allow-Headers, it will present an error on theclient side.
Access-Control-Allow-Headers response headerdoes not recognize by the client, it will also occur an error on the
client side.
If config contains the wildcard "*" in allowHeaders and the request is
not credentialed, the
Access-Control-Allow-Headers response headercan either use the
* wildcard or the value ofAccess-Control-Request-Headers from the request.
*wildcard in the
Access-Control-Allow-Headers response header. Whenalso the
AllowCredentials field is true and AllowHeaders fieldis specified with the
* wildcard, the gateway must specify one or moreHTTP headers in the value of the
Access-Control-Allow-Headers responseheader. The value of the header
Access-Control-Allow-Headers is same asthe
Access-Control-Request-Headers header provided by the client. Ifthe header
Access-Control-Request-Headers is not included in therequest, the gateway will omit the
Access-Control-Allow-Headersresponse header, instead of specifying the
* wildcard.Validation
Documentation References (1)
requested resource.
value
*, which represents all HTTP methods are allowed.(See https://www.rfc-editor.org/rfc/rfc2616#section-5.1.1)
Access-Control-Allow-Methodsresponse header are separated by a comma (",").
GET, HEAD, or POST.(See https://fetch.spec.whatwg.org/#cors-safelisted-method) The
CORS-safelisted methods are always allowed, regardless of whether they
are specified in the
AllowMethods field.AllowMethods field is configured with one or more methods, thegateway must return the
Access-Control-Allow-Methods response headerwhich value is present in the
AllowMethods field.Access-Control-Request-Method request headeris not included in the list of methods specified by the response header
Access-Control-Allow-Methods, it will present an error on the clientside.
not credentialed, the
Access-Control-Allow-Methods response headercan either use the
* wildcard or the value ofAccess-Control-Request-Method from the request.
*wildcard in the
Access-Control-Allow-Methods response header. Whenalso the
AllowCredentials field is true and AllowMethods fieldspecified with the
* wildcard, the gateway must specify one HTTP methodin the value of the Access-Control-Allow-Methods response header. The
value of the header
Access-Control-Allow-Methods is same as theAccess-Control-Request-Method header provided by the client. If theheader
Access-Control-Request-Method is not included in the request,the gateway will omit the
Access-Control-Allow-Methods response header,instead of specifying the
* wildcard.Validation
Documentation References (1)
resource from the given
Origin.Origin consists of a scheme and a host, with an optional port, andtakes the form
<scheme>://<host>(:<port>).http and https.available TCP/UDP ports). Note that, if not included, port
80 isassumed for
http scheme origins, and port 443 is assumed for httpsorigins. This may affect origin matching.
*. Thesewildcard characters behave as follows:
* is a greedy match to the _left_, including any number ofDNS labels to the left of its position. This also means that
* will include any number of period . characters to theleft of its position.
* A wildcard by itself matches all hosts.
* character indicates requestsfrom all
Origins are allowed.AllowOrigins field is configured with multiple origins, itmeans the server supports clients from multiple origins. If the request
Origin matches the configured allowed origins, the gateway must returnthe given
Origin and sets value of the headerAccess-Control-Allow-Origin same as the Origin header provided by theclient.
always an OK status (i.e., 204 or 200).
Origin does not match the configured allowed origins,the gateway returns 204/200 response but doesn't set the relevant
cross-origin response headers. Alternatively, the gateway responds with
403 status to the "preflight" request is denied, coupled with omitting
the CORS headers. The cross-origin request fails on the client side.
Therefore, the client doesn't attempt the actual cross-origin request.
Origin matches one of the configuredallowed origins, the gateway sets the response header
Access-Control-Allow-Origin to the same value as the Originheader provided by the client.
is not credentialed (e.g., it is a preflight request), the
Access-Control-Allow-Origin response header either contains thewildcard as well or the Origin from the request.
*wildcard in the
Access-Control-Allow-Origin response header. Whenalso the
AllowCredentials field is true and AllowOrigins fieldspecified with the
* wildcard, the gateway must return a single originin the value of the
Access-Control-Allow-Origin response header,instead of specifying the
* wildcard. The value of the headerAccess-Control-Allow-Origin is same as the Origin header provided bythe client.
Validation
Documentation References (1)
to client-side scripts in response to a cross-origin request.
that it is considered safe to expose to the client scripts.
The CORS-safelisted response headers include the following headers:
Cache-ControlContent-LanguageContent-LengthContent-TypeExpiresLast-ModifiedPragma(See https://fetch.spec.whatwg.org/#cors-safelisted-response-header-name)
The CORS-safelisted response headers are exposed to client by default.
ExposeHeaders field,this additional header will be exposed as part of the response to the
client.
Access-Control-Expose-Headersresponse header are separated by a comma (",").
to clients. The
Access-Control-Expose-Headers response header can onlyuse
* wildcard as value when the request is not credentialed.exposeHeaders config field contains the "*" wildcard andthe request is credentialed, the gateway cannot use the
* wildcard inthe
Access-Control-Expose-Headers response header.Validation
results of a "preflight" request.
Access-Control-Allow-Methods andAccess-Control-Allow-Headers response headers can be cached by theclient until the time specified by
Access-Control-Max-Age elapses.Access-Control-Max-Age response header is 5(seconds).
MaxAge field is unspecified, the gateway sets the responseheader "Access-Control-Max-Age: 5" by default.
Validation
Documentation References (1)
* Safe methods (
GET, HEAD, OPTIONS) are automatically allowed.* Requests without
Sec-Fetch-Site or Origin headers are assumed tobe same-origin or non-browser requests and are allowed.
* Otherwise, the
Sec-Fetch-Site header is checked, with a fallback tocomparing the
Origin header to the Host header.Documentation References (1)
additionalOrigins specifies additional source origins that will beallowed in addition to the destination origin. The
Origin consists ofa scheme and a host, with an optional port, and takes the form
<scheme>://<host>(:<port>).Validation
Documentation References (1)
directResponse configures the policy to send a direct response to theclient.
Documentation References (1)
The maximum length of the body is restricted to prevent excessively large responses.
If this field is omitted, no body is included in the response.
Validation
Documentation References (1)
Validation
Documentation References (1)
This controls what external server to send requests to for authentication.
Validation
Documentation References (2)
backendRef references the External Authorization server to reach.Service and Backend.Validation
Documentation References (2)
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
Documentation References (2)
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Documentation References (2)
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (2)
unavailable or returns an error. "FailOpen" allows the request to continue.
"FailClosed" (default) denies the request.
Validation
forwardBody configures whether to include the HTTP body in the request.If enabled, the request body will be buffered.
maxSize specifies, in bytes, the largest body that will be bufferedand sent to the authorization server. If the body size is larger than
maxSize, then the request will be rejected with a response.Validation
[protocol](https://www.envoyproxy.io/docs/envoy/latest/api-v3/service/auth/v3/external_auth.proto) should be used.
Documentation References (1)
contextExtensions specifies additional arbitrary key-value pairs tosend to the authorization server in the
context_extensions field.Validation
requestMetadata specifies metadata to be sent to the authorizationserver. This maps to the
metadata_context.filter_metadata field of therequest, and allows dynamic CEL expressions. If unset, by default the
envoy.filters.http.jwt_authn key is set if the JWT policy is used aswell, for compatibility.
Validation
http specifies that the HTTP protocol should be used for connecting tothe authorization server. The authorization server must return a
200status code, otherwise the request is considered an authorization
failure.
Documentation References (1)
addRequestHeaders specifies what additional headers to add to therequest to the authorization server. While
allowedRequestHeaders justpasses the original headers through,
addRequestHeaders allows definingcustom headers based on CEL expressions.
Validation
allowedRequestHeaders specifies what additional headers from the client requestwill be sent to the authorization server.
Authorization.Validation
allowedResponseHeaders specifies what headers from the authorization responsewill be copied into the request to the backend.
Validation
Documentation References (1)
path specifies the path to send to the authorization server. Ifunset, this defaults to the original request path.
This is a CEL expression, which allows customizing the path based on the
incoming request. For example, to add a prefix, use
"/prefix/" + request.path.Validation
Documentation References (1)
redirect defines an optional expression to determine a path toredirect to on authorization failure. This is useful to redirect to a
sign-in page.
Validation
responseMetadata specifies what metadata fields should be constructedfrom the authorization response. These will be included under the
extauthz variable in future CEL expressions. Setting this is usefulfor things like logging usernames, without needing to include them as
headers to the backend, as
allowedResponseHeaders would.Validation
Documentation References (1)
backendRef references the External Processor server to reach.Supported types:
Service and Backend.Validation
Documentation References (1)
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Validation
Documentation References (1)
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Documentation References (1)
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (1)
Validation
before the action. It appends to any existing values associated
with the header name.
GET /foo HTTP/1.1
my-header: foo
add:
- name: "my-header"
value: "bar,baz"
GET /foo HTTP/1.1
my-header: foo,bar,baz
Validation
case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
an equivalent name MUST be considered for a match. Subsequent entries
with an equivalent header name MUST be ignored. Due to the
case-insensitivity of header names, "foo" and "Foo" are considered
equivalent.
Validation
<gateway:experimental:description>
Must consist of printable US-ASCII characters, optionally separated
by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
</gateway:experimental:description>
^[!-~]+([\t ]?[!-~]+)*$>Validation
value of Remove is a list of HTTP header names. Note that the header
names are case-insensitive (see
https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
GET /foo HTTP/1.1
my-header1: foo
my-header2: bar
my-header3: baz
remove: ["my-header1", "my-header3"]
GET /foo HTTP/1.1
my-header2: bar
Validation
before the action.
GET /foo HTTP/1.1
my-header: foo
set:
- name: "my-header"
value: "bar"
GET /foo HTTP/1.1
my-header: bar
Validation
case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
an equivalent name MUST be considered for a match. Subsequent entries
with an equivalent header name MUST be ignored. Due to the
case-insensitivity of header names, "foo" and "Foo" are considered
equivalent.
Validation
<gateway:experimental:description>
Must consist of printable US-ASCII characters, optionally separated
by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
</gateway:experimental:description>
^[!-~]+([\t ]?[!-~]+)*$>Validation
before the action. It appends to any existing values associated
with the header name.
GET /foo HTTP/1.1
my-header: foo
add:
- name: "my-header"
value: "bar,baz"
GET /foo HTTP/1.1
my-header: foo,bar,baz
Validation
case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
an equivalent name MUST be considered for a match. Subsequent entries
with an equivalent header name MUST be ignored. Due to the
case-insensitivity of header names, "foo" and "Foo" are considered
equivalent.
Validation
<gateway:experimental:description>
Must consist of printable US-ASCII characters, optionally separated
by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
</gateway:experimental:description>
^[!-~]+([\t ]?[!-~]+)*$>Validation
value of Remove is a list of HTTP header names. Note that the header
names are case-insensitive (see
https://datatracker.ietf.org/doc/html/rfc2616#section-4.2).
GET /foo HTTP/1.1
my-header1: foo
my-header2: bar
my-header3: baz
remove: ["my-header1", "my-header3"]
GET /foo HTTP/1.1
my-header2: bar
Validation
before the action.
GET /foo HTTP/1.1
my-header: foo
set:
- name: "my-header"
value: "bar"
GET /foo HTTP/1.1
my-header: bar
Validation
case-insensitive. (See https://tools.ietf.org/html/rfc7230#section-3.2).
an equivalent name MUST be considered for a match. Subsequent entries
with an equivalent header name MUST be ignored. Due to the
case-insensitivity of header names, "foo" and "Foo" are considered
equivalent.
Validation
<gateway:experimental:description>
Must consist of printable US-ASCII characters, optionally separated
by single tabs or spaces. See: https://tools.ietf.org/html/rfc7230#section-3.2
</gateway:experimental:description>
^[!-~]+([\t ]?[!-~]+)*$>Validation
hostRewrite specifies how to rewrite the Host header for requests.HTTPRoute urlRewrite filter already specifies a host rewrite,this setting is ignored.
mode sets the hostname rewrite mode.*
Auto: automatically set the Host header based on the destination.*
None: do not rewrite the Host header. The original Host headerwill be passed through.
Auto when connecting to hostname-basedBackend types, and None otherwise, for Service or IP-basedbackends.
Validation
jwtAuthentication authenticates users based on JWT tokens.Validation
Documentation References (5)
location controls where JWT credentials are read from.If omitted, credentials are read from the
Authorization header with the Bearer prefix.Validation
Validation
* "Set-Cookie"
headers are not currently supported by this type.
- "/invalid" - "/ " is an invalid character
Validation
Validation
Validation
mcp optionally enables MCP OAuth metadata endpoint handlingand MCP-specific authentication behavior on top of standard JWT validation.
When set, the gateway will serve the MCP OAuth metadata discovery endpoints.
Documentation References (2)
provider specifies the identity provider to use for MCP authentication flows.Validation
Documentation References (2)
resourceMetadata defines the metadata to use for MCP resources,served at the MCP OAuth metadata endpoints.
Documentation References (2)
mode is the validation mode for JWT authentication.Validation
Documentation References (5)
Validation
Documentation References (5)
audiences specifies the list of allowed audiences that are allowedaccess. This corresponds to the
aud claim([RFC 7519 §4.1.3](https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.3)).
If unset, any audience is allowed.
Validation
Documentation References (2)
issuer identifies the IdP that issued the JWT. This corresponds to theiss claim ([RFC 7519 §4.1.1](https://tools.ietf.org/html/rfc7519#section-4.1.1)).Validation
Documentation References (5)
jwks defines the JSON Web Key Set used to validate the signature of theJWT.
Validation
Documentation References (5)
inline specifies an inline JSON Web Key Set used to validate thesignature of the JWT.
Validation
Documentation References (2)
remote specifies how to reach the JSON Web Key Set from a remoteaddress.
Documentation References (3)
backendRef references the remote JWKS server to reach.Supported types are
Service and static Backend. AnAgentgatewayPolicy containing backend TLS config can then be attachedto the
Service or Backend in order to set TLS options for aconnection to the remote
jwks source.Validation
Documentation References (3)
When unspecified or empty string, core API group is inferred.
Validation
Documentation References (1)
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Documentation References (3)
Validation
Documentation References (3)
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Documentation References (3)
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (3)
Validation
Documentation References (1)
jwks endpoint, relative to the root, commonly".well-known/jwks.json".Validation
Documentation References (3)
PreRouting,the
targetRef must be a Gateway or a Listener. PreRouting istypically used only when a policy needs to influence the routing
decision.
PostRouting mode, the policy can target theGateway or Listener. This is a helper for applying the policy to allroutes under that
Gateway or Listener, and follows the merging logicdescribed above.
PreRouting and PostRouting rules do not merge together. Theseare independent execution phases. That is, all
PreRouting rules willmerge and execute, then all
PostRouting rules will merge and execute.PostRouting.Validation
Documentation References (3)
This controls the rate at which requests are allowed to be processed.
Validation
Documentation References (3)
backendRef references the rate limit server to reach.Supported types:
Service and Backend.Validation
Documentation References (3)
When unspecified or empty string, core API group is inferred.
Validation
"Service".
outside of the cluster and as such are difficult to reason about in
terms of conformance. They also may not be safe to forward to (see
CVE-2021-25740 for more information). Implementations SHOULD NOT
support ExternalName Services.
Validation
Documentation References (2)
Validation
Documentation References (3)
namespace is inferred.
a ReferenceGrant object is required in the referent namespace to allow that
namespace's owner to accept the reference. See the ReferenceGrant
documentation for details.
Validation
Documentation References (2)
Port is required when the referent is a Kubernetes Service. In this
case, the port number is the service port number, not the target port.
For other resources, destination port might be derived from the referent
resource or this field.
Validation
Documentation References (3)
descriptors define the dimensions for rate limiting. These values arepassed to the rate limit service which applies configured limits based
on them. Each descriptor represents a single rate limit rule with one or
more entries.
Validation
Documentation References (3)
entries are the individual components that make up this descriptor.Validation
Documentation References (3)
expression is a Common Expression Language (CEL) expression thatdefines the value for the descriptor.
source.address.Validation
Documentation References (3)
name specifies the name of the descriptor.Validation
Documentation References (3)
unit defines what to use as the cost function. If unspecified,Requests is used.Validation
Documentation References (2)
domain specifies the domain under which this limit should apply.This is an arbitrary string that enables a rate limit server to distinguish between different applications.
Validation
Documentation References (3)
failureMode controls behavior when the remote rate limit service isunavailable or returns an error.
FailOpen allows the request to continue.FailClosed (default) denies the request.Validation
Validation
burst specifies an allowance of requests above the request-per-unitthat should be allowed within a short period of time.
Validation
Documentation References (4)
requests specifies the number of HTTP requests per unit of time thatare allowed. Requests exceeding this limit will fail with a
429error.
Validation
Documentation References (5)
tokens specifies the number of LLM tokens per unit of time that areallowed. Requests exceeding this limit will fail with a
429 error.result, token-based rate limits will apply to future requests only.
Validation
Documentation References (2)
unit specifies the unit of time that requests are limited on.Validation
Documentation References (2)
from the gateway to a backend should be retried.
response from the backend, the Gateway MUST return an error.
a backend request is implementation-specific.
Documentation References (2)
retry attempts and is represented in Gateway API Duration formatting.
rules[].retry.backoff field to the value100ms will cause a backend request to first be retried approximately100 milliseconds after timing out or receiving a response code configured
to be retriable.
for subsequent retry attempts, MAY cap the maximum backoff duration to
some amount greater than the specified minimum, and MAY add arbitrary
jitter to stagger requests, as long as unsuccessful backend requests are
not retried before the configured minimum duration.
rules[].timeouts.request) is configured on theroute, the entire duration of the initial request and any retry attempts
MUST not exceed the Request timeout duration. If any retry attempts are
still in progress when the Request timeout duration has been reached,
these SHOULD be canceled if possible and the Gateway MUST immediately
return a timeout error.
rules[].timeouts.backendRequest) isconfigured on the route, any retry attempts which reach the configured
BackendRequest timeout duration without a response SHOULD be canceled if
possible and the Gateway should wait for at least the specified backoff
duration before attempting to retry the backend request again.
attempts MAY time out after an implementation default duration, or MAY
remain pending until a configured Request timeout or implementation
default duration for total request time is reached.
is implementation-specific.
Validation
Documentation References (2)
should be retried.
Validation
Documentation References (2)
timeouts defines the timeouts for requests.It is applicable to
HTTPRoute resources and ignored for other targetedkinds.
Documentation References (2)
the request first starts being sent from the gateway to when the full response has been received from the backend.
Validation
Documentation References (2)
before forwarding them to the destination.
Validation
Documentation References (18)
request is used to modify the request path.Validation
Documentation References (12)
add is a list of headers to add to the request and what that valueshould be set to. If there is already a header with these values then
append the value as an extra entry.
Validation
Validation
value is the CEL expression to apply to generate the output value forthe header.
Validation
body controls manipulation of the HTTP body.Validation
metadata stores CEL-evaluated values under the metadata CEL variablefor subsequent policy evaluations.
metadata is evaluated before headeror body transformations.
Validation
remove is a list of header names to remove from the request orresponse.
Validation
set is a list of headers and the value they should be set to.Validation
Documentation References (7)
Validation
Documentation References (7)
value is the CEL expression to apply to generate the output value forthe header.
Validation
Documentation References (7)
response is used to modify the response path.Validation
add is a list of headers to add to the request and what that valueshould be set to. If there is already a header with these values then
append the value as an extra entry.
Validation
Documentation References (1)
Validation
Documentation References (1)
value is the CEL expression to apply to generate the output value forthe header.
Validation
Documentation References (1)
body controls manipulation of the HTTP body.Validation
Documentation References (1)
metadata stores CEL-evaluated values under the metadata CEL variablefor subsequent policy evaluations.
metadata is evaluated before headeror body transformations.
Validation
remove is a list of header names to remove from the request orresponse.
Validation
Documentation References (1)
set is a list of headers and the value they should be set to.Validation
Validation
value is the CEL expression to apply to generate the output value forthe header.
Validation
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.
an important part of Policy design is designing the right object level at
which to namespace this status.
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.
MUST be treated as a map with a composite key, made up of the AncestorRef
and ControllerName fields combined.
means the Policy is not relevant for any ancestors.
Instead they MUST consider the policy unimplementable and signal that
on any related resources such as the ancestor that would be referenced
here. For example, if this list was full on BackendTLSPolicy, no
additional Gateways would be able to reference the Service targeted by
the BackendTLSPolicy.
Validation
PolicyAncestorStatus struct describes the status of.
When unspecified, "gateway.networking.k8s.io" is inferred.
To set the core API group (such as for a "Service" kind referent),
Group must be explicitly set to "" (empty string).
Validation
* Service (Mesh conformance profile, ClusterIP Services only)
Validation
Validation
to the local namespace of the Route.
boundaries. Cross-namespace references are only valid if they are explicitly
allowed by something in the namespace they are referring to. For example:
Gateway has the AllowedRoutes field, and ReferenceGrant provides a
generic way to enable any other kind of cross-namespace reference.
ParentRefs from a Route to a Service in the same namespace are "producer"
routes, which apply default routing rules to inbound connections from
any namespace to the Service.
"consumer" routes, and these routing rules are only applied to outbound
connections originating from the same namespace as the Route, for which
the intended destination of the connections are a Service targeted as a
ParentRef of the Route.
</gateway:experimental:description>
Validation
differently based on the type of parent resource.
listening on the specified port that also support this kind of Route(and
select this Route). It's not recommended to set
Port unless thenetworking behaviors specified in a Route must apply to a specific port
as opposed to a listener(s) whose port(s) may be changed. When both Port
and SectionName are specified, the name and port of the selected listener
must match both specified values.
When the parent resource is a Service, this targets a specific port in the
Service spec. When both Port (experimental) and SectionName are specified,
the name and port of the selected port must match both specified values.
</gateway:experimental:description>
Implementations supporting other types of parent resources MUST clearly
document how/if Port is interpreted.
long as the parent resource accepts it partially. For example, Gateway
listeners can restrict which Routes can attach to them by Route kind,
namespace, or hostname. If 1 of 2 Gateway listeners accept attachment
from the referencing Route, the Route MUST be considered successfully
attached. If no Gateway listeners accept attachment from this Route,
the Route MUST be considered detached from the Gateway.
Validation
following resources, SectionName is interpreted as the following:
are specified, the name and port of the selected listener must match
both specified values.
* Service: Port name. When both Port (experimental) and SectionName
are specified, the name and port of the selected listener must match
both specified values.
If that is the case, they MUST clearly document how SectionName is
interpreted.
For the purpose of status, an attachment is considered successful if at
least one section in the parent resource accepts it. For example, Gateway
listeners can restrict which Routes can attach to them by Route kind,
namespace, or hostname. If 1 of 2 Gateway listeners accept attachment from
the referencing Route, the Route MUST be considered successfully
attached. If no Gateway listeners accept attachment from this Route, the
Route MUST be considered detached from the Gateway.
Validation
map, which means that they function like amap with a key of the
type field _in the k8s apiserver_.section.
before modifying it. That is, when modifying this field, implementations
must be confident they have fetched the most recent version of this field,
and ensure that changes they make are on that recent version.
* Implementations MUST NOT remove or reorder Conditions that they are not
directly responsible for. For example, if an implementation sees a Condition
with type
special.io/SomeField, it MUST NOT remove, change or update thatCondition.
* Implementations MUST always _merge_ changes into Conditions of the same Type,
rather than creating more than one Condition of the same Type.
* Implementations MUST always update the
observedGeneration field of theCondition to the
metadata.generation of the Gateway at the time of update creation.* If the
observedGeneration of a Condition is _greater than_ the value theimplementation knows about, then it MUST NOT perform the update on that Condition,
but must wait for a future reconciliation and status update. (The assumption is that
the implementation's copy of the object is stale and an update will be re-triggered
if relevant.)
Validation
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
Validation
This may be an empty string.
Validation
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
Validation
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
Validation
Validation
Validation
controller that wrote this status. This corresponds with the
controllerName field on GatewayClass.
valid Kubernetes names
(https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names).
entries to status populated with their ControllerName are cleaned up when they are no
longer necessary.