Skip to content

Commit dffde5d

Browse files
committed
[zh-cn]sync system-metrics logging device-plugins ingress network-policies
Signed-off-by: xin.li <[email protected]>
1 parent 1856829 commit dffde5d

File tree

5 files changed

+31
-76
lines changed

5 files changed

+31
-76
lines changed

content/zh-cn/docs/concepts/cluster-administration/logging.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Kubernetes 从正在运行的 Pod 中捕捉每个容器的日志。
6969

7070
此示例使用带有一个容器的 `Pod` 的清单,该容器每秒将文本写入标准输出一次。
7171

72-
{{% code file="debug/counter-pod.yaml" %}}
72+
{{% code_sample file="debug/counter-pod.yaml" %}}
7373

7474
<!--
7575
To run this pod, use the following command:
@@ -463,7 +463,7 @@ manifest for the Pod:
463463
例如,某 Pod 中运行一个容器,且该容器使用两个不同的格式写入到两个不同的日志文件。
464464
下面是这个 Pod 的清单:
465465

466-
{{% code file="admin/logging/two-files-counter-pod.yaml" %}}
466+
{{% code_sample file="admin/logging/two-files-counter-pod.yaml" %}}
467467

468468
<!--
469469
It is not recommended to write log entries with different formats to the same log
@@ -481,7 +481,7 @@ Here's a manifest for a pod that has two sidecar containers:
481481
-->
482482
下面是运行两个边车容器的 Pod 的清单:
483483

484-
{{% code file="admin/logging/two-files-counter-pod-streaming-sidecar.yaml" %}}
484+
{{% code_sample file="admin/logging/two-files-counter-pod-streaming-sidecar.yaml" %}}
485485

486486
<!--
487487
Now when you run this pod, you can access each log stream separately by
@@ -619,7 +619,7 @@ to configure fluentd.
619619
第一个文件包含用来配置 fluentd 的
620620
[ConfigMap](/zh-cn/docs/tasks/configure-pod-container/configure-pod-configmap/)
621621

622-
{{% code file="admin/logging/fluentd-sidecar-config.yaml" %}}
622+
{{% code_sample file="admin/logging/fluentd-sidecar-config.yaml" %}}
623623

624624
{{< note >}}
625625
<!--
@@ -636,7 +636,7 @@ The pod mounts a volume where fluentd can pick up its configuration data.
636636
第二个清单描述了一个运行 fluentd 边车容器的 Pod。
637637
该 Pod 挂载一个卷,flutend 可以从这个卷上拣选其配置数据。
638638

639-
{{% code file="admin/logging/two-files-counter-pod-agent-sidecar.yaml" %}}
639+
{{% code_sample file="admin/logging/two-files-counter-pod-agent-sidecar.yaml" %}}
640640

641641
<!--
642642
### Exposing logs directly from the application

content/zh-cn/docs/concepts/cluster-administration/system-metrics.md

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -204,35 +204,6 @@ to remove this metric dependency before upgrading to `1.14`
204204
如果你要从版本 `1.12` 升级到 `1.13`,但仍依赖于 `1.12` 中弃用的指标 `A`,则应通过命令行设置隐藏指标:
205205
`--show-hidden-metrics=1.12`,并记住在升级到 `1.14` 版本之前删除此指标依赖项。
206206

207-
<!--
208-
## Disable accelerator metrics
209-
210-
The kubelet collects accelerator metrics through cAdvisor. To collect these metrics, for
211-
accelerators like NVIDIA GPUs, kubelet held an open handle on the driver. This meant that in order
212-
to perform infrastructure changes (for example, updating the driver), a cluster administrator
213-
needed to stop the kubelet agent.
214-
215-
The responsibility for collecting accelerator metrics now belongs to the vendor rather than the
216-
kubelet. Vendors must provide a container that collects metrics and exposes them to the metrics
217-
service (for example, Prometheus).
218-
219-
The [`DisableAcceleratorUsageMetrics` feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
220-
disables metrics collected by the kubelet, with a
221-
[timeline for enabling this feature by default](https://github.com/kubernetes/enhancements/tree/411e51027db842355bd489691af897afc1a41a5e/keps/sig-node/1867-disable-accelerator-usage-metrics#graduation-criteria).
222-
-->
223-
## 禁用加速器指标 {#disable-accelerator-metrics}
224-
225-
kubelet 通过 cAdvisor 收集加速器指标。为了收集这些指标,对于 NVIDIA GPU 之类的加速器,
226-
kubelet 在驱动程序上保持打开状态。这意味着为了执行基础结构更改(例如更新驱动程序),
227-
集群管理员需要停止 kubelet 代理。
228-
229-
现在,收集加速器指标的责任属于供应商,而不是 kubelet。供应商必须提供一个收集指标的容器,
230-
并将其公开给指标服务(例如 Prometheus)。
231-
232-
[`DisableAcceleratorUsageMetrics` 特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
233-
禁止由 kubelet 收集的指标。
234-
关于[何时会在默认情况下启用此功能也有一定规划](https://github.com/kubernetes/enhancements/tree/411e51027db842355bd489691af897afc1a41a5e/keps/sig-node/1867-disable-accelerator-usage-metrics#graduation-criteria)
235-
236207
<!--
237208
## Component metrics
238209

content/zh-cn/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,17 @@ weight: 20
1818
{{< feature-state for_k8s_version="v1.26" state="stable" >}}
1919

2020
<!--
21-
Kubernetes provides a [device plugin framework](https://git.k8s.io/design-proposals-archive/resource-management/device-plugin.md)
22-
that you can use to advertise system hardware resources to the
23-
{{< glossary_tooltip term_id="kubelet" >}}.
21+
Kubernetes provides a device plugin framework that you can use to advertise system hardware
22+
resources to the {{< glossary_tooltip term_id="kubelet" >}}.
2423
2524
Instead of customizing the code for Kubernetes itself, vendors can implement a
2625
device plugin that you deploy either manually or as a {{< glossary_tooltip term_id="daemonset" >}}.
2726
The targeted devices include GPUs, high-performance NICs, FPGAs, InfiniBand adapters,
2827
and other similar computing resources that may require vendor specific initialization
2928
and setup.
3029
-->
31-
Kubernetes 提供了一个
32-
[设备插件框架](https://git.k8s.io/design-proposals-archive/resource-management/device-plugin.md)
33-
你可以用它来将系统硬件资源发布到 {{< glossary_tooltip term_id="kubelet" >}}。
30+
Kubernetes 提供了一个设备插件框架,你可以用它来将系统硬件资源发布到
31+
{{< glossary_tooltip term_id="kubelet" >}}。
3432

3533
供应商可以实现设备插件,由你手动部署或作为 {{< glossary_tooltip term_id="daemonset" >}}
3634
来部署,而不必定制 Kubernetes 本身的代码。目标设备包括 GPU、高性能 NIC、FPGA、
@@ -454,7 +452,7 @@ this feature `kubelet` must be started with the following flags:
454452
要启用此特性,必须使用以下标志启动 `kubelet`
455453

456454
```
457-
--feature-gates=DynamicResourceAllocation=true,KubeletPodResourcesDynamiceResources=true
455+
--feature-gates=DynamicResourceAllocation=true,KubeletPodResourcesDynamicResources=true
458456
```
459457

460458
<!--
@@ -715,15 +713,6 @@ will continue working.
715713

716714
{{< /note >}}
717715

718-
<!--
719-
Support for the `PodResourcesLister service` requires `KubeletPodResources`
720-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) to be enabled.
721-
It is enabled by default starting with Kubernetes 1.15 and is v1 since Kubernetes 1.20.
722-
-->
723-
对 “PodResourcesLister 服务”的支持要求启用 `KubeletPodResources`
724-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)
725-
从 Kubernetes 1.15 开始默认启用,自从 Kubernetes 1.20 开始为 v1。
726-
727716
<!--
728717
### `Get` gRPC endpoint {#grpc-endpoint-get}
729718
-->
@@ -774,7 +763,7 @@ ensure your kubelet services are started with the following flags:
774763
要启用此特性,你必须确保使用以下标志启动 kubelet 服务:
775764

776765
```
777-
--feature-gates=KubeletPodResourcesGet=true,DynamicResourceAllocation=true,KubeletPodResourcesDynamiceResources=true
766+
--feature-gates=KubeletPodResourcesGet=true,DynamicResourceAllocation=true,KubeletPodResourcesDynamicResources=true
778767
```
779768

780769
<!--
@@ -842,6 +831,7 @@ pluginapi.Device{ID: "25102017", Health: pluginapi.Healthy, Topology:&pluginapi.
842831
Here are some examples of device plugin implementations:
843832
844833
* The [AMD GPU device plugin](https://github.com/RadeonOpenCompute/k8s-device-plugin)
834+
* The [generic device plugin](https://github.com/squat/generic-device-plugin) for generic Linux devices and USB devices
845835
* The [Intel device plugins](https://github.com/intel/intel-device-plugins-for-kubernetes) for
846836
Intel GPU, FPGA, QAT, VPU, SGX, DSA, DLB and IAA devices
847837
* The [KubeVirt device plugins](https://github.com/kubevirt/kubernetes-device-plugins) for
@@ -856,6 +846,7 @@ Here are some examples of device plugin implementations:
856846
下面是一些设备插件实现的示例:
857847

858848
* [AMD GPU 设备插件](https://github.com/RadeonOpenCompute/k8s-device-plugin)
849+
* 适用于通用 Linux 设备和 USB 设备的[通用设备插件](https://github.com/squat/generic-device-plugin)
859850
* [Intel 设备插件](https://github.com/intel/intel-device-plugins-for-kubernetes)支持
860851
Intel GPU、FPGA、QAT、VPU、SGX、DSA、DLB 和 IAA 设备
861852
* [KubeVirt 设备插件](https://github.com/kubevirt/kubernetes-device-plugins) 用于硬件辅助的虚拟化

content/zh-cn/docs/concepts/services-networking/ingress.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ A minimal Ingress resource example:
148148

149149
一个最小的 Ingress 资源示例:
150150

151-
{{% code file="service/networking/minimal-ingress.yaml" %}}
151+
{{% code_sample file="service/networking/minimal-ingress.yaml" %}}
152152

153153
<!--
154154
An Ingress needs `apiVersion`, `kind`, `metadata` and `spec` fields.
@@ -284,7 +284,7 @@ with static assets.
284284
`Resource` 后端与 Service 后端是互斥的,在二者均被设置时会无法通过合法性检查。
285285
`Resource` 后端的一种常见用法是将所有入站数据导向保存静态资产的对象存储后端。
286286

287-
{{% code file="service/networking/ingress-resource-backend.yaml" %}}
287+
{{% code_sample file="service/networking/ingress-resource-backend.yaml" %}}
288288

289289
<!--
290290
After creating the Ingress above, you can view it with the following command:
@@ -442,7 +442,7 @@ equal to the suffix of the wildcard rule.
442442
| `*.foo.com` | `baz.bar.foo.com` | 不匹配,通配符仅覆盖了一个 DNS 标签 |
443443
| `*.foo.com` | `foo.com` | 不匹配,通配符仅覆盖了一个 DNS 标签 |
444444

445-
{{% code file="service/networking/ingress-wildcard-host.yaml" %}}
445+
{{% code_sample file="service/networking/ingress-wildcard-host.yaml" %}}
446446

447447
<!--
448448
## Ingress class
@@ -458,7 +458,7 @@ Ingress 可以由不同的控制器实现,通常使用不同的配置。
458458
每个 Ingress 应当指定一个类,也就是一个对 IngressClass 资源的引用。
459459
IngressClass 资源包含额外的配置,其中包括应当实现该类的控制器名称。
460460

461-
{{% code file="service/networking/external-lb.yaml" %}}
461+
{{% code_sample file="service/networking/external-lb.yaml" %}}
462462

463463
<!--
464464
The `.spec.parameters` field of an IngressClass lets you reference another
@@ -667,7 +667,7 @@ default `IngressClass`:
667667
不过仍然[推荐](https://kubernetes.github.io/ingress-nginx/#i-have-only-one-instance-of-the-ingresss-nginx-controller-in-my-cluster-what-should-i-do)
668668
设置默认的 `IngressClass`。
669669

670-
{{% code file="service/networking/default-ingressclass.yaml" %}}
670+
{{% code_sample file="service/networking/default-ingressclass.yaml" %}}
671671

672672
<!--
673673
## Types of Ingress
@@ -685,7 +685,7 @@ There are existing Kubernetes concepts that allow you to expose a single Service
685685
现有的 Kubernetes 概念允许你暴露单个 Service(参见[替代方案](#alternatives))。
686686
你也可以使用 Ingress 并设置无规则的**默认后端**来完成这类操作。
687687

688-
{{% code file="service/networking/test-ingress.yaml" %}}
688+
{{% code_sample file="service/networking/test-ingress.yaml" %}}
689689

690690
<!--
691691
If you create it using `kubectl apply -f` you should be able to view the state
@@ -736,7 +736,7 @@ It would require an Ingress such as:
736736
-->
737737
这将需要一个如下所示的 Ingress:
738738
739-
{{% code file="service/networking/simple-fanout-example.yaml" %}}
739+
{{% code_sample file="service/networking/simple-fanout-example.yaml" %}}
740740
741741
<!--
742742
When you create the Ingress with `kubectl apply -f`:
@@ -804,7 +804,7 @@ the [Host header](https://tools.ietf.org/html/rfc7230#section-5.4).
804804
以下 Ingress 让后台负载均衡器基于
805805
[host 头部字段](https://tools.ietf.org/html/rfc7230#section-5.4)来路由请求。
806806

807-
{{% code file="service/networking/name-virtual-host-ingress.yaml" %}}
807+
{{% code_sample file="service/networking/name-virtual-host-ingress.yaml" %}}
808808

809809
<!--
810810
If you create an Ingress resource without any hosts defined in the rules, then any
@@ -823,7 +823,7 @@ and `second.bar.com` to `service3`.
823823
例如,下面的 Ingress 对象会将请求 `first.bar.com` 的流量路由到 `service1`,将请求
824824
`second.bar.com` 的流量路由到 `service2`,而将所有其他流量路由到 `service3`
825825

826-
{{% code file="service/networking/name-virtual-host-ingress-no-third-host.yaml" %}}
826+
{{% code_sample file="service/networking/name-virtual-host-ingress-no-third-host.yaml" %}}
827827

828828
<!--
829829
### TLS
@@ -882,7 +882,7 @@ section.
882882
因此,`tls` 字段中的 `hosts` 的取值需要与 `rules` 字段中的 `host` 完全匹配。
883883
{{< /note >}}
884884

885-
{{% code file="service/networking/tls-example-ingress.yaml" %}}
885+
{{% code_sample file="service/networking/tls-example-ingress.yaml" %}}
886886

887887
{{< note >}}
888888
<!--
@@ -1077,4 +1077,3 @@ You can expose a Service in multiple ways that don't directly involve the Ingres
10771077
* 进一步了解 [Ingress](/zh-cn/docs/reference/kubernetes-api/service-resources/ingress-v1/) API
10781078
* 进一步了解 [Ingress 控制器](/zh-cn/docs/concepts/services-networking/ingress-controllers/)
10791079
* [使用 NGINX 控制器在 Minikube 上安装 Ingress](/zh-cn/docs/tasks/access-application-cluster/ingress-minikube/)
1080-

content/zh-cn/docs/concepts/services-networking/network-policies.md

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ An example NetworkPolicy might look like this:
160160

161161
下面是一个 NetworkPolicy 的示例:
162162

163-
{{< codenew file="service/networking/networkpolicy.yaml" >}}
163+
{{< code_sample file="service/networking/networkpolicy.yaml" >}}
164164

165165
{{< note >}}
166166
<!--
@@ -391,7 +391,7 @@ that selects all pods but does not allow any ingress traffic to those pods.
391391
你可以通过创建选择所有 Pod 但不允许任何进入这些 Pod 的入站流量的 NetworkPolicy
392392
来为名字空间创建 “default” 隔离策略。
393393

394-
{{< codenew file="service/networking/network-policy-default-deny-ingress.yaml" >}}
394+
{{< code_sample file="service/networking/network-policy-default-deny-ingress.yaml" >}}
395395

396396
<!--
397397
This ensures that even pods that aren't selected by any other NetworkPolicy will still be isolated
@@ -411,7 +411,7 @@ that explicitly allows that.
411411
-->
412412
如果你想允许一个名字空间中所有 Pod 的所有入站连接,你可以创建一个明确允许的策略。
413413

414-
{{< codenew file="service/networking/network-policy-allow-all-ingress.yaml" >}}
414+
{{< code_sample file="service/networking/network-policy-allow-all-ingress.yaml" >}}
415415

416416
<!--
417417
With this policy in place, no additional policy or policies can cause any incoming connection to
@@ -431,7 +431,7 @@ that selects all pods but does not allow any egress traffic from those pods.
431431
你可以通过创建选择所有容器但不允许来自这些容器的任何出站流量的 NetworkPolicy
432432
来为名字空间创建 “default” 隔离策略。
433433

434-
{{< codenew file="service/networking/network-policy-default-deny-egress.yaml" >}}
434+
{{< code_sample file="service/networking/network-policy-default-deny-egress.yaml" >}}
435435

436436
<!--
437437
This ensures that even pods that aren't selected by any other NetworkPolicy will not be allowed
@@ -452,7 +452,7 @@ explicitly allows all outgoing connections from pods in that namespace.
452452
如果要允许来自名字空间中所有 Pod 的所有连接,
453453
则可以创建一个明确允许来自该名字空间中 Pod 的所有出站连接的策略。
454454

455-
{{< codenew file="service/networking/network-policy-allow-all-egress.yaml" >}}
455+
{{< code_sample file="service/networking/network-policy-allow-all-egress.yaml" >}}
456456

457457
<!--
458458
With this policy in place, no additional policy or policies can cause any outgoing connection from
@@ -472,7 +472,7 @@ creating the following NetworkPolicy in that namespace.
472472
你可以为名字空间创建“默认”策略,以通过在该名字空间中创建以下 NetworkPolicy
473473
来阻止所有入站和出站流量。
474474

475-
{{< codenew file="service/networking/network-policy-default-deny-all.yaml" >}}
475+
{{< code_sample file="service/networking/network-policy-default-deny-all.yaml" >}}
476476

477477
<!--
478478
This ensures that even pods that aren't selected by any other NetworkPolicy will not be allowed
@@ -524,7 +524,7 @@ This is achievable with the usage of the `endPort` field, as the following examp
524524

525525
这一目的可以通过使用 `endPort` 字段来实现,如下例所示:
526526

527-
{{< codenew file="service/networking/networkpolicy-multiport-egress.yaml" >}}
527+
{{< code_sample file="service/networking/networkpolicy-multiport-egress.yaml" >}}
528528

529529
<!--
530530
The above rule allows any Pod with label `role=db` on the namespace `default` to communicate
@@ -619,19 +619,13 @@ namespaces based on their labels.
619619
-->
620620
## 基于名字指向某名字空间 {#targeting-a-namespace-by-its-name}
621621

622-
{{< feature-state for_k8s_version="1.22" state="stable" >}}
623-
624622
<!--
625623
The Kubernetes control plane sets an immutable label `kubernetes.io/metadata.name` on all
626-
namespaces, provided that the `NamespaceDefaultLabelName`
627-
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) is enabled.
628-
The value of the label is the namespace name.
624+
namespaces, the value of the label is the namespace name.
629625

630626
While NetworkPolicy cannot target a namespace by its name with some object field, you can use the
631627
standardized label to target a specific namespace.
632628
-->
633-
只要 `NamespaceDefaultLabelName`
634-
[特性门控](/zh-cn/docs/reference/command-line-tools-reference/feature-gates/)被启用,
635629
Kubernetes 控制面会在所有名字空间上设置一个不可变更的标签
636630
`kubernetes.io/metadata.name`。该标签的值是名字空间的名称。
637631

0 commit comments

Comments
 (0)