Skip to content

Commit e59b39f

Browse files
Update annotations documentation to include support for named service ports in NLB health check configuration (#4386)
1 parent 7dd802c commit e59b39f

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

docs/guide/service/annotations.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
| [service.beta.kubernetes.io/aws-load-balancer-backend-protocol](#backend-protocol) | string | | |
4141
| [service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags](#additional-resource-tags) | stringMap | | |
4242
| [service.beta.kubernetes.io/aws-load-balancer-healthcheck-protocol](#healthcheck-protocol) | string | TCP | |
43-
| [service.beta.kubernetes.io/aws-load-balancer-healthcheck-port ](#healthcheck-port) | integer \| traffic-port | traffic-port | |
43+
| [service.beta.kubernetes.io/aws-load-balancer-healthcheck-port ](#healthcheck-port) | integer \| traffic-port \| named-service-port | traffic-port | |
4444
| [service.beta.kubernetes.io/aws-load-balancer-healthcheck-path](#healthcheck-path) | string | "/" for HTTP(S) protocols | |
4545
| [service.beta.kubernetes.io/aws-load-balancer-healthcheck-healthy-threshold](#healthcheck-healthy-threshold) | integer | 3 | |
4646
| [service.beta.kubernetes.io/aws-load-balancer-healthcheck-unhealthy-threshold](#healthcheck-unhealthy-threshold) | integer | 3 | |
@@ -431,8 +431,13 @@ Health check on target groups can be configured with following annotations:
431431
432432
- <a name="healthcheck-port">`service.beta.kubernetes.io/aws-load-balancer-healthcheck-port`</a> specifies the TCP port to use for target group health check.
433433
434-
!!!note "default value"
435-
- if you do not specify the health check port, the default value will be `spec.healthCheckNodePort` when `externalTrafficPolicy=local` or `traffic-port` otherwise.
434+
!!!note "accepted values"
435+
- `traffic-port` - use the same port as the target group traffic (default when `externalTrafficPolicy=Cluster`)
436+
- Integer string (e.g., `"80"`) - use this specific port number
437+
- Service port name (e.g., `"http"`) - resolves based on target type:
438+
- **Instance targets**: uses the Service port's `NodePort`
439+
- **IP targets**: uses the Service port's `targetPort` (must be numeric, not a named port)
440+
- **Default**: `spec.healthCheckNodePort` when `externalTrafficPolicy=Local`, otherwise `traffic-port`
436441
437442
!!!example
438443
- set the health check port to `traffic-port`
@@ -443,6 +448,10 @@ Health check on target groups can be configured with following annotations:
443448
```
444449
service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "80"
445450
```
451+
- set the health check port to a named Service port
452+
```
453+
service.beta.kubernetes.io/aws-load-balancer-healthcheck-port: "http"
454+
```
446455
447456
- <a name="healthcheck-path">`service.beta.kubernetes.io/aws-load-balancer-healthcheck-path`</a> specifies the http path for the health check in case of http/https protocol.
448457

0 commit comments

Comments
 (0)