Skip to content

Commit d381e37

Browse files
authored
Merge pull request #77847 from zr-msft/aks-source-ip
[AKS] added client source IP preservation
2 parents f12264e + 0f4bfe5 commit d381e37

File tree

6 files changed

+23
-1
lines changed

6 files changed

+23
-1
lines changed

articles/aks/concepts-network.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ In AKS, you can create an Ingress resource using something like NGINX, or use th
9696

9797
Another common feature of Ingress is SSL/TLS termination. On large web applications accessed via HTTPS, the TLS termination can be handled by the Ingress resource rather than within the application itself. To provide automatic TLS certification generation and configuration, you can configure the Ingress resource to use providers such as Let's Encrypt. For more information on configuring an NGINX Ingress controller with Let's Encrypt, see [Ingress and TLS][aks-ingress-tls].
9898

99+
You can also configure your ingress controller to preserve the client source IP on requests to containers in your AKS cluster. When a client's request is routed to a container in your AKS cluster via your ingress controller, the original source ip of that request will not be available to the target container. When you enable *client source IP preservation*, the source IP for the client is available in the request header under *X-Forwarded-For*. If you are using client source IP preservation on your ingress controller, you cannot use SSL pass-through. Client source IP preservation and SSL pass-through can be used with other services, such as the *LoadBalancer* type.
100+
99101
## Network security groups
100102

101103
A network security group filters traffic for VMs, such as the AKS nodes. As you create Services, such as a LoadBalancer, the Azure platform automatically configures any network security group rules that are needed. Don't manually configure network security group rules to filter traffic for pods in an AKS cluster. Define any required ports and forwarding as part of your Kubernetes Service manifests, and let the Azure platform create or update the appropriate rules. You can also use network policies, as discussed in the next section, to automatically apply traffic filter rules to pods.

articles/aks/ingress-basic.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
3838
> [!TIP]
3939
> The following example creates a Kubernetes namespace for the ingress resources named *ingress-basic*. Specify a namespace for your own environment as needed. If your AKS cluster is not RBAC enabled, add `--set rbac.create=false` to the Helm commands.
4040
41+
> [!TIP]
42+
> 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 using an ingress controller with client source IP preservation enabled, SSL pass-through will not work.
43+
4144
```console
4245
# Create a namespace for your ingress resources
4346
kubectl create namespace ingress-basic
@@ -222,3 +225,4 @@ You can also:
222225
[aks-ingress-static-tls]: ingress-static-ip.md
223226
[aks-http-app-routing]: http-application-routing.md
224227
[aks-ingress-own-tls]: ingress-own-tls.md
228+
[client-source-ip]: concepts-network.md#ingress-controllers

articles/aks/ingress-internal-ip.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
5050
> [!TIP]
5151
> The following example creates a Kubernetes namespace for the ingress resources named *ingress-basic*. Specify a namespace for your own environment as needed. If your AKS cluster is not RBAC enabled, add `--set rbac.create=false` to the Helm commands.
5252

53+
> [!TIP]
54+
> 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 using an ingress controller with client source IP preservation enabled, SSL pass-through will not work.
55+
5356
```console
5457
# Create a namespace for your ingress resources
5558
kubectl create namespace ingress-basic
@@ -271,3 +274,4 @@ You can also:
271274
[aks-ingress-static-tls]: ingress-static-ip.md
272275
[aks-http-app-routing]: http-application-routing.md
273276
[aks-ingress-own-tls]: ingress-own-tls.md
277+
[client-source-ip]: concepts-network.md#ingress-controllers

articles/aks/ingress-own-tls.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
3838
> [!TIP]
3939
> The following example creates a Kubernetes namespace for the ingress resources named *ingress-basic*. Specify a namespace for your own environment as needed. If your AKS cluster is not RBAC enabled, add `--set rbac.create=false` to the Helm commands.
4040
41+
> [!TIP]
42+
> 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 using an ingress controller with client source IP preservation enabled, SSL pass-through will not work.
43+
4144
```console
4245
# Create a namespace for your ingress resources
4346
kubectl create namespace ingress-basic
@@ -311,3 +314,4 @@ You can also:
311314
[aks-ingress-basic]: ingress-basic.md
312315
[aks-http-app-routing]: http-application-routing.md
313316
[aks-ingress-tls]: ingress-tls.md
317+
[client-source-ip]: concepts-network.md#ingress-controllers

articles/aks/ingress-static-ip.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
5656
> [!TIP]
5757
> The following example creates a Kubernetes namespace for the ingress resources named *ingress-basic*. Specify a namespace for your own environment as needed. If your AKS cluster is not RBAC enabled, add `--set rbac.create=false` to the Helm commands.
5858
59+
> [!TIP]
60+
> 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 using an ingress controller with client source IP preservation enabled, SSL pass-through will not work.
61+
5962
```console
6063
# Create a namespace for your ingress resources
6164
kubectl create namespace ingress-basic
@@ -420,4 +423,5 @@ You can also:
420423
[aks-ingress-own-tls]: ingress-own-tls.md
421424
[aks-quickstart-cli]: kubernetes-walkthrough.md
422425
[aks-quickstart-portal]: kubernetes-walkthrough-portal.md
426+
[client-source-ip]: concepts-network.md#ingress-controllers
423427
[install-azure-cli]: /cli/azure/install-azure-cli

articles/aks/ingress-tls.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
4343
> [!TIP]
4444
> The following example creates a Kubernetes namespace for the ingress resources named *ingress-basic*. Specify a namespace for your own environment as needed. If your AKS cluster is not RBAC enabled, add `--set rbac.create=false` to the Helm commands.
4545
46+
> [!TIP]
47+
> 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 using an ingress controller with client source IP preservation enabled, SSL pass-through will not work.
48+
4649
```console
4750
# Create a namespace for your ingress resources
4851
kubectl create namespace ingress-basic
@@ -402,4 +405,5 @@ You can also:
402405
[aks-ingress-own-tls]: ingress-own-tls.md
403406
[aks-quickstart-cli]: kubernetes-walkthrough.md
404407
[aks-quickstart-portal]: kubernetes-walkthrough-portal.md
405-
[install-azure-cli]: /cli/azure/install-azure-cli
408+
[client-source-ip]: concepts-network.md#ingress-controllers
409+
[install-azure-cli]: /cli/azure/install-azure-cli

0 commit comments

Comments
 (0)