@@ -17,17 +17,16 @@ This page shows you how to set up a simple Ingress which routes requests to Serv
17
17
18
18
## {{% heading "prerequisites" %}}
19
19
20
+ This tutorial assumes that you are using ` minikube ` to run a local Kubernetes cluster.
21
+ Visit [ Install tools] ( /docs/tasks/tools/#minikube ) to learn how to install ` minikube ` .
22
+
20
23
{{< include "task-tutorial-prereqs.md" >}} {{< version-check >}}
21
24
If you are using an older Kubernetes version, switch to the documentation for that version.
22
25
23
- ### Create a Minikube cluster
26
+ ### Create a minikube cluster
24
27
25
- Using Katacoda
26
- : {{< kat-button >}}
28
+ If you haven't already set up a cluster locally, run ` minikube start ` to create a cluster.
27
29
28
- Locally
29
- : If you already [ installed Minikube] ( /docs/tasks/tools/#minikube )
30
- locally, run ` minikube start ` to create a cluster.
31
30
32
31
<!-- steps -->
33
32
@@ -41,10 +40,6 @@ Locally
41
40
42
41
1 . Verify that the NGINX Ingress controller is running
43
42
44
-
45
- {{< tabs name="tab_with_md" >}}
46
- {{% tab name="minikube v1.19 or later" %}}
47
-
48
43
``` shell
49
44
kubectl get pods -n ingress-nginx
50
45
```
@@ -61,35 +56,6 @@ Locally
61
56
ingress-nginx-admission-patch-rqp78 0/1 Completed 1 11m
62
57
ingress-nginx-controller-59b45fb494-26npt 1/1 Running 0 11m
63
58
```
64
- {{% /tab %}}
65
-
66
- {{% tab name="minikube v1.18.1 or earlier" %}}
67
-
68
- ``` shell
69
- kubectl get pods -n kube-system
70
- ```
71
-
72
- {{< note >}}
73
- It can take up to a minute before you see these pods running OK.
74
- {{< /note >}}
75
-
76
- The output is similar to:
77
-
78
- ``` none
79
- NAME READY STATUS RESTARTS AGE
80
- default-http-backend-59868b7dd6-xb8tq 1/1 Running 0 1m
81
- kube-addon-manager-minikube 1/1 Running 0 3m
82
- kube-dns-6dcb57bcc8-n4xd4 3/3 Running 0 2m
83
- kubernetes-dashboard-5498ccf677-b8p5h 1/1 Running 0 2m
84
- nginx-ingress-controller-5984b97644-rnkrg 1/1 Running 0 1m
85
- storage-provisioner 1/1 Running 0 2m
86
- ```
87
-
88
- Make sure that you see a Pod with a name that starts with ` nginx-ingress-controller- ` .
89
-
90
- {{% /tab %}}
91
-
92
- {{< /tabs >}}
93
59
94
60
## Deploy a hello, world app
95
61
@@ -142,12 +108,6 @@ Locally
142
108
http://172.17.0.15:31637
143
109
```
144
110
145
- {{< note >}}
146
- Katacoda environment only: at the top of the terminal panel, click the plus sign,
147
- and then click ** Select port to view on Host 1** . Enter the NodePort value,
148
- in this case ` 31637 ` , and then click ** Display Port** .
149
- {{< /note >}}
150
-
151
111
The output is similar to:
152
112
153
113
``` none
@@ -197,25 +157,11 @@ The following manifest defines an Ingress that sends traffic to your Service via
197
157
example-ingress <none> hello-world.info 172.17.0.15 80 38s
198
158
```
199
159
200
- 1 . Add the following line to the bottom of the ` /etc/hosts ` file on
201
- your computer (you will need administrator access):
202
-
203
- ``` none
204
- 172.17.0.15 hello-world.info
205
- ```
206
-
207
- {{< note >}}
208
- If you are running Minikube locally, use `minikube ip` to get the external IP.
209
- The IP address displayed within the ingress list will be the internal IP.
210
- {{< /note >}}
211
-
212
- After you make this change, your web browser sends requests for
213
- `hello-world.info` URLs to Minikube.
214
160
215
161
1 . Verify that the Ingress controller is directing traffic:
216
162
217
163
``` shell
218
- curl hello-world.info
164
+ curl --resolve " hello-world.info:80: $( minikube ip ) " -i http:// hello-world.info
219
165
```
220
166
221
167
You should see:
@@ -226,9 +172,27 @@ The following manifest defines an Ingress that sends traffic to your Service via
226
172
Hostname: web-55b8c6998d-8k564
227
173
```
228
174
229
- {{< note >}}
230
- If you are running Minikube locally, you can visit ` hello-world.info ` from your browser.
231
- {{< /note >}}
175
+ You can also visit ` hello-world.info ` from your browser.
176
+
177
+ * ** Optionally**
178
+ Look up the external IP address as reported by minikube:
179
+ ``` shell
180
+ minikube ip
181
+ ```
182
+
183
+ Add line similar to the following one to the bottom of the ` /etc/hosts` file on
184
+ your computer (you will need administrator access):
185
+
186
+ ` ` ` none
187
+ 172.17.0.15 hello-world.info
188
+ ` ` `
189
+
190
+ {{< note > }}
191
+ Change the IP address to match the output from ` minikube ip` .
192
+ {{< /note > }}
193
+
194
+ After you make this change, your web browser sends requests for
195
+ ` hello-world.info` URLs to Minikube.
232
196
233
197
# # Create a second Deployment
234
198
@@ -288,7 +252,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
288
252
1. Access the 1st version of the Hello World app.
289
253
290
254
` ` ` shell
291
- curl hello-world.info
255
+ curl --resolve " hello-world.info:80: $( minikube ip ) " -i http:// hello-world.info
292
256
` ` `
293
257
294
258
The output is similar to:
@@ -302,7 +266,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
302
266
1. Access the 2nd version of the Hello World app.
303
267
304
268
` ` ` shell
305
- curl hello-world.info/v2
269
+ curl --resolve " hello-world.info:80: $( minikube ip ) " -i http:// hello-world.info/v2
306
270
` ` `
307
271
308
272
The output is similar to:
@@ -314,7 +278,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
314
278
` ` `
315
279
316
280
{{< note > }}
317
- If you are running Minikube locally , you can visit ` hello-world.info ` and
281
+ If you did the optional step to update ` /etc/hosts ` , you can also visit ` hello-world.info` and
318
282
` hello-world.info/v2` from your browser.
319
283
{{< /note > }}
320
284
0 commit comments