Skip to content

Commit 48ab20f

Browse files
Merge pull request #112886 from zr-msft/zr-aks-1701486-remove-helm-repo
[AKS] removed helm sample repo from ingress docs
2 parents 6b160a1 + d4bc98f commit 48ab20f

File tree

5 files changed

+442
-169
lines changed

5 files changed

+442
-169
lines changed

articles/aks/ingress-basic.md

Lines changed: 85 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure Kubernetes Service
44
description: Learn how to install and configure a basic NGINX ingress controller in an Azure Kubernetes Service (AKS) cluster.
55
services: container-service
66
ms.topic: article
7-
ms.date: 12/20/2019
7+
ms.date: 04/27/2020
88

99
---
1010

@@ -23,7 +23,7 @@ You can also:
2323

2424
## Before you begin
2525

26-
This article uses [Helm 3][helm] to install the NGINX ingress controller and a sample web app.
26+
This article uses [Helm 3][helm] to install the NGINX ingress controller.
2727

2828
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].
2929

@@ -37,7 +37,7 @@ The ingress controller also needs to be scheduled on a Linux node. Windows Serve
3737
> The following example creates a Kubernetes namespace for the ingress resources named *ingress-basic*. Specify a namespace for your own environment as needed.
3838
3939
> [!TIP]
40-
> 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, TLS pass-through will not work.
40+
> 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.
4141
4242
```console
4343
# Create a namespace for your ingress resources
@@ -68,34 +68,96 @@ No ingress rules have been created yet, so the NGINX ingress controller's defaul
6868

6969
## Run demo applications
7070

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.
71+
To see the ingress controller in action, run two demo applications in your AKS cluster. In this example, you use `kubectl apply` to deploy two instances of a simple *Hello world* application.
7272

73-
Before you can install the sample Helm charts, add the Azure samples repository to your Helm environment as follows:
73+
Create a *aks-helloworld-one.yaml* file and copy in the following example YAML:
7474

75-
```console
76-
helm repo add azure-samples https://azure-samples.github.io/helm-charts/
75+
```yml
76+
apiVersion: apps/v1
77+
kind: Deployment
78+
metadata:
79+
name: aks-helloworld-one
80+
spec:
81+
replicas: 1
82+
selector:
83+
matchLabels:
84+
app: aks-helloworld-one
85+
template:
86+
metadata:
87+
labels:
88+
app: aks-helloworld-one
89+
spec:
90+
containers:
91+
- name: aks-helloworld-one
92+
image: neilpeterson/aks-helloworld:v1
93+
ports:
94+
- containerPort: 80
95+
env:
96+
- name: TITLE
97+
value: "Welcome to Azure Kubernetes Service (AKS)"
98+
---
99+
apiVersion: v1
100+
kind: Service
101+
metadata:
102+
name: aks-helloworld-one
103+
spec:
104+
type: ClusterIP
105+
ports:
106+
- port: 80
107+
selector:
108+
app: aks-helloworld-one
77109
```
78110
79-
Create the first demo application from a Helm chart with the following command:
111+
Create a *aks-helloworld-two.yaml* file and copy in the following example YAML:
80112
81-
```console
82-
helm install aks-helloworld azure-samples/aks-helloworld --namespace ingress-basic
113+
```yml
114+
apiVersion: apps/v1
115+
kind: Deployment
116+
metadata:
117+
name: aks-helloworld-two
118+
spec:
119+
replicas: 1
120+
selector:
121+
matchLabels:
122+
app: aks-helloworld-two
123+
template:
124+
metadata:
125+
labels:
126+
app: aks-helloworld-two
127+
spec:
128+
containers:
129+
- name: aks-helloworld-two
130+
image: neilpeterson/aks-helloworld:v1
131+
ports:
132+
- containerPort: 80
133+
env:
134+
- name: TITLE
135+
value: "AKS Ingress Demo"
136+
---
137+
apiVersion: v1
138+
kind: Service
139+
metadata:
140+
name: aks-helloworld-two
141+
spec:
142+
type: ClusterIP
143+
ports:
144+
- port: 80
145+
selector:
146+
app: aks-helloworld-two
83147
```
84148
85-
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:
149+
Run the two demo applications using `kubectl apply`:
86150

87151
```console
88-
helm install aks-helloworld-two azure-samples/aks-helloworld \
89-
--namespace ingress-basic \
90-
--set title="AKS Ingress Demo" \
91-
--set serviceName="aks-helloworld-two"
152+
kubectl apply -f aks-helloworld-one.yaml --namespace ingress-basic
153+
kubectl apply -f aks-helloworld-two.yaml --namespace ingress-basic
92154
```
93155

94156
## Create an ingress route
95157

96158
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.
97159

98-
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.
160+
In the following example, traffic to *EXTERNAL_IP* is routed to the service named `aks-helloworld-one`. 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-one` for static assets.
99161

100162
Create a file named `hello-world-ingress.yaml` and copy in the following example YAML.
101163

@@ -114,7 +176,7 @@ spec:
114176
- http:
115177
paths:
116178
- backend:
117-
serviceName: aks-helloworld
179+
serviceName: aks-helloworld-one
118180
servicePort: 80
119181
path: /(.*)
120182
- backend:
@@ -136,7 +198,7 @@ spec:
136198
- http:
137199
paths:
138200
- backend:
139-
serviceName: aks-helloworld
201+
serviceName: aks-helloworld-one
140202
servicePort: 80
141203
path: /static(/|$)(.*)
142204
```
@@ -172,12 +234,6 @@ To delete the entire sample namespace, use the `kubectl delete` command and spec
172234
kubectl delete namespace ingress-basic
173235
```
174236

175-
Then, remove the Helm repo for the AKS hello world app:
176-
177-
```console
178-
helm repo remove azure-samples
179-
```
180-
181237
### Delete resources individually
182238

183239
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:
@@ -186,25 +242,22 @@ Alternatively, a more granular approach is to delete the individual resources cr
186242
$ helm list --namespace ingress-basic
187243
188244
NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION
189-
aks-helloworld ingress-basic 1 2020-01-06 19:57:00.131576 -0600 CST deployed aks-helloworld-0.1.0
190-
aks-helloworld-two ingress-basic 1 2020-01-06 19:57:10.971365 -0600 CST deployed aks-helloworld-0.1.0
191245
nginx-ingress ingress-basic 1 2020-01-06 19:55:46.358275 -0600 CST deployed nginx-ingress-1.27.1 0.26.1
192246
```
193247

194-
Delete the releases with the `helm delete` command. The following example deletes the NGINX ingress deployment, and the two sample AKS hello world apps.
248+
Uninstall the releases with the `helm uninstall` command. The following example uninstalls the NGINX ingress deployment.
195249

196250
```
197-
$ helm delete aks-helloworld aks-helloworld-two nginx-ingress --namespace ingress-basic
251+
$ helm uninstall nginx-ingress --namespace ingress-basic
198252
199-
release "aks-helloworld" uninstalled
200-
release "aks-helloworld-two" uninstalled
201253
release "nginx-ingress" uninstalled
202254
```
203255

204-
Next, remove the Helm repo for the AKS hello world app:
256+
Next, remove the two sample applications:
205257

206258
```console
207-
helm repo remove azure-samples
259+
kubectl delete -f aks-helloworld-one.yaml --namespace ingress-basic
260+
kubectl delete -f aks-helloworld-two.yaml --namespace ingress-basic
208261
```
209262

210263
Remove the ingress route that directed traffic to the sample apps:

0 commit comments

Comments
 (0)