You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/aks/ingress-basic.md
+47-26Lines changed: 47 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ author: mlearned
6
6
7
7
ms.service: container-service
8
8
ms.topic: article
9
-
ms.date: 05/24/2019
9
+
ms.date: 12/20/2019
10
10
ms.author: mlearned
11
11
---
12
12
@@ -25,18 +25,18 @@ You can also:
25
25
26
26
## Before you begin
27
27
28
-
This article uses Helm to install the NGINX ingress controller, cert-manager, and a sample web app. You need to have Helm initialized within your AKS cluster and using a service account for Tiller. For more information on configuring and using Helm, see [Install applications with Helm in Azure Kubernetes Service (AKS)][use-helm].
28
+
This article uses Helm to install the NGINX ingress controllerand a sample web app.
29
29
30
30
This article also requires that you are running the Azure CLI version 2.0.64 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][azure-cli-install].
31
31
32
32
## Create an ingress controller
33
33
34
-
To create the ingress controller, use `Helm` to install *nginx-ingress*. For added redundancy, two replicas of the NGINX ingress controllers are deployed with the `--set controller.replicaCount` parameter. To fully benefit from running replicas of the ingress controller, make sure there's more than one node in your AKS cluster.
34
+
To create the ingress controller, use Helm to install *nginx-ingress*. For added redundancy, two replicas of the NGINX ingress controllers are deployed with the `--set controller.replicaCount` parameter. To fully benefit from running replicas of the ingress controller, make sure there's more than one node in your AKS cluster.
35
35
36
36
The ingress controller also needs to be scheduled on a Linux node. Windows Server nodes (currently in preview in AKS) shouldn't run the ingress controller. A node selector is specified using the `--set nodeSelector` parameter to tell the Kubernetes scheduler to run the NGINX ingress controller on a Linux-based node.
37
37
38
38
> [!TIP]
39
-
> 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.
39
+
> The following example creates a Kubernetes namespace for the ingress resources named *ingress-basic*. Specify a namespace for your own environment as needed.
40
40
41
41
> [!TIP]
42
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.
@@ -45,10 +45,12 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
No ingress rules have been created yet, so the NGINX ingress controller's default 404 page is displayed if you browse to the internal IP address. Ingress rules are configured in the following steps.
68
70
69
71
## Run demo applications
70
72
71
-
To see the ingress controller in action, let's run two demo applications in your AKS cluster. In this example, Helm is used to deploy two instances of a simple 'Hello world' application.
73
+
To see the ingress controller in action, let's run two demo applications in your AKS cluster. In this example, Helm is used to deploy two instances of a simple *Hello world* application.
72
74
73
75
Before you can install the sample Helm charts, add the Azure samples repository to your Helm environment as follows:
Now install a second instance of the demo application. For the second instance, you specify a new title so that the two applications are visually distinct. You also specify a unique service name:
Both applications are now running on your Kubernetes cluster. To route traffic to each application, create a Kubernetes ingress resource. The ingress resource configures the rules that route traffic to one of the two applications.
97
99
98
-
In the following example, traffic to the address `http://40.117.74.8/`is routed to the service named `aks-helloworld`. Traffic to the address `http://40.117.74.8/hello-world-two` is routed to the `ingress-demo` service.
100
+
In the following example, traffic to *EXTERNAL_IP*is routed to the service named `aks-helloworld`. Traffic to *EXTERNAL_IP/hello-world-two* is routed to the `aks-helloworld-two` service. Traffic to *EXTERNAL_IP/static* is routed to the service named `aks-helloworld` for static assets.
99
101
100
102
Create a file named `hello-world-ingress.yaml` and copy in the following example YAML.
Create the ingress resource using the `kubectl apply -f hello-world-ingress.yaml` command.
@@ -129,15 +149,16 @@ Create the ingress resource using the `kubectl apply -f hello-world-ingress.yaml
129
149
$ kubectl apply -f hello-world-ingress.yaml
130
150
131
151
ingress.extensions/hello-world-ingress created
152
+
ingress.extensions/hello-world-ingress-static created
132
153
```
133
154
134
155
## Test the ingress controller
135
156
136
-
To test the routes for the ingress controller, browse to the two applications. Open a web browser to the IP address of your NGINX ingress controller, such as *http://40.117.74.8*. The first demo application is displayed in the web browser, as shown in the follow example:
157
+
To test the routes for the ingress controller, browse to the two applications. Open a web browser to the IP address of your NGINX ingress controller, such as *EXTERNAL_IP*. The first demo application is displayed in the web browser, as shown in the follow example:
137
158
138
159

139
160
140
-
Now add the */hello-world-two* path to the IP address, such as *http://40.117.74.8/hello-world-two*. The second demo application with the custom title is displayed:
161
+
Now add the */hello-world-two* path to the IP address, such as *EXTERNAL_IP/hello-world-two*. The second demo application with the custom title is displayed:
141
162
142
163

Alternatively, a more granular approach is to delete the individual resources created. List the Helm releases with the `helm list` command. Look for charts named *nginx-ingress* and *aks-helloworld*, as shown in the following example output:
165
186
166
187
```
167
-
$ helm list
188
+
$ helm list --namespace ingress-basic
168
189
169
-
NAME REVISIONUPDATED STATUS CHART APP VERSION NAMESPACE
Delete the releases with the `helm delete` command. The following example deletes the NGINX ingress deployment, and the two sample AKS hello world apps.
0 commit comments