Gateway API configuration reference
Look up the field definitions for each Application Load Balancer (ALB) Gateway API resource in Container Service for Kubernetes (ACK) clusters: GatewayClass, Gateway, HTTPRoute, AlbInstance, AlbRule, and AlbServerGroup.
GatewayClass fields
GatewayClass
|
Field |
Type |
Description |
|
apiVersion |
Fixed value |
The versioned schema of the object. Valid value: |
|
kind |
Fixed value |
The REST resource represented by the object. Valid value: |
|
metadata |
The metadata of the standard object. |
|
|
spec |
The desired state of the GatewayClass. |
|
|
status |
GatewayClassStatus |
The current status of the GatewayClass, which is written by the controller. Important
This field cannot be modified. |
GatewayClassSpec
|
Field |
Type |
Description |
|
controllerName |
string |
The name of the controller that manages the Gateway. Do not modify this field.
Important
This field cannot be modified. |
Gateway fields
Gateway
|
Field |
Type |
Description |
|
apiVersion |
Fixed value |
The versioned schema of the object. Valid value: |
|
kind |
Fixed value |
The REST resource represented by the object. Valid value: |
|
metadata |
The metadata of the standard object. |
|
|
spec |
The desired state of the Gateway. |
|
|
status |
GatewayStatus |
The current status of the Gateway, which is written by the controller. Important
This field cannot be modified. |
GatewaySpec
|
Field |
Type |
Description |
|
gatewayClassName |
string |
The name of the GatewayClass used by the Gateway.
|
|
infrastructure |
The infrastructure-level configuration of the Gateway. Use this field to reference an AlbInstance with |
|
|
listeners |
The list of Gateway Listener configurations. Each Listener in the same Gateway must have a unique combination of |
GatewayInfrastructure
|
Field |
Type |
Description |
|
parametersRef |
References a parameter resource in the namespace of the current Gateway. Only AlbInstance can be referenced. |
LocalParametersReference
|
Field |
Type |
Description |
|
group |
string |
The API group to which the referenced resource belongs. When an AlbInstance is referenced, this field must be set to |
|
kind |
string |
The type of the referenced resource. Only |
|
name |
string |
The name of the referenced AlbInstance. The AlbInstance must reside in the same namespace as the Gateway. |
AlbInstance
|
Field |
Type |
Description |
|
apiVersion |
Fixed value |
The versioned schema of the object. Valid value: |
|
kind |
Fixed value |
The REST resource represented by the object. Valid value: |
|
metadata |
The metadata of the standard object. An AlbInstance is a namespace-level resource and must reside in the same namespace as the Gateway that references it. |
|
|
spec |
The configurations of the ALB instance. |
AlbInstanceSpec
|
Field |
Type |
Description |
|
config |
The configurations of the ALB instance. |
|
|
listeners |
The listener configurations. Each entry is matched with a listener in spec.listeners of the Gateway by protocol and port. Entries that do not match a Gateway Listener are ignored. Duplicate entries that use the same protocol and port are not allowed in the same AlbInstance. |
AlbInstanceSpecConfig
|
Field |
Type |
Description |
|
name |
string |
The name of the ALB instance. Default value: a name that is automatically generated in the
|
|
addressType |
enum |
The type of the IPv4 address of the ALB instance.
Default value: Important
This field takes effect only when you create an ALB instance. You cannot use it to change the network type of an existing ALB instance. |
|
ipv6AddressType |
enum |
The type of the IPv6 address of the ALB instance. This field takes effect only when
Default value: Important
This field takes effect only when you create an ALB instance. You cannot use it to change the network type of an existing ALB instance. |
|
addressIpVersion |
enum |
The IP version.
Default value: |
|
resourceGroupId |
string |
The ID of the resource group. |
|
zoneMappings |
The zone and elastic IP address (EIP) configurations. Important
This field takes effect only when you create an ALB instance. You cannot use it to change the zones or the EIPs of an existing ALB instance. |
|
|
accessLogConfig |
The access log configurations. |
|
|
billingConfig |
The billing configurations. Important
You can use this field only to associate or change an EIP bandwidth plan. You cannot use it to disassociate an EIP bandwidth plan. |
|
|
tags |
The tags of the instance. |
ZoneMapping
|
Field |
Type |
Description |
|
vSwitchId |
string |
The ID of the vSwitch. Default value: the first vSwitch in each zone that ALB supports in the VPC of the current cluster. This default applies only if you leave zoneMappings empty. Important
This field takes effect only when you create an ALB instance. You cannot use it to change the zones or the EIPs of an existing ALB instance. |
|
zoneId |
string |
The zone of the vSwitch. This field is optional. The controller automatically queries the zone ID of the vSwitch. |
|
allocationId |
string |
The ID of the EIP. Important
This field takes effect only when you create an ALB instance. You cannot use it to change the zones or the EIPs of an existing ALB instance. |
|
eipType |
string |
The type of the EIP. This field is optional. The controller automatically queries the type of the EIP. |
AccessLogConfig
|
Field |
Type |
Description |
|
logProject |
string |
The name of the Simple Log Service (SLS) project. |
|
logStore |
string |
The name of the Logstore. The name must start with |
BillingConfig
|
Field |
Type |
Description |
|
bandWidthPackageId |
string |
The ID of the bound EIP bandwidth plan. Important
You can use this field only to associate or change an EIP bandwidth plan. You cannot use it to disassociate an EIP bandwidth plan. |
Tag
|
Field |
Type |
Description |
|
key |
string |
The tag key. |
|
value |
string |
The tag value. |
AlbInstanceListener
|
Field |
Type |
Description |
|
protocol |
enum |
This field is required. The protocol of the Listener, which must match the protocol of the Gateway Listener. This field is case-insensitive. Valid values: |
|
port |
int |
This field is required. The port of the Listener, which must match the port of the Gateway Listener. |
|
description |
string |
The description of the Listener. The description must be 2 to 256 characters in length and can contain Chinese characters, letters, digits, underscores (_), and Default value: |
|
idleTimeout |
int |
The idle connection timeout period. Unit: seconds. Valid values: [1, 600]. Default value: 15. To set a value greater than 600 seconds, submit a ticket to apply for a quota increase. |
|
requestTimeout |
int |
The request timeout period. Unit: seconds. Valid values: [1, 600]. If ALB does not receive a response from the backend server within this period, ALB returns the HTTP 504 status code. Default value: 60. To set a value greater than 600 seconds, submit a ticket to apply for a quota increase. |
|
gzipEnabled |
boolean |
Specifies whether to enable Gzip compression. Default value: true. |
|
securityPolicyId |
string |
The ID of the TLS security policy. This field takes effect only on HTTPS listeners. Both system security policies and custom security policies are supported. Default value: Important
ALB Extended Edition instances support only |
|
caEnabled |
boolean |
Specifies whether to enable HTTPS mutual authentication. This field takes effect only on HTTPS listeners. Default value: false. Important
Only ALB Standard Edition instances support this field. ALB Extended Edition instances do not support mutual authentication. |
|
caCertificates |
The CA certificates used for mutual authentication. This field takes effect only on HTTPS listeners. Specify the certificates as a complete list. If you add, remove, or change a certificate ID in the list, the change is synchronized to the ALB listener. |
|
|
certificates |
The certificates in Certificate Management Service, used as additional certificates of the HTTPS listener. If the Gateway does not reference a Secret certificate in tls.certificateRefs, the first certificate is used as the default certificate. |
|
|
xForwardedForConfig |
The X-Forwarded-For header configurations. |
|
|
logConfig |
The configurations for recording custom headers in access logs and for tracing. Important
Only ALB Standard Edition instances support this field. ALB Extended Edition instances do not support this field. |
|
|
tags |
The tags of the Listener. Specify the tags as a complete list. Custom tags that are not in the list, including tags that are manually added in the ALB console, are removed from the Listener. |
AlbInstanceCertificate
|
Field |
Type |
Description |
|
certificateId |
string |
This field is required. The ID of the certificate in Certificate Management Service. The value cannot be empty. |
AlbInstanceXForwardedForConfig
|
Field |
Type |
Description |
|
xForwardedForProcessingMode |
enum |
The mode used by ALB to process the X-Forwarded-For header. This field takes precedence over xForwardedForEnabled.
Default value: |
|
xForwardedForEnabled |
boolean |
Specifies whether to enable the X-Forwarded-For header. Use xForwardedForProcessingMode instead. |
|
xForwardedForProtoEnabled |
boolean |
Specifies whether to use the X-Forwarded-Proto header to obtain the listener protocol of ALB. Default value: false. |
|
xForwardedForHostEnabled |
boolean |
Specifies whether to use the X-Forwarded-Host header to obtain the domain name accessed by the client. Default value: false. |
|
xForwardedForSLBIdEnabled |
boolean |
Specifies whether to use the SLB-ID header to obtain the ID of the ALB instance. Default value: false. |
|
xForwardedForSLBPortEnabled |
boolean |
Specifies whether to use the X-Forwarded-Port header to obtain the listener port of ALB. Default value: false. |
|
xForwardedForClientSrcPortEnabled |
boolean |
Specifies whether to use the X-Forwarded-Client-srcport header to obtain the port of the client. Default value: false. |
|
xForwardedForClientSourceIpsEnabled |
boolean |
Specifies whether to allow ALB to obtain the real client IP address from the X-Forwarded-For header. If you enable this feature, you must also configure xForwardedForClientSourceIpsTrusted. Default value: false. |
|
xForwardedForClientSourceIpsTrusted |
string |
The trusted proxy IP addresses or CIDR blocks. IPv4 addresses, IPv6 addresses, and CIDR blocks are supported. Separate multiple values with semicolons (;) and do not add spaces. This field takes effect only when xForwardedForClientSourceIpsEnabled is true.
Example: |
|
xForwardedForClientCertSubjectDNEnabled |
boolean |
Specifies whether to use the X-Forwarded-Clientcert-subjectdn header to obtain the subject information of the client certificate. This field takes effect only on HTTPS listeners that use mutual authentication. Default value: false. |
|
xForwardedForClientCertSubjectDNAlias |
string |
The name of the custom header that carries the subject information of the client certificate. This field takes effect only when xForwardedForClientCertSubjectDNEnabled is true. |
|
xForwardedForClientCertIssuerDNEnabled |
boolean |
Specifies whether to use the X-Forwarded-Clientcert-issuerdn header to obtain the issuer information of the client certificate. This field takes effect only on HTTPS listeners that use mutual authentication. Default value: false. |
|
xForwardedForClientCertIssuerDNAlias |
string |
The name of the custom header that carries the issuer information of the client certificate. This field takes effect only when xForwardedForClientCertIssuerDNEnabled is true. |
|
xForwardedForClientCertFingerprintEnabled |
boolean |
Specifies whether to use the X-Forwarded-Clientcert-fingerprint header to obtain the fingerprint of the client certificate. This field takes effect only on HTTPS listeners that use mutual authentication. Default value: false. |
|
xForwardedForClientCertFingerprintAlias |
string |
The name of the custom header that carries the fingerprint of the client certificate. This field takes effect only when xForwardedForClientCertFingerprintEnabled is true. |
|
xForwardedForClientCertClientVerifyEnabled |
boolean |
Specifies whether to use the X-Forwarded-Clientcert-clientverify header to obtain the verification result of the client certificate. This field takes effect only on HTTPS listeners that use mutual authentication. Default value: false. |
|
xForwardedForClientCertClientVerifyAlias |
string |
The name of the custom header that carries the verification result of the client certificate. This field takes effect only when xForwardedForClientCertClientVerifyEnabled is true. |
The four custom header names (*Alias) in this table must be 1 to 40 characters in length. They can contain only lowercase letters, digits, hyphens (-), and underscores (_). They cannot conflict with the following reserved headers: slb-id, slb-ip, x-forwarded-for, x-forwarded-proto, x-forwarded-eip, x-forwarded-port, x-forwarded-client-srcport, x-forwarded-host, connection, upgrade, content-length, transfer-encoding, keep-alive, te, expect, host, cookie, and remoteip.
LogConfig
|
Field |
Type |
Description |
|
accessLogRecordCustomizedHeadersEnabled |
boolean |
Specifies whether to record custom headers in the access logs of the ALB instance. Default value: false. |
|
accessLogTracingConfig |
The Tracing Analysis (Xtrace) configuration. |
AccessLogTracingConfig
|
Field |
Type |
Description |
|
tracingEnabled |
boolean |
Specifies whether to enable Xtrace. Default value: false. |
|
tracingType |
enum |
The sampling algorithm for tracing. This field is required when tracingEnabled is true. Valid values: |
|
tracingSample |
int |
The sampling rate of tracing. Unit: 0.01%. Valid values: [1, 10000]. This field is required when tracingEnabled is true. |
Listener
|
Field |
Type |
Description |
|
name |
string |
The name of the Listener. The name must be unique within the same Gateway. |
|
hostname |
string |
The hostname to match. If you leave this field empty, all hostnames are matched. |
|
port |
int |
The port of the Listener. |
|
protocol |
enum |
The protocol of the Listener.
|
|
tls |
The TLS configuration of the Listener. When |
|
|
allowedRoutes |
The kinds of Routes that can be attached to this Listener and the namespaces that these Routes can come from. Default value: |
GatewayTLSConfig
|
Field |
Type |
Description |
|
mode |
enum |
The TLS processing mode. Only |
|
certificateRefs |
One or more references to Kubernetes Secrets. When multiple certificates exist, the first certificate is selected as the default certificate when the Listener is created. The default certificate is not changed during subsequent Listener updates unless necessary. Important
If |
SecretObjectReference
|
Field |
Type |
Description |
|
group |
string |
The API group to which the referenced object belongs. When a Secret is referenced, this field is usually omitted or set to an empty string. |
|
kind |
string |
The type of the referenced object. Certificate references support only |
|
name |
string |
The name of the referenced Secret. |
|
namespace |
string |
The namespace in which the referenced Secret resides. If this field is not specified, the namespace of the Gateway resource is used by default. For a cross-namespace reference, a ReferenceGrant that allows the reference is required in the destination namespace. |
AllowedRoutes
|
Field |
Type |
Description |
|
namespaces |
Specifies the namespaces from which Routes can be attached to this Listener. By default, only Routes in the namespace of the current Gateway are allowed. |
|
|
kinds |
Specifies the Group/Kind of Routes that can be attached to this Listener. If you leave this field empty, the allowed Route kinds are determined by the |
RouteNamespaces
|
Field |
Type |
Description |
|
from |
enum |
The scope of namespaces from which Routes can be selected.
Default value: |
|
selector |
LabelSelector |
When |
RouteGroupKind
|
Field |
Type |
Description |
|
group |
string |
The API group to which the Route belongs. Default value: |
|
kind |
string |
The type of the Route resource. Only |
HTTPRoute fields
HTTPRoute
|
Field |
Type |
Description |
|
apiVersion |
Fixed value |
The versioned schema of the object. Valid value: |
|
kind |
Fixed value |
The REST resource represented by the object. Valid value: |
|
metadata |
The metadata of the standard object. |
|
|
spec |
The desired state of the HTTPRoute. |
|
|
status |
HTTPRouteStatus |
The current status of the HTTPRoute, which is written by the controller. Important
This field cannot be modified. |
HTTPRouteSpec
|
Field |
Type |
Description |
|
parentRefs |
An array of parent resources, usually Gateways, that this Route is attached to. Important
The AllowedRoutes field of the Gateway must allow the kind and namespace of this Route. |
|
|
hostnames |
string[] |
The hostnames used to select the specific HTTPRoute that processes a request based on the Host header of the HTTP request. |
|
rules |
An array of rules, each defining a set of HTTP match conditions, filters, and forwarding actions. Each rule matches HTTP requests based on conditions (matches), processes the requests (filters), and forwards them to an API object (backendRefs). By default, a PathPrefix / match rule is included. alb-extensible does not support this default prefix match, so an Extended Edition Route must explicitly specify Exact or RegularExpression. |
ParentReference
|
Field |
Type |
Description |
|
group |
string |
The API group to which the referenced object belongs. Default value: |
|
kind |
string |
The resource type of the referenced object. Parent references support only |
|
namespace |
string |
The namespace in which the referenced object resides. Default value: the namespace in which the current Route resource resides. When a ParentReference points to a Gateway in another namespace, the corresponding Listener of the target Gateway must use By default, only Routes in the same namespace as the Gateway are allowed. Configure |
|
name |
string |
The name of the referenced object. |
|
sectionName |
string |
The name of a section within the target resource. For a Gateway, this is the Listener name. |
HTTPRouteRule
|
Field |
Type |
Description |
|
name |
string |
The name of the route rule. If this field is set, its value must be unique within the same HTTPRoute. |
|
matches |
The conditions used to match this rule against inbound HTTP requests. Default value: [{"path":{"type":"PathPrefix","value":"/"}}] Multiple match blocks are evaluated with a logical OR, and the conditions within the same match block are evaluated with a logical AND. |
|
|
filters |
The filters applied to requests that match this rule. |
|
|
backendRefs |
The backends to which requests are forwarded when the rule is matched. |
HTTPRouteMatch
|
Field |
Type |
Description |
Sub-fields |
|
path |
HTTPPathMatch |
The HTTP request path match rule.
Default value for ALB Standard Edition instances: |
|
|
headers |
HTTPHeaderMatch[] |
The HTTP header match rule. Multiple header conditions are evaluated with a logical AND. Only |
|
|
queryParams |
HTTPQueryParamMatch[] |
The HTTP query parameter match rule. Multiple query parameter conditions are evaluated with a logical AND. Only |
|
|
method |
enum |
The HTTP request method match rule. ALB Extended Edition instances do not support this configuration. Valid values:
|
None |
HTTPRouteFilter
|
Field |
Type |
Description |
Sub-fields |
|
type |
enum |
The type of the filter. Valid values: |
None |
|
requestHeaderModifier |
HTTPHeaderFilter |
The request header modification configurations. This field takes effect only when |
|
|
requestRedirect |
HTTPRequestRedirectFilter |
Returns an HTTP redirect response. This field takes effect only when |
|
|
urlRewrite |
HTTPURLRewriteFilter |
The rewrite configurations applied before a request is forwarded. This field takes effect only when |
|
|
extensionRef |
LocalObjectReference |
The custom extension reference. Only an AlbRule in the same namespace can be referenced: |
|
HTTPBackendRef
|
Field |
Type |
Description |
|
group |
string |
The API group to which the referenced backend resource belongs. If this field is not specified or is an empty string, the Kubernetes core API group is used by default. |
|
kind |
string |
The type of the referenced backend resource. Only |
|
name |
string |
The name of the referenced backend resource. |
|
namespace |
string |
The namespace in which the backend resource resides. If this field is not specified, the namespace of the current Route is used by default. A cross-namespace reference requires a ReferenceGrant that allows the reference in the destination namespace. |
|
port |
int |
The destination port used to access the backend Service. This field is required when a Service is referenced. |
|
weight |
int |
The forwarding weight of the backend. Default value: |
AlbRule fields
AlbRule
|
Field |
Type |
Description |
|
apiVersion |
Fixed value |
The versioned schema of the object. Valid value: |
|
kind |
Fixed value |
The REST resource represented by the object. Valid value: |
|
metadata |
ObjectMeta |
The metadata of the standard object. An AlbRule is a namespace-level resource and must reside in the same namespace as the HTTPRoute that references it. |
|
spec |
The extended configurations of ALB forwarding rules. |
AlbRuleSpec
|
Field |
Type |
Description |
|
serviceExtensions |
The service extension IDs associated with this AlbRule. ALB allows each forwarding rule to be associated with at most one service extension. This field is supported only by ALB Extended Edition instances. |
AlbServiceExtensionId
|
Field |
Type |
Description |
|
serviceExtensionId |
string |
The service extension ID, which is used to reference a specific service extension. If the list is empty, or if the |
AlbServerGroup fields
AlbServerGroup
|
Field |
Type |
Description |
|
apiVersion |
Fixed value |
The versioned schema of the object. Valid value: |
|
kind |
Fixed value |
The REST resource represented by the object. Valid value: |
|
metadata |
ObjectMeta |
The metadata of the standard object. |
|
spec |
The properties of the server group. |
AlbServerGroupSpec
|
Field |
Type |
Description |
|
targetRefs |
Declares the Services to which the AlbServerGroup applies. The target Service must reside in the same namespace as the AlbServerGroup, and each Service can be associated with only one AlbServerGroup. |
|
|
default |
The default server group properties applied to all matched Services. |
AlbServerGroupTargetRef
|
Field |
Type |
Description |
|
group |
string |
The API group to which the target resource belongs. Leave this field empty or set it to an empty string, which indicates the Kubernetes core API group. |
|
kind |
string |
The type of the target resource. Only |
|
name |
string |
The name of the target Service. |
AlbServerGroupDefaultConfig
|
Field |
Type |
Description |
|
healthCheckConfig |
The health check configurations. |
|
|
serviceExtensions |
The list of associated service extension IDs. ALB allows each server group to be associated with at most one service extension. A configuration that associates more than one is rejected by ALB. This field is supported only by ALB Extended Edition instances. |
AlbHealthCheckConfig
|
Field |
Type |
Description |
|
healthCheckEnabled |
boolean |
Specifies whether to enable health checks. Default value: |
|
healthCheckProtocol |
enum |
The health check protocol.
Default value: |
|
healthCheckMethod |
enum |
The HTTP method used for health checks.
Default value: |
|
healthCheckPath |
string |
The URL path used for health checks. Default value: |
|
healthCheckHost |
string |
The domain name used for health checks. Default value: |
|
healthCheckHttpVersion |
enum |
The HTTP version used for health checks.
Default value: |
|
healthCheckInterval |
int |
The health check interval. Unit: seconds. Valid values: [1, 50]. Default value: |
|
healthCheckTimeout |
int |
The health check timeout period. Unit: seconds. Valid values: [1, 300]. Default value: |
|
healthCheckConnectPort |
int |
The port number used for health checks. Valid values: [0, 65535]. Default value: |
|
healthyThreshold |
int |
The number of consecutive successful health checks required before a backend server is declared healthy. Valid values: [2, 10]. Default value: |
|
unhealthyThreshold |
int |
The number of consecutive failed health checks required before a backend server is declared unhealthy. Valid values: [2, 10]. Default value: |
|
healthCheckCodes |
string[] |
The HTTP status codes used to determine health check results.
Default value: |