diff --git a/content/zh-cn/docs/reference/access-authn-authz/certificate-signing-requests.md b/content/zh-cn/docs/reference/access-authn-authz/certificate-signing-requests.md index 3f63801fd4..6c6282cb53 100644 --- a/content/zh-cn/docs/reference/access-authn-authz/certificate-signing-requests.md +++ b/content/zh-cn/docs/reference/access-authn-authz/certificate-signing-requests.md @@ -151,7 +151,7 @@ For example: 例如: -{{< codenew file="access/certificate-signing-request/clusterrole-create.yaml" >}} +{{< code_sample file="access/certificate-signing-request/clusterrole-create.yaml" >}} `spec.validations` 包含使用[通用表达式语言 (CEL)](https://github.com/google/cel-spec) 来验证请求的 CEL 表达式。 如果表达式的计算结果为 false,则根据 `spec.failurePolicy` 字段强制执行验证检查处理。 +{{< note >}} + +你可以在 [CEL Playground](https://playcel.undistro.io) 中快速验证 CEL 表达式。 +{{< /note >}} + + 要配置一个在某集群中使用的验证准入策略,需要一个绑定。 以下是一个 ValidatingAdmissionPolicyBinding 的示例: -{{% codenew language="yaml" file="validatingadmissionpolicy/basic-example-binding.yaml" %}} +{{% code_sample language="yaml" file="validatingadmissionpolicy/basic-example-binding.yaml" %}} 参数资源可以如下: -{{% codenew language="yaml" file="validatingadmissionpolicy/replicalimit-param.yaml" %}} +{{% code_sample language="yaml" file="validatingadmissionpolicy/replicalimit-param.yaml" %}} 并有一个参数资源: -{{% codenew language="yaml" file="validatingadmissionpolicy/replicalimit-param-prod.yaml" %}} +{{% code_sample language="yaml" file="validatingadmissionpolicy/replicalimit-param-prod.yaml" %}} 以下示例说明了匹配条件的几个不同用法: -{{% codenew file="access/validating-admission-policy-match-conditions.yaml" %}} +{{% code_sample file="access/validating-admission-policy-match-conditions.yaml" %}} * 进一步了解 [Service](/zh-cn/docs/concepts/services-networking/service/) * 进一步了解 [ConfigMap](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/) -* 进一步了解 [Service 和 Pods 的 DNS](/zh-cn/docs/concepts/services-networking/dns-pod-service/) +* 进一步了解 [Service 和 Pod 的 DNS](/zh-cn/docs/concepts/services-networking/dns-pod-service/) diff --git a/content/zh-cn/docs/tasks/access-application-cluster/ingress-minikube.md b/content/zh-cn/docs/tasks/access-application-cluster/ingress-minikube.md index c6a5a55a23..b7acce5195 100644 --- a/content/zh-cn/docs/tasks/access-application-cluster/ingress-minikube.md +++ b/content/zh-cn/docs/tasks/access-application-cluster/ingress-minikube.md @@ -207,7 +207,7 @@ The following manifest defines an Ingress that sends traffic to your Service via 1. 根据下面的 YAML 创建文件 `example-ingress.yaml`: - {{% code file="service/networking/example-ingress.yaml" %}} + {{% code_sample file="service/networking/example-ingress.yaml" %}} * 进一步了解 [Ingress](/zh-cn/docs/concepts/services-networking/ingress/) * 进一步了解 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers/) -* 进一步了解[服务](/zh-cn/docs/concepts/services-networking/service/) +* 进一步了解 [Service](/zh-cn/docs/concepts/services-networking/service/) diff --git a/content/zh-cn/docs/tasks/access-application-cluster/service-access-application-cluster.md b/content/zh-cn/docs/tasks/access-application-cluster/service-access-application-cluster.md index 6e8ca1d71a..141969a8d6 100644 --- a/content/zh-cn/docs/tasks/access-application-cluster/service-access-application-cluster.md +++ b/content/zh-cn/docs/tasks/access-application-cluster/service-access-application-cluster.md @@ -45,7 +45,7 @@ Here is the configuration file for the application Deployment: 这是应用程序部署的配置文件: -{{% code file="service/access/hello-application.yaml" %}} +{{% code_sample file="service/access/hello-application.yaml" %}} 与之前的例子类似,我们使用一个 Deployment 来创建两个 Pod。 -{{< codenew file="application/nginx-with-request.yaml" >}} +{{% code_sample file="application/nginx-with-request.yaml" %}} 在本练习中,你将创建包含一个容器的 Pod。容器运行 nginx 镜像。下面是 Pod 的配置文件: -{{< codenew file="application/shell-demo.yaml" >}} +{{% code_sample file="application/shell-demo.yaml" %}} -*节点问题检测器(Node Problem Detector)* 是一个守护程序,用于监视和报告节点的健康状况。 +**节点问题检测器(Node Problem Detector)** 是一个守护程序,用于监视和报告节点的健康状况。 你可以将节点问题探测器以 `DaemonSet` 或独立守护程序运行。 节点问题检测器从各种守护进程收集节点问题,并以节点 [Condition](/zh-cn/docs/concepts/architecture/nodes/#condition) 和 @@ -77,7 +77,7 @@ to detect customized node problems. For example: 1. 创建类似于 `node-strought-detector.yaml` 的节点问题检测器配置: - {{< codenew file="debug/node-problem-detector.yaml" >}} + {{% code_sample file="debug/node-problem-detector.yaml" %}} {{< note >}} 你应该检查系统日志目录是否适用于操作系统发行版本。 @@ -148,7 +148,7 @@ to overwrite the configuration: 1. Change the `node-problem-detector.yaml` to use the `ConfigMap`: - {{< codenew file="debug/node-problem-detector-configmap.yaml" >}} + {{% code_sample file="debug/node-problem-detector-configmap.yaml" %}} 1. Recreate the Node Problem Detector with the new configuration file: @@ -165,9 +165,9 @@ to overwrite the configuration: kubectl create configmap node-problem-detector-config --from-file=config/ ``` -1. 更改 `node-problem-detector.yaml` 以使用 ConfigMap: +1. 更改 `node-problem-detector.yaml` 以使用 ConfigMap: - {{< codenew file="debug/node-problem-detector-configmap.yaml" >}} + {{% code_sample file="debug/node-problem-detector-configmap.yaml" %}} 1. 使用新的配置文件重新创建节点问题检测器: @@ -303,13 +303,13 @@ The following exporters are supported: 导出器(Exporter)向特定后端报告节点问题和/或指标。 支持下列导出器: -- **Kubernetes exporter**: 此导出器向 Kubernetes API 服务器报告节点问题。 +- **Kubernetes exporter**:此导出器向 Kubernetes API 服务器报告节点问题。 临时问题报告为事件,永久性问题报告为节点状况。 -- **Prometheus exporter**: 此导出器在本地将节点问题和指标报告为 Prometheus(或 OpenMetrics)指标。 +- **Prometheus exporter**:此导出器在本地将节点问题和指标报告为 Prometheus(或 OpenMetrics)指标。 你可以使用命令行参数指定导出器的 IP 地址和端口。 -- **Stackdriver exporter**: 此导出器向 Stackdriver Monitoring API 报告节点问题和指标。 +- **Stackdriver exporter**:此导出器向 Stackdriver Monitoring API 报告节点问题和指标。 可以使用[配置文件](https://github.com/kubernetes/node-problem-detector/blob/v0.8.12/config/exporter/stackdriver-exporter.json)自定义导出行为。