Merge pull request #33012 from my-git9/declare-network-policy2
[zh] Update declare-network-policy.mdpull/33015/head
commit
a8b1be1d5c
|
@ -108,7 +108,7 @@ You should be able to access the new `nginx` service from other Pods. To access
|
||||||
要从 default 命名空间中的其它s Pod 来访问该服务。可以启动一个 busybox 容器:
|
要从 default 命名空间中的其它s Pod 来访问该服务。可以启动一个 busybox 容器:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl run busybox --rm -ti --image=busybox /bin/sh
|
kubectl run busybox --rm -ti --image=busybox:1.28 /bin/sh
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -180,7 +180,7 @@ When you attempt to access the `nginx` Service from a Pod without the correct la
|
||||||
如果你尝试从没有设定正确标签的 Pod 中去访问 `nginx` 服务,请求将会超时:
|
如果你尝试从没有设定正确标签的 Pod 中去访问 `nginx` 服务,请求将会超时:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl run busybox --rm -ti --image=busybox -- /bin/sh
|
kubectl run busybox --rm -ti --image=busybox:1.28 -- /bin/sh
|
||||||
```
|
```
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
@ -207,7 +207,7 @@ You can create a Pod with the correct labels to see that the request is allowed:
|
||||||
创建一个拥有正确标签的 Pod,你将看到请求是被允许的:
|
创建一个拥有正确标签的 Pod,你将看到请求是被允许的:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
kubectl run busybox --rm -ti --labels="access=true" --image=busybox -- /bin/sh
|
kubectl run busybox --rm -ti --labels="access=true" --image=busybox:1.28 -- /bin/sh
|
||||||
```
|
```
|
||||||
<!--
|
<!--
|
||||||
In your shell, run the command:
|
In your shell, run the command:
|
||||||
|
|
Loading…
Reference in New Issue