An AlbConfig defines the settings for an Application Load Balancer (ALB) instance. This document outlines the annotations supported by ALB Ingresses and provides an overview of AlbConfig fields and their applications.
Index
Annotation Fields
Feature classification | Ingress annotation configuration |
Annotation YAML | |
ALB Ingress configuration | |
Listener/protocol configuration | |
Forwarding rule configuration | |
Advanced configuration | |
Others |
AlbConfig Fields
Field classification | Field link |
AlbConfig YAML | |
AlbConfig | |
ALB instance | |
Listener configuration | |
Virtual switch | |
Simple Log Service | |
QUIC listener | |
Configure a certificate | |
Resource Access Management | |
Tracing analysis | |
X-Forwarded configuration | |
Log using custom headers | |
Reserved parameter |
Annotation YAML example
Below is an example of how to use annotations to configure ALB within Ingress. For comprehensive annotation details, refer to the sections that follow.
Annotations supported by Ingress
Add annotations to Ingress resources to tailor ALB Ingress functionality to your needs.
Health check
Annotation | Description |
alb.ingress.kubernetes.io/healthcheck-enabled | Specifies whether to enable health checks for backend server groups. For a configuration example of health checks, see Configure health checks.
Default value: |
alb.ingress.kubernetes.io/healthcheck-path | The path to which health check requests are sent. Default value: |
alb.ingress.kubernetes.io/healthcheck-protocol | The protocol for health checks.
Default value: |
alb.ingress.kubernetes.io/healthcheck-httpversion | The HTTP protocol version. This parameter takes effect only when
Default value: |
alb.ingress.kubernetes.io/healthcheck-method | The health check method.
Default value: Important If |
alb.ingress.kubernetes.io/healthcheck-httpcode | The status codes used for health checks. A backend server is considered healthy only if the probe request succeeds and the specified status code is returned. You can enter any combination of the following options. Separate multiple status codes with commas (,):
Default value: |
alb.ingress.kubernetes.io/healthcheck-code | The status codes used for health checks. A backend server is considered healthy only if the probe request succeeds and the specified status code is returned. If Optional parameters depend on the value specified for
|
alb.ingress.kubernetes.io/healthcheck-timeout-seconds | The timeout period of health checks in seconds. Valid values: 1 to 300. Default value: |
alb.ingress.kubernetes.io/healthcheck-interval-seconds | The health check interval in seconds. Valid values: 1 to 50. Default value: |
alb.ingress.kubernetes.io/healthy-threshold-count | The number of times that a server needs to consecutively pass health checks before it is considered healthy. Valid values: 2 to 10. Default value: |
alb.ingress.kubernetes.io/unhealthy-threshold-count | The number of times that a server needs to consecutively fail health checks before it is considered unhealthy. Valid values: 2 to 10. Default value: |
alb.ingress.kubernetes.io/healthcheck-connect-port | The port that you want to use for health checks. Default value: Note A value of |
Redirection
Annotation | Description |
alb.ingress.kubernetes.io/ssl-redirect | Specifies whether to return a 308 status code for HTTP requests and redirect the requests to HTTPS listeners (port 443). For a configuration example of redirection, see Configure HTTP redirection to HTTPS.
Default value: |
Protocol used by backend services
Annotation | Description |
alb.ingress.kubernetes.io/backend-protocol | The protocol used by backend server groups. For a configuration example, see Support backend HTTPS and gRPC protocols.
Default value: Note The backend server protocols supported by listeners depend on the listener type:
|
Rewrite
Annotation | Description |
alb.ingress.kubernetes.io/rewrite-target | The path that overwrites the path in requests. For a configuration example of rewrite, see Rewrite. |
Listener
Annotation | Description |
alb.ingress.kubernetes.io/listen-ports | The listener ports and protocols associated with ALB Ingresses. For a configuration example, see Configure custom listener ports. You can specify the listener protocols and ports that you want to configure for ingress rules (examples are provided below):
|
Slow start
Annotation | Description |
alb.ingress.kubernetes.io/slow-start-enabled | Specifies whether to enable the slow start feature. After slow start is enabled, ALB Ingress gradually distributes traffic to new pods when they are added to the backend of a Service. This prevents exceptions caused by high CPU and memory pressure immediately after the pods are started. For a configuration example of slow start, see Backend slow start.
Disabled by default. |
alb.ingress.kubernetes.io/slow-start-duration | The time taken to gradually increase traffic during slow start. The longer the time, the slower the traffic increases. Unit: seconds. Valid values: 30 to 900. Default value: |
Priority
Annotation | Description |
alb.ingress.kubernetes.io/order | The relative priority of forwarding rules. The smaller the value, the higher the priority. For a configuration example of priority, see Configure forwarding rule priority. Valid values: 1 to 1000. Default value: |
Grayscale
Annotation | Description |
alb.ingress.kubernetes.io/canary | Specifies whether to enable canary release. For detailed operations on canary release, see Implement canary release through ALB Ingress.
Default value: |
alb.ingress.kubernetes.io/canary-by-header | The request header that is hit when canary release is enabled. |
alb.ingress.kubernetes.io/canary-by-header-value | The value of the request header that is hit when canary release is enabled. |
alb.ingress.kubernetes.io/canary-by-cookie | The cookie of the requests that are routed to the canary. |
alb.ingress.kubernetes.io/canary-weight | Set the percentage of requests to the specified service (a value from 0 to 100). For detailed operations, see Grayscale weight. |
Session persistence
Annotation | Description |
alb.ingress.kubernetes.io/sticky-session | Specifies whether to enable session persistence for backend server groups. For a configuration example of session persistence, see Implement session persistence through annotations.
Default value: |
alb.ingress.kubernetes.io/sticky-session-type | The method that is used to handle a cookie.
Default value: |
alb.ingress.kubernetes.io/cookie-timeout | The session persistence timeout period in seconds. Valid values: 1 to 86400. Default value: |
Connection draining
Annotation | Description |
alb.ingress.kubernetes.io/connection-drain-enabled | Specifies whether to enable connection draining. After connection draining is enabled, ALB Ingress maintains normal transmission for a period of time when the backend pod enters the Terminating state or health checks report exceptions. After the timeout period is reached, the connection is interrupted. This prevents the sudden removal of the backend from affecting the business. For detailed information about how connection draining works, see Connection draining.
Disabled by default. |
alb.ingress.kubernetes.io/connection-drain-timeout | The timeout period of connection draining in seconds. Valid values: 0 to 900. Default value: |
Load balancing
Annotation | Description |
alb.ingress.kubernetes.io/backend-scheduler | The load balancing algorithm of backend server groups. For a configuration example of load balancing algorithms, see Specify the load balancing algorithm for server groups.
Default value: |
alb.ingress.kubernetes.io/backend-scheduler-uch-value | The URL hash parameter used when the load balancing algorithm is set to "uch". |
Cross-domain
Annotation | Description |
alb.ingress.kubernetes.io/enable-cors | Specifies whether to enable cross-domain configuration. For a configuration example, see Cross-domain configuration.
Default value: |
alb.ingress.kubernetes.io/cors-allow-origin | The origins from which you want to allow cross-domain requests. Default value: |
alb.ingress.kubernetes.io/cors-expose-headers | The headers that can be exposed. |
alb.ingress.kubernetes.io/cors-allow-methods | The cross-domain request methods that are allowed. You can enter any combination of the following options:
Default value: |
alb.ingress.kubernetes.io/cors-allow-credentials | Specifies whether to allow credentials in requests.
Default value: |
alb.ingress.kubernetes.io/cors-max-age | The maximum cache time of preflight requests in browsers. Unit: seconds. Valid values: -1 to 172800. Default value: Note A value of |
alb.ingress.kubernetes.io/cors-allow-headers | The headers that are allowed in cross-domain requests. Default value: |
Custom forwarding
Annotation | Description |
alb.ingress.kubernetes.io/actions.{svcName} | The custom forwarding actions. For detailed operations on custom forwarding, see Custom forwarding rules for ALB Ingress. |
alb.ingress.kubernetes.io/conditions.{svcName} | The custom forwarding conditions. |
alb.ingress.kubernetes.io/rule-direction.{svcName} | The custom forwarding direction.
Default value: |
Others
Annotation | Description |
alb.ingress.kubernetes.io/backend-keepalive | Specifies whether to enable persistent TCP connections for backend servers. For a configuration example, see Persistent connections for backend servers. Default value: |
alb.ingress.kubernetes.io/traffic-limit-qps | QPS throttling. Valid values: 1 to 100000. |
alb.ingress.kubernetes.io/use-regex | Specifies whether regular expressions can be used in the Path field. This annotation is valid only when the path type is Prefix. Default value: |
AlbConfig fields
AlbConfig is a custom resource that details the attributes of ALB instances and their listeners. The following full AlbConfig example illustrates the various fields. For field-specific descriptions, refer to the sections below.
Albconfig
Field | Value type | Description |
apiVersion | Fixed value | The API version of the object. Fixed value: |
kind | Fixed value | Kind indicates the REST resource corresponding to the object. Fixed value: |
metadata | The metadata of the object. For more information about metadata, see metadata. | |
spec | A list of parameters used to describe the attributes of the ALB instance and its listeners. | |
status | After reconciliation is successful, the instance status is written to |
AlbConfigSpec
Field | Value type | Description |
config | The attributes of the ALB instance. | |
listeners | The attributes of the listeners of the ALB instance. |
LoadBalancerSpec
Field | Value type | Description |
id | string | The ID of the ALB instance. The ALB instance can be reused if an instance ID is specified. If you leave this field empty, the ALB Ingress controller creates an ALB instance. For detailed operations on creating a new ALB instance or reusing an existing instance, see Create AlbConfig. Default value: |
name | string | The name of the ALB instance. Default value: Automatically generated by using the following rule: |
addressAllocatedMode | enum | The IP address mode of the ALB instance.
Default value: |
addressType | enum | The network type of the IPv4 CIDR block of the ALB instance.
Default value: |
ipv6AddressType | enum | The network type of the IPv6 CIDR block of the ALB instance. The network type can be different from that of the IPv4 CIDR block of the ALB instance.
Default value: |
addressIpVersion | enum | Specifies whether the ALB instance supports dual stack.
Default value: |
resourceGroupId | string | The ID of the resource group to which the instances belong. Default value: |
edition | enum | The edition of the ALB instance. The edition of an ALB instance cannot be changed in reuse mode.
Default value: |
deletionProtectionEnabled | bool | A reserved parameter. Do not modify this field. |
forceOverride | bool | Specifies whether to forcefully overwrite the attributes of the ALB instance in reuse mode.
Default value: |
listenerForceOverride | bool | Specifies whether to forcefully overwrite the attributes of the listeners in reuse mode.
Default value: |
zoneMappings | The zone and EIP configuration. | |
accessLogConfig | The log collection configuration. | |
billingConfig | The billing method. | |
modificationProtectionConfig | The configuration protection setting. | |
tags | The tags of the instance. |
ZoneMapping
Field | Value type | Description |
vSwitchId | string | The vSwitch ID. This field is required. Default value: |
zoneId | string | The zone of the virtual switch. Retain the default value. Default value: |
allocationId | string | The ID of the EIP. Default value: |
eipType | string | A reserved parameter. Do not modify this field. |
AccessLogConfig
Field | Value type | Description |
logProject | string | The name of the Simple Log Service project. Default value: |
logStore | string | The name of the Simple Log Service Logstore. The name must start with Default value: |
BillingConfig
Field | Value type | Description |
internetBandwidth | int | A reserved parameter. Do not modify this field. |
internetChargeType | string | A reserved parameter. Do not modify this field. |
payType | enum | A reserved parameter. Do not modify this field. |
bandWidthPackageId | string[] | The ID of the associated Internet Shared Bandwidth instance. You cannot disassociate the Internet Shared Bandwidth instance. Default value: |
ModificationProtectionConfig
Field | Value type | Description |
reason | string | A reserved parameter. |
status | string | A reserved parameter. |
Tag
Field | Value type | Description |
key | string | The key of the tag. Default value: |
value | string | The value of the tag. Default value: |
ListenerSpec
Field | Value type | Description |
gzipEnabled | bool | Specifies whether to enable data compression. For a configuration example of data compression, see Use data compression.
Default value: |
http2Enabled | bool | Specifies whether to enable HTTP/2.
Default value: |
port | int | The listening port. This field is required. Default value: |
protocol | enum | The listening protocol. This field is required.
|
securityPolicyId | string | The ID of the TLS security policy. Default value: |
idleTimeout | int | The timeout period of idle connections in seconds. Default value: Note A value of 0 indicates that the default value is used. |
loadBalancerId | string | A reserved parameter. Do not modify this field. |
description | string | The name of the listener. Default value: Automatically generated by using the following rule: |
caEnabled | bool | Specifies whether to enable mutual authentication.
Default value: |
requestTimeout | int | The timeout period of requests in seconds. Default value: |
quicConfig | The QUICK listener configuration. | |
defaultActions | Action[] | A reserved parameter. Do not modify this field. |
caCertificates | The root CA certificate of the listener. | |
certificates | The server certificate of the listener. | |
xForwardedForConfig | The configuration of the XForward field. | |
logConfig | The listener log configuration. | |
aclConfig | Resource Access Management. |
QuicConfig
Field | Value type | Description |
quicUpgradeEnabled | bool | Specifies whether to enable QUIC upgrade. In scenarios where both QUIC and HTTPS listeners are used, set the quicUpgradeEnabled field to associate QUIC listeners with HTTPS listeners or disassociate QUIC listeners from HTTPS listeners. For detailed operations, see Use QUIC listeners to support HTTP/3.
Default value: |
quicListenerId | string | HTTPS listeners associated with the QUIC listeners. Default value: |
Certificate
Field | Value type | Description |
IsDefault | bool | Specifies whether the certificate is a default certificate. For detailed operations on configuring a certificate, see Configure HTTPS certificates for encrypted communication.
Default value: Important You can specify only one default certificate. |
CertificateId | string | The ID of the certificate. Default value: |
XForwardedForConfig
Field | Value type | Description |
XForwardedForClientCertSubjectDNEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForProtoEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForClientCertIssuerDNEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForSLBIdEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForClientSrcPortEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForClientCertFingerprintEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForEnabled | bool | Specifies whether to add the |
XForwardedForSLBPortEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForClientCertClientVerifyEnabled | bool | Specifies whether to add the
Default value: |
XForwardedForClientCertSubjectDNAlias | string | A custom field name. After you specify a value, the field name This field takes effect only when Default value: |
XForwardedForClientCertClientVerifyAlias | string | A custom field name. After you specify a value, the field name This field takes effect only when Default value: |
XForwardedForClientCertIssuerDNAlias | string | A custom field name. After you specify a value, the field name This field takes effect only when Default value: |
XForwardedForClientCertFingerprintAlias | string | A custom field name. After you specify a value, the field name This field takes effect only when Default value: |
XForwardedForClientSourceIpsEnabled | bool | Specifies whether to allow ALB to obtain the real client IP address from the
Default value: |
XForwardedForClientSourceIpsTrusted | string | The trusted proxy IP address. Enter a valid IP address or CIDR block. Separate multiple IP addresses or CIDR blocks with semicolons
Example value: |
AclConfig
Field | Value type | Description |
aclName | string | The name of the network ACL in AclEntry mode. For detailed operations on configuring ACLs, see Configure ACLs to implement access control. Default value: |
aclType | enum | The access control mode.
|
aclEntries | string[] | The network ACL rules. Default value: Important The |
aclIds | string[] | The list of the IDs of existing network ACLs. Default value: |
LogConfig
Field | Value type | Description |
accessLogRecordCustomizedHeadersEnabled | bool | Specifies whether to record custom headers in the access log of the ALB instance.
Default value: |
accessLogTracingConfig | The Tracing Analysis configuration. For detailed operations on Tracing Analysis, see Enable Xtrace for Tracing Analysis through Albconfig. |
AccessLogTracingConfig
Field | Value type | Description |
tracingEnabled | bool | Specifies whether to enable Tracing Analysis.
Default value: |
tracingSample | int | The sample rate of Tracing Analysis. Unit: Valid values: 1 to 10000. |
tracingType | enum | The sampling algorithm of Tracing Analysis.
|
AlbConfigStatus
The fields AlbConfigStatus
, LoadBalancerStatus
, ListenerStatus
, and AppliedCertificate
are reserved for ALB Ingress to automatically log status updates. These fields should not be altered.
Field | Output content | Description |
loadBalancer | A reserved parameter. Do not modify this field. The status of the ALB instance. |
LoadBalancerStatus
Field | Output content | Description |
dnsname | string | A reserved parameter. Do not modify this field. The DNS address of the ALB instance. |
id | string | A reserved parameter. Do not modify this field. The ID of the ALB instance. |
listeners | A reserved parameter. Do not modify this field. The attributes of the listeners of the ALB instance. |
ListenerStatus
Field | Output content | Description |
portAndProtocol | string | A reserved parameter. Do not modify this field. The ports and protocols used by listeners. |
certificates | A reserved parameter. Do not modify this field. The certificates associated with listeners. |
AppliedCertificate
Field | Output content | Description |
certificateId | string | A reserved parameter. Do not modify this field. The ID of the certificate. |
isDefault | bool | A reserved parameter. Do not modify this field. Specifies whether the certificate is a default certificate. |
References
For more information about AlbConfig settings, see Configure ALB Instances Through AlbConfig.
For more information on using ALB Ingress annotations, see Advanced Usage of ALB Ingress Services.