Skip to content

Commit fcbf89b

Browse files
committed
[zh]Sync /tutorials/security/ns-level-pss.md
1 parent de922ae commit fcbf89b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

content/zh-cn/docs/tutorials/security/ns-level-pss.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@ Install the following on your workstation:
6161
```shell
6262
kind create cluster --name psa-ns-level --image kindest/node:v1.23.0
6363
```
64+
6465
<!-- The output is similar to this: -->
6566
输出类似于:
67+
6668
```
6769
Creating cluster "psa-ns-level" ...
6870
✓ Ensuring node image (kindest/node:v1.23.0) 🖼
@@ -81,11 +83,14 @@ Install the following on your workstation:
8183

8284
<!-- 1. Set the kubectl context to the new cluster: -->
8385
1. 将 kubectl 上下文设置为新集群:
86+
8487
```shell
8588
kubectl cluster-info --context kind-psa-ns-level
8689
```
87-
<!-- The output is similar to this: -->
90+
91+
<!-- The output is similar to this: -->
8892
输出类似于:
93+
8994
```
9095
Kubernetes control plane is running at https://127.0.0.1:50996
9196
CoreDNS is running at https://127.0.0.1:50996/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
@@ -158,7 +163,7 @@ namespace/example created
158163
-->
159164
## 验证 Pod 安全标准 {#verify-the-pod-security-standards}
160165

161-
1.`example` 名字空间中创建一个最小的 pod
166+
1.`example` 名字空间中创建一个最小的 Pod
162167

163168
```shell
164169
cat <<EOF > /tmp/pss/nginx-pod.yaml
@@ -179,11 +184,14 @@ namespace/example created
179184
2. Apply the pod spec to the cluster in `example` namespace:
180185
-->
181186
1. 将 Pod 规约应用到集群中的 `example` 名字空间中:
187+
182188
```shell
183189
kubectl apply -n example -f /tmp/pss/nginx-pod.yaml
184190
```
191+
185192
<!-- The output is similar to this: -->
186193
输出类似于:
194+
187195
```
188196
Warning: would violate PodSecurity "restricted:latest": allowPrivilegeEscalation != false (container "nginx" must set securityContext allowPrivilegeEscalation=false), unrestricted capabilities (container "nginx" must set securityContext.capabilities.drop=["ALL"]), runAsNonRoot != true (pod or container "nginx" must set securityContext.runAsNonRoot=true), seccompProfile (pod or container "nginx" must set securityContext seccompProfile.type to "RuntimeDefault" or "Localhost")
189197
pod/nginx created
@@ -216,11 +224,11 @@ with no warnings.
216224
<!--
217225
## Clean up
218226
219-
Run `kind delete cluster -name psa-ns-level` to delete the cluster created.
227+
Run `kind delete cluster --name psa-ns-level` to delete the cluster created.
220228
-->
221229
## 清理 {#clean-up}
222230
223-
运行 `kind delete cluster -name psa-ns-level` 删除创建的集群。
231+
运行 `kind delete cluster --name psa-ns-level` 删除创建的集群。
224232
225233
## {{% heading "whatsnext" %}}
226234

0 commit comments

Comments
 (0)