Skip to content

Commit 5be20dd

Browse files
Merge pull request #264274 from schaffererin/ingressnginxexternaltrafficlocal
Added external traffic local flag to commands
2 parents 98b9c3a + 20c8b30 commit 5be20dd

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

articles/aks/ingress-basic.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ This article shows you how to deploy the [NGINX ingress controller][nginx-ingres
3535

3636
To create a basic NGINX ingress controller without customizing the defaults, you'll use Helm. The following configuration uses the default configuration for simplicity. You can add parameters for customizing the deployment, like `--set controller.replicaCount=3`.
3737

38+
> [!NOTE]
39+
> If you would like to enable [client source IP preservation][client-source-ip] for requests to containers in your cluster, add `--set controller.service.externalTrafficPolicy=Local` to the Helm install command. The client source IP is stored in the request header under *X-Forwarded-For*. When you're using an ingress controller with client source IP preservation enabled, TLS pass-through won't work.
40+
3841
### [Azure CLI](#tab/azure-cli)
3942

4043
```console
@@ -46,7 +49,8 @@ helm repo update
4649
helm install ingress-nginx ingress-nginx/ingress-nginx \
4750
--create-namespace \
4851
--namespace $NAMESPACE \
49-
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz
52+
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz \
53+
--set controller.service.externalTrafficPolicy=Local
5054
```
5155

5256
### [Azure PowerShell](#tab/azure-powershell)
@@ -60,7 +64,8 @@ helm repo update
6064
helm install ingress-nginx ingress-nginx/ingress-nginx `
6165
--create-namespace `
6266
--namespace $Namespace `
63-
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz
67+
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz `
68+
--set controller.service.externalTrafficPolicy=Local
6469
```
6570

6671
---
@@ -148,6 +153,7 @@ helm install ingress-nginx ingress-nginx/ingress-nginx \
148153
--set controller.image.digest="" \
149154
--set controller.admissionWebhooks.patch.nodeSelector."kubernetes\.io/os"=linux \
150155
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz \
156+
--set controller.service.externalTrafficPolicy=Local \
151157
--set controller.admissionWebhooks.patch.image.registry=$ACR_URL \
152158
--set controller.admissionWebhooks.patch.image.image=$PATCH_IMAGE \
153159
--set controller.admissionWebhooks.patch.image.tag=$PATCH_TAG \
@@ -181,6 +187,7 @@ helm install ingress-nginx ingress-nginx/ingress-nginx `
181187
--set controller.image.digest="" `
182188
--set controller.admissionWebhooks.patch.nodeSelector."kubernetes\.io/os"=linux `
183189
--set controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz `
190+
--set controller.service.externalTrafficPolicy=Local `
184191
--set controller.admissionWebhooks.patch.image.registry=$AcrUrl `
185192
--set controller.admissionWebhooks.patch.image.image=$PatchImage `
186193
--set controller.admissionWebhooks.patch.image.tag=$PatchTag `

0 commit comments

Comments
 (0)