Skip to content

Commit 9b130e8

Browse files
committed
[zh-cn]sync access-application-cluster/* debug/* access-authn-authz/*
Signed-off-by: xin.li <[email protected]>
1 parent 1856829 commit 9b130e8

13 files changed

+54
-48
lines changed

content/zh-cn/docs/reference/access-authn-authz/certificate-signing-requests.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ For example:
151151

152152
例如:
153153

154-
{{< codenew file="access/certificate-signing-request/clusterrole-create.yaml" >}}
154+
{{< code_sample file="access/certificate-signing-request/clusterrole-create.yaml" >}}
155155

156156
<!--
157157
To allow approving a CertificateSigningRequest:
@@ -177,7 +177,7 @@ For example:
177177

178178
例如:
179179

180-
{{< codenew file="access/certificate-signing-request/clusterrole-approve.yaml" >}}
180+
{{< code_sample file="access/certificate-signing-request/clusterrole-approve.yaml" >}}
181181

182182
<!--
183183
To allow signing a CertificateSigningRequest:
@@ -199,7 +199,7 @@ To allow signing a CertificateSigningRequest:
199199
resource(资源):`signers`
200200
resourceName:`<signerNameDomain>/<signerNamePath>``<signerNameDomain>/*`
201201

202-
{{< codenew file="access/certificate-signing-request/clusterrole-sign.yaml" >}}
202+
{{< code_sample file="access/certificate-signing-request/clusterrole-sign.yaml" >}}
203203

204204
<!--
205205
## Signers

content/zh-cn/docs/reference/access-authn-authz/rbac.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2303,7 +2303,7 @@ you can create the following ClusterRole:
23032303

23042304
如果你希望在新集群的聚合角色里保留此访问权限,你可以创建下面的 ClusterRole:
23052305

2306-
{{< codenew file="access/endpoints-aggregated.yaml" >}}
2306+
{{< code_sample file="access/endpoints-aggregated.yaml" >}}
23072307

23082308
<!--
23092309
## Upgrading from ABAC

content/zh-cn/docs/reference/access-authn-authz/service-accounts-admin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ Here is a sample manifest for such a Secret:
462462

463463
以下是此类 Secret 的示例清单:
464464

465-
{{< codenew file="secret/serviceaccount/mysecretname.yaml" >}}
465+
{{% code_sample file="secret/serviceaccount/mysecretname.yaml" %}}
466466

467467
<!--
468468
To create a Secret based on this example, run:

content/zh-cn/docs/reference/access-authn-authz/validating-admission-policy.md

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -115,24 +115,32 @@ The following is an example of a ValidatingAdmissionPolicy.
115115

116116
以下是一个 ValidatingAdmissionPolicy 的示例:
117117

118-
{{% codenew language="yaml" file="validatingadmissionpolicy/basic-example-policy.yaml" %}}
118+
{{% code_sample language="yaml" file="validatingadmissionpolicy/basic-example-policy.yaml" %}}
119119

120120
<!--
121121
`spec.validations` contains CEL expressions which use the [Common Expression Language (CEL)](https://github.com/google/cel-spec)
122122
to validate the request. If an expression evaluates to false, the validation check is enforced
123123
according to the `spec.failurePolicy` field.
124-
125-
To configure a validating admission policy for use in a cluster, a binding is required.
126-
The following is an example of a ValidatingAdmissionPolicyBinding.:
127124
-->
128125
`spec.validations` 包含使用[通用表达式语言 (CEL)](https://github.com/google/cel-spec)
129126
来验证请求的 CEL 表达式。
130127
如果表达式的计算结果为 false,则根据 `spec.failurePolicy` 字段强制执行验证检查处理。
131128

129+
{{< note >}}
130+
<!--
131+
You can quickly test CEL expressions in [CEL Playground](https://playcel.undistro.io).
132+
-->
133+
你可以在 [CEL Playground](https://playcel.undistro.io) 中快速验证 CEL 表达式。
134+
{{< /note >}}
135+
136+
<!--
137+
To configure a validating admission policy for use in a cluster, a binding is required.
138+
The following is an example of a ValidatingAdmissionPolicyBinding:
139+
-->
132140
要配置一个在某集群中使用的验证准入策略,需要一个绑定。
133141
以下是一个 ValidatingAdmissionPolicyBinding 的示例:
134142

135-
{{% codenew language="yaml" file="validatingadmissionpolicy/basic-example-binding.yaml" %}}
143+
{{% code_sample language="yaml" file="validatingadmissionpolicy/basic-example-binding.yaml" %}}
136144

137145
<!--
138146
When trying to create a deployment with replicas set not satisfying the validation expression, an
@@ -226,7 +234,7 @@ with parameter configuration.
226234

227235
如果需要参数配置,下面是一个带有参数配置的 ValidatingAdmissionPolicy 的例子:
228236

229-
{{% codenew language="yaml" file="validatingadmissionpolicy/policy-with-param.yaml" %}}
237+
{{% code_sample language="yaml" file="validatingadmissionpolicy/policy-with-param.yaml" %}}
230238

231239
<!--
232240
The `spec.paramKind` field of the ValidatingAdmissionPolicy specifies the kind of resources used
@@ -261,7 +269,7 @@ every resource request that matches the binding:
261269
要配置一个在某集群中使用的验证准入策略,需要创建绑定和参数资源。
262270
以下是 ValidatingAdmissionPolicyBinding **集群范围**参数的示例 - 相同的参数将用于验证与绑定匹配的每个资源请求:
263271

264-
{{% codenew language="yaml" file="validatingadmissionpolicy/binding-with-param.yaml" %}}
272+
{{% code_sample language="yaml" file="validatingadmissionpolicy/binding-with-param.yaml" %}}
265273

266274
<!--
267275
Notice this binding applies a parameter to the policy for all resources which
@@ -274,7 +282,7 @@ The parameter resource could be as following:
274282
-->
275283
参数资源可以如下:
276284

277-
{{% codenew language="yaml" file="validatingadmissionpolicy/replicalimit-param.yaml" %}}
285+
{{% code_sample language="yaml" file="validatingadmissionpolicy/replicalimit-param.yaml" %}}
278286

279287
<!--
280288
This policy parameter resource limits deployments to a max of 3 replicas.
@@ -285,7 +293,7 @@ to have a maxReplicas limit of 100, create another ValidatingAdmissionPolicyBind
285293
一个准入策略可以有多个绑定。
286294
要绑定所有的其他环境,限制 maxReplicas 为 100,请创建另一个 ValidatingAdmissionPolicyBinding:
287295

288-
{{% codenew language="yaml" file="validatingadmissionpolicy/binding-with-param-prod.yaml" %}}
296+
{{% code_sample language="yaml" file="validatingadmissionpolicy/binding-with-param-prod.yaml" %}}
289297

290298
<!--
291299
Notice this binding applies a different parameter to resources which
@@ -298,7 +306,7 @@ And have a parameter resource:
298306
-->
299307
并有一个参数资源:
300308

301-
{{% codenew language="yaml" file="validatingadmissionpolicy/replicalimit-param-prod.yaml" %}}
309+
{{% code_sample language="yaml" file="validatingadmissionpolicy/replicalimit-param-prod.yaml" %}}
302310

303311
<!--
304312
For each admission request, the API server evaluates CEL expressions of each
@@ -415,7 +423,7 @@ searches for parameters in that namespace.
415423
416424
作为 ValidatingAdmissionPolicy 及其 ValidatingAdmissionPolicyBinding 的作者,
417425
你可以选择指定其作用于集群范围还是某个命名空间。如果你为绑定的 `paramRef` 指定 `namespace`,
418-
则控制平面仅在该名字空间中搜索参数
426+
则控制平面仅在该命名空间中搜索参数
419427
420428
<!--
421429
However, if `namespace` is not specified in the ValidatingAdmissionPolicyBinding, the
@@ -504,7 +512,7 @@ Note that the `failurePolicy` is defined inside `ValidatingAdmissionPolicy`:
504512
505513
请注意,`failurePolicy` 是在 `ValidatingAdmissionPolicy` 中定义的:
506514
507-
{{% codenew language="yaml" file="validatingadmissionpolicy/failure-policy-ignore.yaml" %}}
515+
{{% code_sample language="yaml" file="validatingadmissionpolicy/failure-policy-ignore.yaml" %}}
508516
509517
<!--
510518
### Validation Expression
@@ -662,7 +670,7 @@ Here is an example illustrating a few different uses for match conditions:
662670
-->
663671
以下示例说明了匹配条件的几个不同用法:
664672
665-
{{% codenew file="access/validating-admission-policy-match-conditions.yaml" %}}
673+
{{% code_sample file="access/validating-admission-policy-match-conditions.yaml" %}}
666674
667675
<!--
668676
Match conditions have access to the same CEL variables as validation expressions.
@@ -698,7 +706,7 @@ For example, here is an admission policy with an audit annotation:
698706
699707
例如,以下是带有审计注解的准入策略:
700708
701-
{{% codenew file="access/validating-admission-policy-audit-annotation.yaml" %}}
709+
{{% code_sample file="access/validating-admission-policy-audit-annotation.yaml" %}}
702710
703711
<!--
704712
When an API request is validated with this admission policy, the resulting audit event will look like:
@@ -772,7 +780,7 @@ we can have the following validation:
772780
773781
例如,为了在策略引用参数时更好地告知用户拒绝原因,我们可以有以下验证:
774782
775-
{{% codenew file="access/deployment-replicas-policy.yaml" %}}
783+
{{% code_sample file="access/deployment-replicas-policy.yaml" %}}
776784
777785
<!--
778786
After creating a params object that limits the replicas to 3 and setting up the binding,
@@ -825,7 +833,7 @@ For example, given the following policy definition:
825833
826834
例如,给定以下策略定义:
827835
828-
{{% codenew language="yaml" file="validatingadmissionpolicy/typechecking.yaml" %}}
836+
{{% code_sample language="yaml" file="validatingadmissionpolicy/typechecking.yaml" %}}
829837
830838
<!--
831839
The status will yield the following information:
@@ -850,7 +858,7 @@ For example, the following policy definition
850858
如果在 `spec.matchConstraints` 中匹配了多个资源,则所有匹配的资源都将进行检查。
851859
例如,以下策略定义:
852860

853-
{{% codenew language="yaml" file="validatingadmissionpolicy/typechecking-multiple-match.yaml" %}}
861+
{{% code_sample language="yaml" file="validatingadmissionpolicy/typechecking-multiple-match.yaml" %}}
854862

855863
<!--
856864
will have multiple types and type checking result of each type in the warning message.
@@ -932,7 +940,7 @@ The following is a more complex example of enforcing that image repo names match
932940

933941
以下是强制镜像仓库名称与其命名空间中定义的环境相匹配的一个较复杂示例。
934942

935-
{{< codenew file="access/image-matches-namespace-environment.policy.yaml" >}}
943+
{{< code_sample file="access/image-matches-namespace-environment.policy.yaml" >}}
936944

937945
<!--
938946
With the policy bound to the namespace `default`, which is labeled `environment: prod`,

content/zh-cn/docs/tasks/access-application-cluster/communicate-containers-same-pod-shared-volume.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ for the Pod:
3838
在这个练习中,你会创建一个包含两个容器的 Pod。两个容器共享一个卷用于他们之间的通信。
3939
Pod 的配置文件如下:
4040

41-
{{% code file="pods/two-container-pod.yaml" %}}
41+
{{% code_sample file="pods/two-container-pod.yaml" %}}
4242

4343
<!--
4444
In the configuration file, you can see that the Pod has a Volume named
@@ -215,4 +215,3 @@ the shared Volume is lost.
215215
* 参考[在 Pod 中的容器之间共享进程命名空间](/zh-cn/docs/tasks/configure-pod-container/share-process-namespace/)
216216
* 参考 [Volume](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#volume-v1-core)
217217
* 参考 [Pod](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#pod-v1-core)
218-

content/zh-cn/docs/tasks/access-application-cluster/connecting-frontend-backend.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ file for the backend Deployment:
6565

6666
后端是一个简单的 hello 欢迎微服务应用。这是后端应用的 Deployment 配置文件:
6767

68-
{{% code file="service/access/backend-deployment.yaml" %}}
68+
{{% code_sample file="service/access/backend-deployment.yaml" %}}
6969

7070
<!--
7171
Create the backend Deployment:
@@ -145,7 +145,7 @@ First, explore the Service configuration file:
145145

146146
首先,浏览 Service 的配置文件:
147147

148-
{{% code file="service/access/backend-service.yaml" %}}
148+
{{% code_sample file="service/access/backend-service.yaml" %}}
149149

150150
<!--
151151
In the configuration file, you can see that the Service, named `hello` routes
@@ -197,7 +197,7 @@ to proxy requests to the `hello` backend Service. Here is the nginx configuratio
197197
前端 Deployment 中的 Pods 运行一个 nginx 镜像,这个已经配置好的镜像会将请求转发
198198
给后端的 `hello` Service。下面是 nginx 的配置文件:
199199

200-
{{% code file="service/access/frontend-nginx.conf" %}}
200+
{{% code_sample file="service/access/frontend-nginx.conf" %}}
201201

202202
<!--
203203
Similar to the backend, the frontend has a Deployment and a Service. An important
@@ -210,9 +210,9 @@ accessible from outside the cluster.
210210
重要区别是前端 Service 的配置文件包含了 `type: LoadBalancer`,也就是说,Service
211211
会使用你的云服务商的默认负载均衡设备,从而实现从集群外访问的目的。
212212

213-
{{% code file="service/access/frontend-service.yaml" %}}
213+
{{% code_sample file="service/access/frontend-service.yaml" %}}
214214

215-
{{% code file="service/access/frontend-deployment.yaml" %}}
215+
{{% code_sample file="service/access/frontend-deployment.yaml" %}}
216216

217217

218218
<!--
@@ -346,4 +346,4 @@ kubectl delete deployment frontend backend
346346
-->
347347
* 进一步了解 [Service](/zh-cn/docs/concepts/services-networking/service/)
348348
* 进一步了解 [ConfigMap](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/)
349-
* 进一步了解 [Service 和 Pods 的 DNS](/zh-cn/docs/concepts/services-networking/dns-pod-service/)
349+
* 进一步了解 [Service 和 Pod 的 DNS](/zh-cn/docs/concepts/services-networking/dns-pod-service/)

content/zh-cn/docs/tasks/access-application-cluster/ingress-minikube.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ The following manifest defines an Ingress that sends traffic to your Service via
207207

208208
1. 根据下面的 YAML 创建文件 `example-ingress.yaml`
209209

210-
{{% code file="service/networking/example-ingress.yaml" %}}
210+
{{% code_sample file="service/networking/example-ingress.yaml" %}}
211211

212212
<!--
213213
1. Create the Ingress object by running the following command:
@@ -456,4 +456,4 @@ The following manifest defines an Ingress that sends traffic to your Service via
456456
-->
457457
* 进一步了解 [Ingress](/zh-cn/docs/concepts/services-networking/ingress/)
458458
* 进一步了解 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers/)
459-
* 进一步了解[服务](/zh-cn/docs/concepts/services-networking/service/)
459+
* 进一步了解 [Service](/zh-cn/docs/concepts/services-networking/service/)

content/zh-cn/docs/tasks/access-application-cluster/service-access-application-cluster.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Here is the configuration file for the application Deployment:
4545

4646
这是应用程序部署的配置文件:
4747

48-
{{% code file="service/access/hello-application.yaml" %}}
48+
{{% code_sample file="service/access/hello-application.yaml" %}}
4949

5050
<!--
5151
1. Run a Hello World application in your cluster:

content/zh-cn/docs/tasks/debug/debug-application/debug-running-pod.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ For this example we'll use a Deployment to create two pods, similar to the earli
4343
-->
4444
与之前的例子类似,我们使用一个 Deployment 来创建两个 Pod。
4545

46-
{{< codenew file="application/nginx-with-request.yaml" >}}
46+
{{% code_sample file="application/nginx-with-request.yaml" %}}
4747

4848
<!--
4949
Create deployment by running following command:

content/zh-cn/docs/tasks/debug/debug-application/determine-reason-pod-failure.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ The manifest for that Pod specifies a command that runs when the container start
4747
在本练习中,你将创建运行一个容器的 Pod。
4848
配置文件指定在容器启动时要运行的命令。
4949

50-
{{< codenew file="debug/termination.yaml" >}}
50+
{{% code_sample file="debug/termination.yaml" %}}
5151

5252
<!--
5353
1. Create a Pod based on the YAML configuration file:
@@ -210,4 +210,3 @@ is empty and the container exited with an error. The log output is limited to
210210
资源的 `terminationMessagePath` 字段。
211211
* 了解[检索日志](/zh-cn/docs/concepts/cluster-administration/logging/)。
212212
* 了解 [Go 模板](https://pkg.go.dev/text/template)。
213-

content/zh-cn/docs/tasks/debug/debug-application/get-shell-running-container.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ runs the nginx image. Here is the configuration file for the Pod:
2828
-->
2929
在本练习中,你将创建包含一个容器的 Pod。容器运行 nginx 镜像。下面是 Pod 的配置文件:
3030

31-
{{< codenew file="application/shell-demo.yaml" >}}
31+
{{% code_sample file="application/shell-demo.yaml" %}}
3232

3333
<!--
3434
Create the Pod:

content/zh-cn/docs/tasks/debug/debug-cluster/audit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Below is an example audit policy file:
148148

149149
以下是一个审计策略文件的示例:
150150

151-
{{< codenew file="audit/audit-policy.yaml" >}}
151+
{{% code_sample file="audit/audit-policy.yaml" %}}
152152

153153
<!--
154154
You can use a minimal audit policy file to log all requests at the `Metadata` level:

content/zh-cn/docs/tasks/debug/debug-cluster/monitor-node-health.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To learn how to install and use Node Problem Detector, see
2424
[Node Problem Detector project documentation](https://github.com/kubernetes/node-problem-detector).
2525
-->
2626

27-
*节点问题检测器(Node Problem Detector)* 是一个守护程序,用于监视和报告节点的健康状况。
27+
**节点问题检测器(Node Problem Detector)** 是一个守护程序,用于监视和报告节点的健康状况。
2828
你可以将节点问题探测器以 `DaemonSet` 或独立守护程序运行。
2929
节点问题检测器从各种守护进程收集节点问题,并以节点
3030
[Condition](/zh-cn/docs/concepts/architecture/nodes/#condition)
@@ -77,7 +77,7 @@ to detect customized node problems. For example:
7777
<!--
7878
1. Create a Node Problem Detector configuration similar to `node-problem-detector.yaml`:
7979
80-
{{< codenew file="debug/node-problem-detector.yaml" >}}
80+
{{% code_sample file="debug/node-problem-detector.yaml" %}}
8181
8282
{{< note >}}
8383
You should verify that the system log directory is right for your operating system distribution.
@@ -90,7 +90,7 @@ to detect customized node problems. For example:
9090
```
9191
-->
9292
1. 创建类似于 `node-strought-detector.yaml` 的节点问题检测器配置:
93-
{{< codenew file="debug/node-problem-detector.yaml" >}}
93+
{{% code_sample file="debug/node-problem-detector.yaml" %}}
9494

9595
{{< note >}}
9696
你应该检查系统日志目录是否适用于操作系统发行版本。
@@ -148,7 +148,7 @@ to overwrite the configuration:
148148
149149
1. Change the `node-problem-detector.yaml` to use the `ConfigMap`:
150150
151-
{{< codenew file="debug/node-problem-detector-configmap.yaml" >}}
151+
{{% code_sample file="debug/node-problem-detector-configmap.yaml" %}}
152152
153153
1. Recreate the Node Problem Detector with the new configuration file:
154154
@@ -165,9 +165,9 @@ to overwrite the configuration:
165165
kubectl create configmap node-problem-detector-config --from-file=config/
166166
```
167167

168-
1. 更改 `node-problem-detector.yaml` 以使用 ConfigMap:
168+
1. 更改 `node-problem-detector.yaml` 以使用 ConfigMap
169169

170-
{{< codenew file="debug/node-problem-detector-configmap.yaml" >}}
170+
{{% code_sample file="debug/node-problem-detector-configmap.yaml" %}}
171171

172172
1. 使用新的配置文件重新创建节点问题检测器:
173173

@@ -303,13 +303,13 @@ The following exporters are supported:
303303
导出器(Exporter)向特定后端报告节点问题和/或指标。
304304
支持下列导出器:
305305

306-
- **Kubernetes exporter**: 此导出器向 Kubernetes API 服务器报告节点问题。
306+
- **Kubernetes exporter**此导出器向 Kubernetes API 服务器报告节点问题。
307307
临时问题报告为事件,永久性问题报告为节点状况。
308308

309-
- **Prometheus exporter**: 此导出器在本地将节点问题和指标报告为 Prometheus(或 OpenMetrics)指标。
309+
- **Prometheus exporter**此导出器在本地将节点问题和指标报告为 Prometheus(或 OpenMetrics)指标。
310310
你可以使用命令行参数指定导出器的 IP 地址和端口。
311311

312-
- **Stackdriver exporter**: 此导出器向 Stackdriver Monitoring API 报告节点问题和指标。
312+
- **Stackdriver exporter**此导出器向 Stackdriver Monitoring API 报告节点问题和指标。
313313
可以使用[配置文件](https://github.com/kubernetes/node-problem-detector/blob/v0.8.12/config/exporter/stackdriver-exporter.json)自定义导出行为。
314314

315315
<!-- discussion -->

0 commit comments

Comments
 (0)