You can use the AlbConfig custom resource to customize your ALB instance configuration. This topic describes all supported Ingress annotations and AlbConfig fields, including their descriptions and usage.
Index
Annotation fields
Feature category | Ingress annotation configuration |
Annotation YAML | |
ALB Ingress configuration | |
Listener or protocol configuration | |
Traffic forwarding rule configuration | |
Advanced configuration | |
Other |
AlbConfig fields
Field category | Field links |
AlbConfig YAML | |
AlbConfig | |
ALB instance | |
Listener configuration | |
Virtual switch | |
Simple Log Service | |
QUIC listener | |
Certificate configuration | |
Access control | |
Tracing Analysis | |
X-Forwarded- configuration | |
Custom header in logs | |
Reserved fields |
Annotation YAML example
This example shows how to use annotations to configure an ALB instance in an Ingress resource. For details about each annotation, see the following sections.
Annotations supported by Ingress
You can add annotations to your Ingress resources as needed.
Health check
Annotation | Description |
alb.ingress.kubernetes.io/healthcheck-enabled | Enable health checks for the backend server group. For a configuration example, see Configure health check.
Default: |
alb.ingress.kubernetes.io/healthcheck-path | Health check path. Default: |
alb.ingress.kubernetes.io/healthcheck-protocol | Protocol used for health checks.
Default: |
alb.ingress.kubernetes.io/healthcheck-httpversion | HTTP version. Applies only when
Default: |
alb.ingress.kubernetes.io/healthcheck-method | Health check method.
Default: Important Select |
alb.ingress.kubernetes.io/healthcheck-httpcode | Health check status codes. A backend server is considered healthy only if the probe request succeeds and returns one of these status codes. Enter one or more of the following options, separated by commas:
Default: |
alb.ingress.kubernetes.io/healthcheck-code | Health check status codes. A backend server is considered healthy only if the probe request succeeds and returns one of these status codes. If both Valid values depend on the value of
|
alb.ingress.kubernetes.io/healthcheck-timeout-seconds | Health check timeout period, in seconds (s). Range: [1, 300]. Default: |
alb.ingress.kubernetes.io/healthcheck-interval-seconds | Interval between health checks, in seconds (s). Range: [1, 50]. Default: |
alb.ingress.kubernetes.io/healthy-threshold-count | Number of successful health checks required to mark a backend server as healthy. Range: [2, 10]. Default: |
alb.ingress.kubernetes.io/unhealthy-threshold-count | Number of failed health checks required to mark a backend server as unhealthy. Range: [2, 10]. Default: |
alb.ingress.kubernetes.io/healthcheck-connect-port | Port used for health checks. Default: Note
|
Redirection
Annotation | Description |
alb.ingress.kubernetes.io/ssl-redirect | Redirect HTTP requests to HTTPS (port 443) using HTTP status code 308. For a configuration example, see Configure HTTP-to-HTTPS redirection.
Default: |
Protocol used by backend service
Annotation | Description |
alb.ingress.kubernetes.io/backend-protocol | Protocol used by the backend server group. For a configuration example, see Support for HTTPS and gRPC protocols on backend servers.
Default: Note Supported backend protocols per listener type:
|
Rewrite
Annotation | Description |
alb.ingress.kubernetes.io/rewrite-target | Target path for path rewriting. For a configuration example, see Rewrite path. |
Listener
Annotation | Description |
alb.ingress.kubernetes.io/listen-ports | Ports and protocols for listeners associated with the Ingress resource. For a configuration example, see Configure custom listener ports. Specify the listener protocols and ports you want to associate with the Ingress rules (examples below):
|
Slow start
Annotation | Description |
alb.ingress.kubernetes.io/slow-start-enabled | Enable slow start. When enabled, ALB Ingress gradually shifts traffic to newly added pods in a Service backend. This avoids CPU and memory spikes during pod startup. For a configuration example, see Backend slow start.
Default: disabled. |
alb.ingress.kubernetes.io/slow-start-duration | Time, in seconds (s), for traffic to ramp up after slow start completes. Longer durations mean slower ramp-up. Range: [30, 900]. Default: |
Priority
Annotation | Description |
alb.ingress.kubernetes.io/order | Relative priority of the forwarding rule. Lower numbers indicate higher priority. For a configuration example, see Configure forwarding rule priority. Range: [1, 1000]. Default: |
Phased release
Annotation | Description |
alb.ingress.kubernetes.io/canary | Enable canary phased release. For step-by-step instructions, see Implement phased release with ALB Ingress.
Default: |
alb.ingress.kubernetes.io/canary-by-header | Request header used to trigger canary routing. |
alb.ingress.kubernetes.io/canary-by-header-value | Header value that triggers canary routing. |
alb.ingress.kubernetes.io/canary-by-cookie | Cookie used to trigger canary routing. |
alb.ingress.kubernetes.io/canary-weight | Percentage of requests routed to the specified service (integer from 0 to 100). For step-by-step instructions, see Canary weight. |
Session persistence
Annotation | Description |
alb.ingress.kubernetes.io/sticky-session | Enable session persistence for the backend server group. For a configuration example, see Enable session persistence with annotations.
Default: |
alb.ingress.kubernetes.io/sticky-session-type | Type of session persistence.
Default: |
alb.ingress.kubernetes.io/cookie-timeout | Session persistence timeout period, in seconds (s). Range: [1, 86400]. Default: |
alb.ingress.kubernetes.io/cookie | Custom cookie value. Type: string. Default: |
Connection draining
Annotation | Description |
alb.ingress.kubernetes.io/connection-drain-enabled | Enable connection draining. When enabled, ALB Ingress maintains normal traffic flow for a period after a backend pod enters the Terminating state or fails health checks. After the timeout expires, connections break. This prevents business disruption from sudden backend removal. For details, see Connection draining.
Default: disabled. |
alb.ingress.kubernetes.io/connection-drain-timeout | Connection draining timeout period, in seconds (s). Range: [0, 900]. Default: |
Load balancing
Annotation | Description |
alb.ingress.kubernetes.io/backend-scheduler | Load balancing algorithm for the backend server group. For a configuration example, see Specify load balancing algorithm for backend server group.
Default: |
alb.ingress.kubernetes.io/backend-scheduler-uch-value | URL hash parameter used when the load balancing algorithm is uch. |
Cross-domain
Annotation | Description |
alb.ingress.kubernetes.io/enable-cors | Enable cross-origin resource sharing (CORS) configuration. For a configuration example, see CORS configuration.
Default: |
alb.ingress.kubernetes.io/cors-allow-origin | Origins allowed to make cross-domain requests. Default: |
alb.ingress.kubernetes.io/cors-expose-headers | List of headers exposed to the client. |
alb.ingress.kubernetes.io/cors-allow-methods | HTTP methods allowed for cross-domain requests. Enter one or more of the following options:
Default: |
alb.ingress.kubernetes.io/cors-allow-credentials | Allow credentials in cross-domain requests.
Default: |
alb.ingress.kubernetes.io/cors-max-age | Maximum time, in seconds (s), that preflight responses are cached in browsers. Range: [-1, 172800]. Default: Note
|
alb.ingress.kubernetes.io/cors-allow-headers | List of headers allowed in cross-domain requests. Default: |
Custom forwarding
Annotation | Description |
alb.ingress.kubernetes.io/actions.{svcName} | Custom forwarding action. For step-by-step instructions, see Define custom forwarding rules for ALB Ingress. |
alb.ingress.kubernetes.io/conditions.{svcName} | Custom forwarding condition. |
alb.ingress.kubernetes.io/rule-direction.{svcName} | Custom forwarding direction.
Default: |
IPv6 attachment for backend server group
Annotation | Description |
alb.ingress.kubernetes.io/enable-ipv6 | Enable IPv6 attachment for the backend server group. For a configuration example, see Attach IPv6 addresses to backend server groups.
Default: |
Other
Annotation | Description |
alb.ingress.kubernetes.io/backend-keepalive | Enable persistent connections to backend servers. For a configuration example, see Persistent connections to backend servers. Default: |
alb.ingress.kubernetes.io/traffic-limit-qps | Requests-per-second (QPS) rate limiting. Range: [1, 1000000]. |
alb.ingress.kubernetes.io/use-regex | Allow regular expressions in the Path field. Applies only to Prefix path types. Default: |
AlbConfig fields
An AlbConfig custom resource describes an ALB instance and its listeners. This section provides a complete AlbConfig example. For details about each field, see the following sections.
AlbConfig
Field | Data type | Description |
apiVersion | Fixed value | APIVersion defines the versioned schema for this object. Fixed value: |
kind | Fixed value | Kind indicates the REST resource this object represents. Fixed value: |
metadata | Standard metadata for objects. For more information, see metadata. | |
spec | List of parameters that describe ALB instance and listener properties. | |
status | After reconciliation, the instance status writes to |
AlbConfigSpec
Field | Data type | Description |
config | Properties of the ALB instance. | |
listeners | Properties of listeners under the instance. |
LoadBalancerSpec
Field | Data type | Description |
id | string | ALB instance ID. Fill in to enable reuse mode. Leave empty to let the controller create a new ALB instance. For step-by-step instructions, see Create an AlbConfig. Default: |
name | string | ALB instance name. Default: Auto-generated using this pattern: |
addressAllocatedMode | enum | Address allocation mode for the ALB instance.
Default: |
addressType | enum | IPv4 address type for the ALB instance.
Default: |
ipv6AddressType | enum | IPv6 address type for the ALB instance. Does not need to match the IPv4 address type.
Default: |
addressIpVersion | enum | Whether the ALB instance supports dual-stack.
Default: |
resourceGroupId | string | ID of the resource group that owns the instance. Default: |
edition | enum | Feature edition of the instance. You cannot change the edition in reuse mode.
Default: |
deletionProtectionEnabled | bool | Reserved field. Do not modify. |
forceOverride | bool | Force override instance properties in reuse mode.
Default: |
listenerForceOverride | bool | Force override listener properties in reuse mode.
Default: |
zoneMappings | Zones and EIP configurations. | |
accessLogConfig | Log collection. | |
billingConfig | Billing method. | |
modificationProtectionConfig | Configuration read-only mode. | |
tags | Instance tags. | |
securityGroupIds | string[] | Security group IDs for the ALB instance. For details, see Configure security groups with AlbConfig. |
ZoneMapping
Field | Data type | Description |
vSwitchId | string | (Required) ID of the virtual switch. Default: |
zoneId | string | Zone of the virtual switch. Keep the default value. Default: |
allocationId | string | Elastic IP (EIP) ID. For a configuration example, see Configure ALB instances with AlbConfig. Default: |
eipType | string | Reserved field. Do not modify. |
AccessLogConfig
Field | Data type | Description |
logProject | string | Name of the Simple Log Service project. Default: |
logStore | string | Name of the Simple Log Service Logstore. Must start with Default: |
BillingConfig
Field | Data type | Description |
internetBandwidth | int | Reserved field. Do not modify. |
internetChargeType | string | Reserved field. Do not modify. |
payType | enum | Reserved field. Do not modify. |
bandWidthPackageId | string | ID of the Internet Shared Bandwidth package to attach. You cannot detach after attaching. For a configuration example, see Internet Shared Bandwidth package configuration. Default: |
ModificationProtectionConfig
Field | Data type | Description |
reason | string | Reserved field. |
status | string | Reserved field. |
Tag
Field | Data type | Description |
key | string | Key of the tag. Default: |
value | string | Value of the tag. Default: |
ListenerSpec
Field | Data type | Description |
gzipEnabled | bool | Enable data compression. For a configuration example, see Use data compression.
Default: |
http2Enabled | bool | Enable HTTP/2 protocol.
Default: |
port | int | (Required) Port used by the listener. Default: |
protocol | enum | (Required) Protocol used by the listener.
|
securityPolicyId | string | ID of the TLS security policy. Default: |
idleTimeout | int | Idle connection timeout period, in seconds (s). Range: [1, 600]. Default: Note A value of 0 uses the default. |
loadBalancerId | string | Reserved field. Do not modify. |
description | string | Name of the listener. Default: Auto-generated using this pattern: |
caEnabled | bool | Enable mutual authentication.
Default: |
requestTimeout | int | Request timeout period, in seconds (s). Range: [1, 600]. Default: |
quicConfig | QUIC listener configuration. | |
defaultActions | Action[] | Reserved field. Do not modify. |
caCertificates | Root CA certificate for the listener. | |
certificates | Server certificate for the listener. | |
xForwardedForConfig | X-Forwarded- configuration. | |
logConfig | Logging configuration for the listener. | |
aclConfig | Access control. |
QuicConfig
Field | Data type | Description |
quicUpgradeEnabled | bool | Enable QUIC upgrade. In scenarios where QUIC and HTTPS listeners work together, this field associates or disassociates them. For step-by-step instructions, see Use QUIC listeners to support HTTP/3.
Default: |
quicListenerId | string | HTTPS listener associated with the QUIC listener. Default: |
Certificate
Field | Data type | Description |
IsDefault | bool | Set this certificate as the default. For step-by-step instructions, see Configure HTTPS certificates for encrypted communication.
Default: Important You can set only one certificate as default. |
CertificateId | string | CertIdentifier for the certificate. Default: |
XForwardedForConfig
Field | Data type | Description |
XForwardedForClientCertSubjectDNEnabled | bool | Add the
Default: |
XForwardedForProtoEnabled | bool | Add the
Default: |
XForwardedForClientCertIssuerDNEnabled | bool | Add the
Default: |
XForwardedForSLBIdEnabled | bool | Add the
Default: |
XForwardedForClientSrcPortEnabled | bool | Add the
Default: |
XForwardedForClientCertFingerprintEnabled | bool | Add the
Default: |
XForwardedForEnabled | bool | The To disable this feature or use enhanced functions, upgrade ALB Ingress Controller to version 2.15.0 or later and use |
XForwardedForProcessingMode | string |
If both |
XForwardedForHostEnabled | bool | Add the |
XForwardedForSLBPortEnabled | bool | Add the
Default: |
XForwardedForClientCertClientVerifyEnabled | bool | Add the
Default: |
XForwardedForClientCertSubjectDNAlias | string | Custom field name. Replaces the This field takes effect only when Default: |
XForwardedForClientCertClientVerifyAlias | string | Custom field name. Replaces the This field takes effect only when Default: |
XForwardedForClientCertIssuerDNAlias | string | Custom field name. Replaces the This field takes effect only when Default: |
XForwardedForClientCertFingerprintAlias | string | Custom field name. Replaces the This field takes effect only when Default: |
XForwardedForClientSourceIpsEnabled | bool | Allow ALB to find the originating client IP from the
Default: |
XForwardedForClientSourceIpsTrusted | string | Specify trusted proxy IP addresses. Enter valid IP addresses or CIDR blocks, separated by semicolons (
Example: |
AclConfig
Field | Data type | Description |
aclName | string | Name of the associated ACL policy in AclEntry mode. For step-by-step instructions, see Configure ACL for access control. Default: |
aclType | enum | Access control mode.
|
aclEntries | string | Access policy entries. Default: Important Do not use |
aclIds | string | List of existing policy IDs to associate. Default: |
LogConfig
Field | Data type | Description |
accessLogRecordCustomizedHeadersEnabled | bool | Use custom headers in the access logs of the ALB instance.
Default: |
accessLogTracingConfig | Configuration parameters for Tracing Analysis. For step-by-step instructions, see Enable Xtrace for Tracing Analysis with AlbConfig. |
AccessLogTracingConfig
Field | Data type | Description |
tracingEnabled | bool | Specifies whether to enable the Tracing Analysis feature.
Default: |
tracingSample | int | Tracing Analysis sample rate, in units of Range: [1, 10000]. |
tracingType | enum | Sampling algorithm for Tracing Analysis.
|
AlbConfigStatus
The following fields are reserved for ALB Ingress to record status. Do not modify these fields: AlbConfigStatus, LoadBalancerStatus, ListenerStatus, and AppliedCertificate.
Field | Output | Description |
loadBalancer | Reserved field. Do not modify. Status of the ALB instance. |
LoadBalancerStatus
Field | Output | Description |
dnsname | string | Reserved field. Do not modify. DNS address of the ALB instance. |
id | string | Reserved field. Do not modify. ID of the ALB instance. |
listeners | Reserved field. Do not modify. Listener properties of the ALB instance. |
ListenerStatus
Field | Output | Description |
portAndProtocol | string | Reserved field. Do not modify. Port and protocol used by the listener. |
certificates | Reserved field. Do not modify. Certificate associated with the listener. |
AppliedCertificate
Field | Output | Description |
certificateId | string | Reserved field. Do not modify. CertIdentifier of the certificate. |
isDefault | bool | Reserved field. Do not modify. Whether the certificate is the default certificate. |
References
For more information about specific settings in AlbConfig, see Configure ALB instances with AlbConfig.
For more information about using ALB Ingress annotations, see Advanced usage of ALB Ingress.