[zh] Fix link for /docs/reference/generated

This commit is contained in:
Sean Wei
2022-06-18 08:59:00 +08:00
parent 4c88434efc
commit 0e89a437f2
11 changed files with 132 additions and 138 deletions
@@ -132,7 +132,7 @@ In the bootstrap initialization process, the following occurs:
9. Certificate is created for the kubelet 9. Certificate is created for the kubelet
--> -->
1. kubelet 启动 1. kubelet 启动
2. kubelet 看到自己 *没有* 对应的 `kubeconfig` 文件 2. kubelet 看到自己**没有**对应的 `kubeconfig` 文件
3. kubelet 搜索并发现 `bootstrap-kubeconfig` 文件 3. kubelet 搜索并发现 `bootstrap-kubeconfig` 文件
4. kubelet 读取该启动引导文件,从中获得 API 服务器的 URL 和用途有限的 4. kubelet 读取该启动引导文件,从中获得 API 服务器的 URL 和用途有限的
一个“令牌(Token)” 一个“令牌(Token)”
@@ -304,8 +304,8 @@ particular bootstrap group's access when you are done provisioning the nodes.
--> -->
随着这个功能特性的逐渐成熟,你需要确保令牌绑定到某基于角色的的访问控制(RBAC) 随着这个功能特性的逐渐成熟,你需要确保令牌绑定到某基于角色的的访问控制(RBAC)
策略上,从而严格限制请求(使用[启动引导令牌](/zh/docs/reference/access-authn-authz/bootstrap-tokens/) 策略上,从而严格限制请求(使用[启动引导令牌](/zh/docs/reference/access-authn-authz/bootstrap-tokens/)
仅限于客户端申请提供证书。当 RBAC 被配置启用时,可以将令牌限制到某个组,从而 仅限于客户端申请提供证书。当 RBAC 被配置启用时,可以将令牌限制到某个组,
提高灵活性。例如,你可以在准备节点期间禁止某特定启动引导组的访问。 从而提高灵活性。例如,你可以在准备节点期间禁止某特定启动引导组的访问。
<!-- <!--
#### Bootstrap tokens #### Bootstrap tokens
@@ -366,8 +366,8 @@ systems). There are multiple ways you can generate a token. For example:
#### 令牌认证文件 {#token-authentication-file} #### 令牌认证文件 {#token-authentication-file}
kube-apiserver 能够将令牌视作身份认证依据。 kube-apiserver 能够将令牌视作身份认证依据。
这些令牌可以是任意数据,但必须表示为基于某安全的随机数生成器而得到的 这些令牌可以是任意数据,但必须表示为基于某安全的随机数生成器而得到的至少
至少 128 位混沌数据。这里的随机数生成器可以是现代 Linux 系统上的 128 位混沌数据。这里的随机数生成器可以是现代 Linux 系统上的
`/dev/urandom`。生成令牌的方式有很多种。例如: `/dev/urandom`。生成令牌的方式有很多种。例如:
```shell ```shell
@@ -382,8 +382,8 @@ values can be anything and the quoted group name should be as depicted:
--> -->
上面的命令会生成类似于 `02b50b05283e98dd0fd71db496ef01e8` 这样的令牌。 上面的命令会生成类似于 `02b50b05283e98dd0fd71db496ef01e8` 这样的令牌。
令牌文件看起来是下面的例子这样,其中前面三个值可以是任何值,用引号括起来 令牌文件看起来是下面的例子这样,其中前面三个值可以是任何值,
的组名称则只能用例子中给的值。 用引号括起来的组名称则只能用例子中给的值。
```console ```console
02b50b05283e98dd0fd71db496ef01e8,kubelet-bootstrap,10001,"system:bootstrappers" 02b50b05283e98dd0fd71db496ef01e8,kubelet-bootstrap,10001,"system:bootstrappers"
@@ -413,7 +413,7 @@ To do this, you only need to create a `ClusterRoleBinding` that binds the `syste
--> -->
### 授权 kubelet 创建 CSR {#authorize-kubelet-to-create-csr} ### 授权 kubelet 创建 CSR {#authorize-kubelet-to-create-csr}
现在启动引导节点被身份认证为 `system:bootstrapping` 组的成员,它需要被 _授权_ 现在启动引导节点被身份认证为 `system:bootstrapping` 组的成员,它需要被**授权**
创建证书签名请求(CSR)并在证书被签名之后将其取回。 创建证书签名请求(CSR)并在证书被签名之后将其取回。
幸运的是,Kubernetes 提供了一个 `ClusterRole`,其中精确地封装了这些许可, 幸运的是,Kubernetes 提供了一个 `ClusterRole`,其中精确地封装了这些许可,
`system:node-bootstrapper` `system:node-bootstrapper`
@@ -491,7 +491,7 @@ To provide the Kubernetes CA key and certificate to kube-controller-manager, use
由于这些被签名的证书反过来会被 kubelet 用来在 kube-apiserver 执行普通的 由于这些被签名的证书反过来会被 kubelet 用来在 kube-apiserver 执行普通的
kubelet 身份认证,很重要的一点是为控制器管理器所提供的 CA 也被 kube-apiserver kubelet 身份认证,很重要的一点是为控制器管理器所提供的 CA 也被 kube-apiserver
信任用来执行身份认证。CA 密钥和证书是通过 kube-apiserver 的标志 信任用来执行身份认证。CA 密钥和证书是通过 kube-apiserver 的标志
`--client-ca-file=FILENAME`(例如,`--client-ca-file=/var/lib/kubernetes/ca.pem`) `--client-ca-file=FILENAME`(例如,`--client-ca-file=/var/lib/kubernetes/ca.pem`
来设定的,正如 kube-apiserver 配置节所述。 来设定的,正如 kube-apiserver 配置节所述。
要将 Kubernetes CA 密钥和证书提供给 kube-controller-manager,可使用以下标志: 要将 Kubernetes CA 密钥和证书提供给 kube-controller-manager,可使用以下标志:
@@ -593,15 +593,15 @@ roleRef:
<!-- <!--
The `csrapproving` controller that ships as part of The `csrapproving` controller that ships as part of
[kube-controller-manager](/docs/admin/kube-controller-manager/) and is enabled [kube-controller-manager](/docs/admin/kube-controller-manager/) and is enabled
by default. The controller uses the [`SubjectAccessReview` by default. The controller uses the
API](/docs/reference/access-authn-authz/authorization/#checking-api-access) to [`SubjectAccessReview` API](/docs/reference/access-authn-authz/authorization/#checking-api-access) to
determine if a given user is authorized to request a CSR, then approves based on determine if a given user is authorized to request a CSR, then approves based on
the authorization outcome. To prevent conflicts with other approvers, the the authorization outcome. To prevent conflicts with other approvers, the
builtin approver doesn't explicitly deny CSRs. It only ignores unauthorized builtin approver doesn't explicitly deny CSRs. It only ignores unauthorized
requests. The controller also prunes expired certificates as part of garbage requests. The controller also prunes expired certificates as part of garbage
collection. collection.
--> -->
作为 [kube-controller-manager](/zh/docs/reference/generated/kube-controller-manager/) 作为 [kube-controller-manager](/zh-cn/docs/reference/command-line-tools-reference/kube-controller-manager/)
的一部分的 `csrapproving` 控制器是自动被启用的。 的一部分的 `csrapproving` 控制器是自动被启用的。
该控制器使用 [`SubjectAccessReview` API](/zh/docs/reference/access-authn-authz/authorization/#checking-api-access) 该控制器使用 [`SubjectAccessReview` API](/zh/docs/reference/access-authn-authz/authorization/#checking-api-access)
来确定是否某给定用户被授权请求 CSR,之后基于鉴权结果执行批复操作。 来确定是否某给定用户被授权请求 CSR,之后基于鉴权结果执行批复操作。
@@ -612,7 +612,7 @@ collection.
<!-- <!--
## kubelet configuration ## kubelet configuration
Finally, with the control plane properly set up and all of the necessary authentication and authorization in place, we can configure the kubelet. Finally, with the control plane nodes properly set up and all of the necessary authentication and authorization in place, we can configure the kubelet.
--> -->
## kubelet 配置 {#kubelet-configuration} ## kubelet 配置 {#kubelet-configuration}
@@ -733,7 +733,7 @@ uses to authenticate to kube-apiserver.
--> -->
### 客户和服务证书 {#client-and-serving-certificates} ### 客户和服务证书 {#client-and-serving-certificates}
前文所述的内容都与 kubelet _客户端_ 证书相关,尤其是 kubelet 用来向 前文所述的内容都与 kubelet **客户端**证书相关,尤其是 kubelet 用来向
kube-apiserver 认证自身身份的证书。 kube-apiserver 认证自身身份的证书。
<!-- <!--
@@ -744,7 +744,7 @@ To secure these, the kubelet can do one of:
* create self-signed key and certificate, if a key and certificate are not provided * create self-signed key and certificate, if a key and certificate are not provided
* request serving certificates from the cluster server, via the CSR API * request serving certificates from the cluster server, via the CSR API
--> -->
kubelet 也可以使用 _服务(Serving_ 证书。kubelet 自身向外提供一个 kubelet 也可以使用**服务(Serving**证书。kubelet 自身向外提供一个
HTTPS 末端,包含若干功能特性。要保证这些末端的安全性,kubelet 可以执行以下操作 HTTPS 末端,包含若干功能特性。要保证这些末端的安全性,kubelet 可以执行以下操作
之一: 之一:
@@ -814,9 +814,9 @@ controller, or manually approve the serving certificate requests.
--> -->
Kubernetes 核心中所实现的 CSR 批复控制器出于 Kubernetes 核心中所实现的 CSR 批复控制器出于
[安全原因](https://github.com/kubernetes/community/pull/1982) [安全原因](https://github.com/kubernetes/community/pull/1982)
并不会自动批复节点的 _服务_ 证书。 并不会自动批复节点的**服务**证书。
要使用 `RotateKubeletServerCertificate` 功能特性,集群运维人员需要运行一个 要使用 `RotateKubeletServerCertificate` 功能特性,
定制的控制器或者手动批复服务证书的请求。 集群运维人员需要运行一个定制的控制器或者手动批复服务证书的请求。
<!-- <!--
A deployment-specific approval process for kubelet serving certificates should typically only approve CSRs which: A deployment-specific approval process for kubelet serving certificates should typically only approve CSRs which:
@@ -833,11 +833,11 @@ A deployment-specific approval process for kubelet serving certificates should t
1. 由节点发出的请求(确保 `spec.username` 字段形式为 `system:node:<nodeName>` 1. 由节点发出的请求(确保 `spec.username` 字段形式为 `system:node:<nodeName>`
`spec.groups` 包含 `system:nodes` `spec.groups` 包含 `system:nodes`
2. 请求中包含服务证书用法(确保 `spec.usages` 中包含 `server auth`,可选地也可 2. 请求中包含服务证书用法(确保 `spec.usages` 中包含 `server auth`,可选地也可包含
包含 `digital signature``key encipherment`,且不包含其它用法) `digital signature``key encipherment`,且不包含其它用法)
3. 仅包含隶属于请求节点的 IP 和 DNS 的 `subjectAltNames`,没有 URI 和 Email 3. 仅包含隶属于请求节点的 IP 和 DNS 的 `subjectAltNames`,没有 URI 和 Email
形式的 `subjectAltNames`(解析 `spec.request` 中的 x509 证书签名请求可以 形式的 `subjectAltNames`(解析 `spec.request` 中的 x509 证书签名请求可以检查
检查 `subjectAltNames` `subjectAltNames`
{{< /note >}} {{< /note >}}
<!-- <!--
@@ -849,10 +849,9 @@ is part of the Kubernetes control plane and runs on every node, but may also inc
--> -->
## 其它身份认证组件 {#other-authenticating-components} ## 其它身份认证组件 {#other-authenticating-components}
本文所描述的所有 TLS 启动引导内容都与 kubelet 相关。不过,其它组件也可能需要 本文所描述的所有 TLS 启动引导内容都与 kubelet 相关。不过,其它组件也可能需要直接与
直接与 kube-apiserver 直接通信。容易想到的是 kube-proxy,同样隶属于 kube-apiserver 直接通信。容易想到的是 kube-proxy,同样隶属于
Kubernetes 的控制面并且运行在所有节点之上,不过也可能包含一些其它负责 Kubernetes 的控制面并且运行在所有节点之上,不过也可能包含一些其它负责监控或者联网的组件。
监控或者联网的组件。
<!-- <!--
Like the kubelet, these other components also require a method of authenticating to kube-apiserver. Like the kubelet, these other components also require a method of authenticating to kube-apiserver.
@@ -865,13 +864,12 @@ You have several options for generating these credentials:
* The old way: Create and distribute certificates the same way you did for kubelet before TLS bootstrapping * The old way: Create and distribute certificates the same way you did for kubelet before TLS bootstrapping
* DaemonSet: Since the kubelet itself is loaded on each node, and is sufficient to start base services, you can run kube-proxy and other node-specific services not as a standalone process, but rather as a daemonset in the `kube-system` namespace. Since it will be in-cluster, you can give it a proper service account with appropriate permissions to perform its activities. This may be the simplest way to configure such services. * DaemonSet: Since the kubelet itself is loaded on each node, and is sufficient to start base services, you can run kube-proxy and other node-specific services not as a standalone process, but rather as a daemonset in the `kube-system` namespace. Since it will be in-cluster, you can give it a proper service account with appropriate permissions to perform its activities. This may be the simplest way to configure such services.
--> -->
* 较老的方式:和 kubelet 在 TLS 启动引导之前所做的一样,用类似的方式 * 较老的方式:和 kubelet 在 TLS 启动引导之前所做的一样,用类似的方式创建和分发证书。
创建和分发证书
* DaemonSet:由于 kubelet 自身被加载到所有节点之上,并且有足够能力来启动基本服务, * DaemonSet:由于 kubelet 自身被加载到所有节点之上,并且有足够能力来启动基本服务,
你可以运行将 kube-proxy 和其它特定节点的服务作为 `kube-system` 名字空间中的 你可以运行将 kube-proxy 和其它特定节点的服务作为 `kube-system` 名字空间中的
DaemonSet 来执行,而不是独立的进程。由于 DaemonSet 位于集群内部,你可以为其 DaemonSet 来执行,而不是独立的进程。由于 DaemonSet 位于集群内部,
指派一个合适的服务账户,使之具有适当的访问权限来完成其使命。这也许是配置此类 你可以为其指派一个合适的服务账户,使之具有适当的访问权限来完成其使命。
服务的最简单的方法。 这也许是配置此类服务的最简单的方法。
<!-- <!--
## kubectl approval ## kubectl approval
@@ -894,13 +892,12 @@ list CSRs with `kubectl get csr` and describe one in detail with `kubectl
describe csr <name>`. An administrator can approve or deny a CSR with `kubectl describe csr <name>`. An administrator can approve or deny a CSR with `kubectl
certificate approve <name>` and `kubectl certificate deny <name>`. certificate approve <name>` and `kubectl certificate deny <name>`.
--> -->
签名控制器并不会立即对所有证书请求执行签名操作。相反,它会等待这些请求被某 签名控制器并不会立即对所有证书请求执行签名操作。相反,
具有适当特权的用户标记为 “Approved(已批准)”状态。 它会等待这些请求被某具有适当特权的用户标记为 “Approved(已批准)”状态。
这一流程有意允许由外部批复控制器来自动执行的批复,或者由控制器管理器内置的 这一流程有意允许由外部批复控制器来自动执行的批复,
批复控制器来自动批复。 或者由控制器管理器内置的批复控制器来自动批复。
不过,集群管理员也可以使用 `kubectl` 来手动批准证书请求。 不过,集群管理员也可以使用 `kubectl` 来手动批准证书请求。
管理员可以通过 `kubectl get csr` 来列举所有的 CSR,使用 管理员可以通过 `kubectl get csr` 来列举所有的 CSR,使用
`kubectl descsribe csr <name>` 来描述某个 CSR 的细节。 `kubectl descsribe csr <name>` 来描述某个 CSR 的细节。
管理员可以使用 `kubectl certificate approve <name` 来批准某 CSR,或者 管理员可以使用 `kubectl certificate approve <name` 来批准某 CSR,或者
`kubectl certificate deny <name>` 来拒绝某 CSR。 `kubectl certificate deny <name>` 来拒绝某 CSR。
@@ -2,7 +2,7 @@
title: HostAliases title: HostAliases
id: HostAliases id: HostAliases
date: 2019-01-31 date: 2019-01-31
full_link: /docs/reference/generated/kubernetes-api/{{< param "version" >}}/#hostalias-v1-core full_link: /zh-cn/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#hostalias-v1-core
short_description: > short_description: >
主机别名 (HostAliases) 是一组 IP 地址和主机名的映射,用于注入到 Pod 内的 hosts 文件。 主机别名 (HostAliases) 是一组 IP 地址和主机名的映射,用于注入到 Pod 内的 hosts 文件。
@@ -10,10 +10,7 @@ aka:
tags: tags:
- operation - operation
--- ---
主机别名 (HostAliases) 是一组 IP 地址和主机名的映射,用于注入到 {{< glossary_tooltip text="Pod" term_id="pod" >}} 内的 hosts 文件。
<!-- <!--
---
title: HostAliases title: HostAliases
id: HostAliases id: HostAliases
date: 2019-01-31 date: 2019-01-31
@@ -24,9 +21,13 @@ short_description: >
aka: aka:
tags: tags:
- operation - operation
--- -->
<!--
A HostAliases is a mapping between the IP address and hostname to be injected into a {{< glossary_tooltip text="Pod" term_id="pod" >}}'s hosts file. A HostAliases is a mapping between the IP address and hostname to be injected into a {{< glossary_tooltip text="Pod" term_id="pod" >}}'s hosts file.
--> -->
主机别名 (HostAliases) 是一组 IP 地址和主机名的映射,用于注入到 {{< glossary_tooltip text="Pod" term_id="pod" >}} 内的 hosts 文件。
<!--more--> <!--more-->
@@ -1,26 +1,27 @@
--- ---
title: kube-apiserver title: API 服务器
id: kube-apiserver id: kube-apiserver
date: 2018-04-12 date: 2018-04-12
full_link: /zh/docs/reference/command-line-tools-reference/kube-apiserver/ full_link: /zh-cn/docs/concepts/overview/components/#kube-apiserver
short_description: > short_description: >
提供 Kubernetes API 服务的控制面组件。 提供 Kubernetes API 服务的控制面组件。
aka: aka:
- kube-apiserver
tags: tags:
- architecture - architecture
- fundamental - fundamental
--- ---
<!-- <!--
title: kube-apiserver title: API server
id: kube-apiserver id: kube-apiserver
date: 2018-04-12 date: 2018-04-12
full_link: /zh/docs/reference/command-line-tools-reference/kube-apiserver/ full_link: /docs/concepts/overview/components/#kube-apiserver
short_description: > short_description: >
Control plane component that serves the Kubernetes API. Control plane component that serves the Kubernetes API.
aka: aka:
- kube-apiserver
tags: tags:
- architecture - architecture
- fundamental - fundamental
@@ -42,6 +43,6 @@ The main implementation of a Kubernetes API server is [kube-apiserver](/docs/ref
kube-apiserver is designed to scale horizontally&mdash;that is, it scales by deploying more instances. kube-apiserver is designed to scale horizontally&mdash;that is, it scales by deploying more instances.
You can run several instances of kube-apiserver and balance traffic between those instances. You can run several instances of kube-apiserver and balance traffic between those instances.
--> -->
Kubernetes API 服务器的主要实现是 [kube-apiserver](/zh/docs/reference/command-line-tools-reference/kube-apiserver/)。 Kubernetes API 服务器的主要实现是 [kube-apiserver](/zh-cn/docs/reference/command-line-tools-reference/kube-apiserver/)。
`kube-apiserver` 设计上考虑了水平扩缩,也就是说,它可通过部署多个实例来进行扩缩。 `kube-apiserver` 设计上考虑了水平扩缩,也就是说,它可通过部署多个实例来进行扩缩。
你可以运行 `kube-apiserver` 的多个实例,并在这些实例之间平衡流量。 你可以运行 `kube-apiserver` 的多个实例,并在这些实例之间平衡流量。
@@ -2,7 +2,7 @@
title: kube-controller-manager title: kube-controller-manager
id: kube-controller-manager id: kube-controller-manager
date: 2018-04-12 date: 2018-04-12
full_link: /docs/reference/generated/kube-controller-manager/ full_link: /zh-cn/docs/reference/command-line-tools-reference/kube-controller-manager/
short_description: > short_description: >
主节点上运行控制器的组件。 主节点上运行控制器的组件。
@@ -11,13 +11,11 @@ tags:
- architecture - architecture
- fundamental - fundamental
--- ---
<!-- <!--
---
title: kube-controller-manager title: kube-controller-manager
id: kube-controller-manager id: kube-controller-manager
date: 2018-04-12 date: 2018-04-12
full_link: /docs/reference/generated/kube-controller-manager/ full_link: /docs/reference/command-line-tools-reference/kube-controller-manager/
short_description: > short_description: >
Component on the master that runs controllers. Component on the master that runs controllers.
@@ -25,17 +23,18 @@ aka:
tags: tags:
- architecture - architecture
- fundamental - fundamental
---
--> -->
<!-- <!--
Control plane component that runs Control plane component that runs
{{< glossary_tooltip text="controller" term_id="controller" >}} processes. {{< glossary_tooltip text="controller" term_id="controller" >}} processes.
--> -->
[kube-controller-manager](/zh/docs/reference/command-line-tools-reference/kube-controller-manager/) 是{{< glossary_tooltip text="控制平面" term_id="control-plane" >}}的组件, [kube-controller-manager](/zh/docs/reference/command-line-tools-reference/kube-controller-manager/)
是{{< glossary_tooltip text="控制平面" term_id="control-plane" >}}的组件,
负责运行{{< glossary_tooltip text="控制器" term_id="controller" >}}进程。 负责运行{{< glossary_tooltip text="控制器" term_id="controller" >}}进程。
<!--more--> <!--more-->
<!-- <!--
Logically, each {{< glossary_tooltip text="controller" term_id="controller" >}} Logically, each {{< glossary_tooltip text="controller" term_id="controller" >}}
is a separate process, but to reduce complexity, is a separate process, but to reduce complexity,
@@ -2,14 +2,13 @@
title: Kubelet title: Kubelet
id: kubelet id: kubelet
date: 2018-04-12 date: 2018-04-12
full_link: /docs/reference/generated/kubelet full_link: /zh-cn/docs/reference/generated/kubelet
short_description: > short_description: >
一个在集群中每个节点上运行的代理。它保证容器都运行在 Pod 中。 一个在集群中每个节点上运行的代理。它保证容器都运行在 Pod 中。
aka: aka:
tags: tags:
- fundamental - fundamental
- core-object
--- ---
<!-- <!--
title: Kubelet title: Kubelet
@@ -22,7 +21,6 @@ short_description: >
aka: aka:
tags: tags:
- fundamental - fundamental
- core-object
--> -->
<!-- <!--
@@ -1100,7 +1100,7 @@ that they do not have side effects, by setting their `sideEffects` field to `Non
--> -->
如果请求的非试运行版本会触发具有副作用的准入控制器,则该请求将失败,而不是冒不希望的副作用的风险。 如果请求的非试运行版本会触发具有副作用的准入控制器,则该请求将失败,而不是冒不希望的副作用的风险。
所有内置准入控制插件都支持试运行。 所有内置准入控制插件都支持试运行。
此外,准入 Webhook 还可以设置[配置对象](/zh/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#webhook-v1beta1-admissionregistration-k8s-io) 此外,准入 Webhook 还可以设置[配置对象](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#webhook-v1beta1-admissionregistration-k8s-io)
的 `sideEffects` 字段为 `None`,借此声明它们没有副作用。 的 `sideEffects` 字段为 `None`,借此声明它们没有副作用。
<!-- <!--
@@ -1281,7 +1281,7 @@ API 服务器根据你请求的操作和 `resourceVersion` 的值对 `resourceVe
For **get** and **list**, the semantics of `resourceVersion` are: For **get** and **list**, the semantics of `resourceVersion` are:
--> -->
### **get** 和 **list** 语义 ### **get** 和 **list** 语义 {#semantics-for-get-and-list}
对于 **get** 和 **list** 而言,`resourceVersion` 的语义为: 对于 **get** 和 **list** 而言,`resourceVersion` 的语义为:
@@ -1453,8 +1453,8 @@ the object is when served.
{{< note >}} {{< note >}}
当你 **list** 资源并收到集合响应时, 当你 **list** 资源并收到集合响应时,
响应包括集合的[元数据](/zh/docs/reference/generated/kubernetes-api/v1.21/#listmeta-v1-meta) 响应包括集合的[元数据](/docs/reference/generated/kubernetes-api/v1.21/#listmeta-v1-meta)
以及该集合中每个项目的[对象元数据](/zh/docs/reference/generated/kubernetes-api/v1.21/#listmeta-v1-meta)。 以及该集合中每个项目的[对象元数据](/docs/reference/generated/kubernetes-api/v1.21/#listmeta-v1-meta)。
对于在集合响应中找到的单个对象,`.metadata.resourceVersion` 跟踪该对象的最后更新时间, 对于在集合响应中找到的单个对象,`.metadata.resourceVersion` 跟踪该对象的最后更新时间,
而不是对象在服务时的最新程度。 而不是对象在服务时的最新程度。
{{< /note >}} {{< /note >}}
@@ -1484,7 +1484,7 @@ example, the client might fall back to a request with `limit` set.
For watch, the semantics of resource version are: For watch, the semantics of resource version are:
--> -->
### **watch** 语义 ### **watch** 语义 {#semantics-for-watch}
对于 watch 操作而言,资源版本的语义如下: 对于 watch 操作而言,资源版本的语义如下:
@@ -119,9 +119,9 @@ in the Container manifest, and within it, the
## 为容器设置 Username {#set-the-username-for-a-container} ## 为容器设置 Username {#set-the-username-for-a-container}
要指定运行容器时所使用的用户名,请在容器清单中包含 `securityContext` 要指定运行容器时所使用的用户名,请在容器清单中包含 `securityContext`
([SecurityContext](/zh/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#securitycontext-v1-core)) ([SecurityContext](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#securitycontext-v1-core))
字段,并在其内部包含 `windowsOptions` 字段,并在其内部包含 `windowsOptions`
[WindowsSecurityContextOptions](/zh/docs/reference/generated/kubernetes-api/{{< param [WindowsSecurityContextOptions](/docs/reference/generated/kubernetes-api/{{< param
"version" >}}/#windowssecuritycontextoptions-v1-core) "version" >}}/#windowssecuritycontextoptions-v1-core)
字段的 `runAsUserName` 字段。 字段的 `runAsUserName` 字段。
@@ -21,7 +21,7 @@ by applications that use the Kubernetes API, and by the control plane itself.
Auditing allows cluster administrators to answer the following questions: Auditing allows cluster administrators to answer the following questions:
--> -->
Kubernetes _审计(Auditing_ 功能提供了与安全相关的、按时间顺序排列的记录集, Kubernetes **审计(Auditing**功能提供了与安全相关的、按时间顺序排列的记录集,
记录每个用户、使用 Kubernetes API 的应用以及控制面自身引发的活动。 记录每个用户、使用 Kubernetes API 的应用以及控制面自身引发的活动。
审计功能使得集群管理员能够回答以下问题: 审计功能使得集群管理员能够回答以下问题:
@@ -73,7 +73,7 @@ Each request can be recorded with an associated _stage_. The defined stages are:
will be sent. will be sent.
- `Panic` - Events generated when a panic occurred. - `Panic` - Events generated when a panic occurred.
--> -->
每个请求都可被记录其相关的 _阶段(stage_。已定义的阶段有: 每个请求都可被记录其相关的**阶段(stage**。已定义的阶段有:
- `RequestReceived` - 此阶段对应审计处理器接收到请求后,并且在委托给 - `RequestReceived` - 此阶段对应审计处理器接收到请求后,并且在委托给
其余处理器之前生成的事件。 其余处理器之前生成的事件。
@@ -91,7 +91,7 @@ API object.
--> -->
{{< note >}} {{< note >}}
[审计事件配置](/zh/docs/reference/config-api/apiserver-audit.v1/#audit-k8s-io-v1-Event) [审计事件配置](/zh/docs/reference/config-api/apiserver-audit.v1/#audit-k8s-io-v1-Event)
的配置与 [Event](/zh/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#event-v1-core) 的配置与 [Event](/docs/reference/generated/kubernetes-api/{{< param "version" >}}/#event-v1-core)
API 对象不同。 API 对象不同。
{{< /note >}} {{< /note >}}
@@ -119,7 +119,7 @@ _audit level_ of the event. The defined audit levels are:
审计策略对象结构定义在 审计策略对象结构定义在
[`audit.k8s.io` API 组](/zh/docs/reference/config-api/apiserver-audit.v1/#audit-k8s-io-v1-Policy) [`audit.k8s.io` API 组](/zh/docs/reference/config-api/apiserver-audit.v1/#audit-k8s-io-v1-Policy)
处理事件时,将按顺序与规则列表进行比较。第一个匹配规则设置事件的 处理事件时,将按顺序与规则列表进行比较。第一个匹配规则设置事件的
_审计级别(Audit Level_。已定义的审计级别有: **审计级别(Audit Level**。已定义的审计级别有:
<!-- <!--
- `None` - don't log events that match this rule. - `None` - don't log events that match this rule.
@@ -147,7 +147,7 @@ Below is an example audit policy file:
--> -->
你可以使用 `--audit-policy-file` 标志将包含策略的文件传递给 `kube-apiserver` 你可以使用 `--audit-policy-file` 标志将包含策略的文件传递给 `kube-apiserver`
如果不设置该标志,则不记录事件。 如果不设置该标志,则不记录事件。
注意 `rules` 字段 __必须__ 在审计策略文件中提供。没有(0)规则的策略将被视为非法配置。 注意 `rules` 字段**必须**在审计策略文件中提供。没有(0)规则的策略将被视为非法配置。
以下是一个审计策略文件的示例: 以下是一个审计策略文件的示例:
@@ -241,7 +241,7 @@ You can configure the log audit backend using the following `kube-apiserver` fla
Log backend writes audit events to a file in JSON format. You can configure Log backend writes audit events to a file in JSON format. You can configure
log audit backend using the following [kube-apiserver][kube-apiserver] flags: log audit backend using the following [kube-apiserver][kube-apiserver] flags:
--> -->
### Log 后端 ### Log 后端 {#log-backend}
Log 后端将审计事件写入 [JSONlines](https://jsonlines.org/) 格式的文件。 Log 后端将审计事件写入 [JSONlines](https://jsonlines.org/) 格式的文件。
你可以使用以下 `kube-apiserver` 标志配置 Log 审计后端: 你可以使用以下 `kube-apiserver` 标志配置 Log 审计后端:
@@ -450,4 +450,3 @@ By default truncate is disabled in both `webhook` and `log`, a cluster administr
* Learn about [Mutating webhook auditing annotations](/docs/reference/access-authn-authz/extensible-admission-controllers/#mutating-webhook-auditing-annotations). * Learn about [Mutating webhook auditing annotations](/docs/reference/access-authn-authz/extensible-admission-controllers/#mutating-webhook-auditing-annotations).
--> -->
* 了解 [Mutating webhook 审计注解](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/#mutating-webhook-auditing-annotations)。 * 了解 [Mutating webhook 审计注解](/zh/docs/reference/access-authn-authz/extensible-admission-controllers/#mutating-webhook-auditing-annotations)。
@@ -39,7 +39,7 @@ command.
[VerticalPodAutoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#readme) (VPA) [VerticalPodAutoscaler](https://github.com/kubernetes/autoscaler/tree/master/vertical-pod-autoscaler#readme) (VPA)
使用 metrics API 中的数据调整工作负载副本和资源,以满足客户需求。 使用 metrics API 中的数据调整工作负载副本和资源,以满足客户需求。
你也可以通过 [`kubectl top`](/zh/docs/reference/generated/kubectl/kubectl-commands#top) 命令来查看资源指标。 你也可以通过 [`kubectl top`](/docs/reference/generated/kubectl/kubectl-commands#top) 命令来查看资源指标。
{{< note >}} {{< note >}}
<!-- <!--
@@ -387,7 +387,7 @@ them in the [Summary API](https://github.com/kubernetes/kubernetes/blob/7d309e01
for consumers to read. for consumers to read.
--> -->
### Summary API 来源 ### Summary API 来源 {#summary-api-source}
[Kubelet](/zh/docs/reference/command-line-tools-reference/kubelet/) 在节点、卷、Pod 和容器级别收集统计信息, [Kubelet](/zh/docs/reference/command-line-tools-reference/kubelet/) 在节点、卷、Pod 和容器级别收集统计信息,
并在 [Summary API](https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go) 并在 [Summary API](https://github.com/kubernetes/kubernetes/blob/7d309e0104fedb57280b261e5677d919cb2a0e2d/staging/src/k8s.io/kubelet/pkg/apis/stats/v1alpha1/types.go)
@@ -175,7 +175,7 @@ on the algorithm.
## 创建 HorizontalPodAutoscaler {#create-horizontal-pod-autoscaler} ## 创建 HorizontalPodAutoscaler {#create-horizontal-pod-autoscaler}
现在服务器正在运行,使用 `kubectl` 创建自动扩缩器。 现在服务器正在运行,使用 `kubectl` 创建自动扩缩器。
[`kubectl autoscale`](/zh/docs/reference/generated/kubectl/kubectl-commands#autoscale) 子命令是 `kubectl` 的一部分, [`kubectl autoscale`](/docs/reference/generated/kubectl/kubectl-commands#autoscale) 子命令是 `kubectl` 的一部分,
可以帮助你执行此操作。 可以帮助你执行此操作。
你将很快运行一个创建 HorizontalPodAutoscaler 的命令, 你将很快运行一个创建 HorizontalPodAutoscaler 的命令,
@@ -649,7 +649,7 @@ relationship to any object in the Kubernetes cluster, such as metrics describing
no direct correlation to Kubernetes namespaces. In Kubernetes 1.10 and later, you can address this use case no direct correlation to Kubernetes namespaces. In Kubernetes 1.10 and later, you can address this use case
with *external metrics*. with *external metrics*.
--> -->
### 基于与 Kubernetes 对象无关的度量指标执行扩缩 ### 基于与 Kubernetes 对象无关的度量指标执行扩缩 {#autoscaling-on-metrics-not-related-to-kubernetes-objects}
运行在 Kubernetes 上的应用程序可能需要基于与 Kubernetes 集群中的任何对象 运行在 Kubernetes 上的应用程序可能需要基于与 Kubernetes 集群中的任何对象
没有明显关系的度量指标进行自动扩缩, 没有明显关系的度量指标进行自动扩缩,
@@ -710,7 +710,7 @@ When using the `autoscaling/v2` form of the HorizontalPodAutoscaler, you will be
whether or not the HorizontalPodAutoscaler is able to scale, and whether or not it is currently restricted whether or not the HorizontalPodAutoscaler is able to scale, and whether or not it is currently restricted
in any way. in any way.
--> -->
## 附录:Horizontal Pod Autoscaler 状态条件 ## 附录:Horizontal Pod Autoscaler 状态条件 {#appendix-horizontal-pod-autoscaler-status-conditions}
使用 `autoscaling/v2` 格式的 HorizontalPodAutoscaler 时,你将可以看到 使用 `autoscaling/v2` 格式的 HorizontalPodAutoscaler 时,你将可以看到
Kubernetes 为 HorizongtalPodAutoscaler 设置的状态条件(Status Conditions)。 Kubernetes 为 HorizongtalPodAutoscaler 设置的状态条件(Status Conditions)。
@@ -817,4 +817,3 @@ kubectl create -f https://k8s.io/examples/application/hpa/php-apache.yaml
``` ```
horizontalpodautoscaler.autoscaling/php-apache created horizontalpodautoscaler.autoscaling/php-apache created
``` ```
@@ -1002,7 +1002,7 @@ For more information on HorizontalPodAutoscaler:
* Read the [API reference](/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v2/) for HorizontalPodAutoscaler. * Read the [API reference](/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v2/) for HorizontalPodAutoscaler.
--> -->
* 阅读水平 Pod 自动扩缩的[演练示例](/zh/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)。 * 阅读水平 Pod 自动扩缩的[演练示例](/zh/docs/tasks/run-application/horizontal-pod-autoscale-walkthrough/)。
* 阅读 [`kubectl autoscale`](/zh/docs/reference/generated/kubectl/kubectl-commands/#autoscale) 的文档。 * 阅读 [`kubectl autoscale`](/docs/reference/generated/kubectl/kubectl-commands/#autoscale) 的文档。
* 如果你想编写自己的自定义指标适配器, * 如果你想编写自己的自定义指标适配器,
请查看 [boilerplate](https://github.com/kubernetes-sigs/custom-metrics-apiserver) 以开始使用。 请查看 [boilerplate](https://github.com/kubernetes-sigs/custom-metrics-apiserver) 以开始使用。
* 阅读 [API 参考](/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v2/)。 * 阅读 [API 参考](/docs/reference/kubernetes-api/workload-resources/horizontal-pod-autoscaler-v2/)。