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
Let's see if you can use the NGINX webpage on the back-end pod again. Create another test pod and attach a terminal session:
296
302
297
303
```console
298
-
kubectl run --rm -it --image=mcr.microsoft.com/aks/fundamental/base-ubuntu:v0.0.11 network-policy --namespace development
304
+
kubectl run --rm -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0 network-policy --namespace development
305
+
```
306
+
307
+
Install `wget`:
308
+
309
+
```console
310
+
apt-get update && apt-get install -y wget
299
311
```
300
312
301
313
At the shell prompt, use `wget` to see if you can access the default NGINX webpage. This time, set a timeout value to *2* seconds. The network policy now blocks all inbound traffic, so the page can't be loaded, as shown in the following example:
Schedule a pod that is labeled as *app=webapp,role=frontend* and attach a terminal session:
353
365
354
366
```console
355
-
kubectl run --rm -it frontend --image=mcr.microsoft.com/aks/fundamental/base-ubuntu:v0.0.11 --labels app=webapp,role=frontend --namespace development
367
+
kubectl run --rm -it frontend --image=mcr.microsoft.com/dotnet/runtime-deps:6.0 --labels app=webapp,role=frontend --namespace development
368
+
```
369
+
370
+
Install `wget`:
371
+
372
+
```console
373
+
apt-get update && apt-get install -y wget
356
374
```
357
375
358
376
At the shell prompt, use `wget` to see if you can access the default NGINX webpage:
@@ -382,7 +400,13 @@ exit
382
400
The network policy allows traffic from pods labeled *app: webapp,role: frontend*, but should deny all other traffic. Let's test to see whether another pod without those labels can access the back-end NGINX pod. Create another test pod and attach a terminal session:
383
401
384
402
```console
385
-
kubectl run --rm -it --image=mcr.microsoft.com/aks/fundamental/base-ubuntu:v0.0.11 network-policy --namespace development
403
+
kubectl run --rm -it --image=mcr.microsoft.com/dotnet/runtime-deps:6.0 network-policy --namespace development
404
+
```
405
+
406
+
Install `wget`:
407
+
408
+
```console
409
+
apt-get update && apt-get install -y wget
386
410
```
387
411
388
412
At the shell prompt, use `wget` to see if you can access the default NGINX webpage. The network policy blocks the inbound traffic, so the page can't be loaded, as shown in the following example:
0 commit comments