From c9dec6168283b4bf452bb28739f947aea79c341f Mon Sep 17 00:00:00 2001 From: Ben Jee Date: Thu, 28 May 2026 14:58:49 -0700 Subject: [PATCH] Update USP doc for routing to clusterIPs --- .../traffic-management/upstream-settings.md | 109 +++++++++++++++++- 1 file changed, 106 insertions(+), 3 deletions(-) diff --git a/content/ngf/traffic-management/upstream-settings.md b/content/ngf/traffic-management/upstream-settings.md index 29c3c54174..2445341941 100644 --- a/content/ngf/traffic-management/upstream-settings.md +++ b/content/ngf/traffic-management/upstream-settings.md @@ -299,7 +299,7 @@ spec: kind: Service name: tea loadBalancingMethod: "hash consistent" - hashMethodKey: "$upstream_addr" + hashMethodKey: "\$upstream_addr" EOF ``` @@ -513,7 +513,7 @@ kubectl apply -f - < +``` + +{{< call-out "note" >}}This setting applies only when the target Service has a ClusterIP. For headless Services (ClusterIP: None) and ExternalName Services, normal endpoint resolution is used instead. Additionally, this setting is also not applied to L4/stream upstreams.{{< /call-out >}} + +View the IP address of the `coffee` Service and verify it matches the IP address in the `coffee` upstream: + +```shell +kubectl get service coffee +``` + +```text +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +coffee ClusterIP 10.96.23.26 80/TCP 16m +``` + + +```shell +kubectl exec -it deployments/gateway-nginx -- nginx -T +``` + +```text +upstream default_coffee_80 { + random two least_conn; + zone default_coffee_80 1m; + + + server 10.96.23.26:80; + keepalive 32; +} +``` + --- ## Further reading