Merge remote-tracking branch 'upstream/main' into dev-1.24

This commit is contained in:
Nate W
2022-04-19 15:45:28 -07:00
163 changed files with 7079 additions and 2699 deletions
@@ -534,7 +534,7 @@ imagePolicy:
kubeConfigFile: /path/to/kubeconfig/for/backend
# 以秒计的时长,控制批准请求的缓存时间
allowTTL: 50
# 以秒计的时长,控制批准请求的缓存时间
# 以秒计的时长,控制拒绝请求的缓存时间
denyTTL: 50
# 以毫秒计的时长,控制重试间隔
retryBackoff: 500
@@ -50,7 +50,7 @@ kube-apiserver --authorization-mode=Example,RBAC --<其他选项> --<其他选
The RBAC API declares four kinds of Kubernetes object: _Role_, _ClusterRole_,
_RoleBinding_ and _ClusterRoleBinding_. You can
[describe objects](/docs/concepts/overview/working-with-objects/kubernetes-objects/#understanding-kubernetes-objects),
or amend them, using tools such as `kubectl,` just like any other Kubernetes object.
or amend them, using tools such as `kubectl`, just like any other Kubernetes object.
-->
## API 对象 {#api-overview}
File diff suppressed because it is too large Load Diff
@@ -76,6 +76,10 @@ of CertificateAuthority, since CA data will always be passed to the plugin as by
Cluster 中包含允许 exec 插件与 Kubernetes 集群进行通信身份认证时所需
的信息。
为了确保该结构体包含需要与 Kubernetes 集群进行通信的所有内容(就像通过 Kubeconfig 一样),
除了证书授权之外,该字段应该映射到 "k8s.io/client-go/tools/clientcmd/api/v1".cluster
由于 CA 数据将始终以字节形式传递给插件。
<table class="table">
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
<tbody>
@@ -167,7 +171,7 @@ clusters:
只是针对不同集群会有一些细节上的差异,例如 audience。
此字段使得特定于集群的配置可以直接使用集群信息来设置。
不建议使用此字段来保存 Secret 数据,因为 exec 插件的主要优势之一是不需要在
kubeconfig 中保存 Secret 数据。
kubeconfig 中保存 Secret 数据。</p>
</td>
</tr>
</tbody>
@@ -222,6 +226,7 @@ ExecCredentialSpec 保存传输组件所提供的特定于请求和运行时的
<!--
**Appears in:**
-->
**出现在:**
- [ExecCredential](#client-authentication-k8s-io-v1-ExecCredential)
@@ -235,7 +240,7 @@ itself should at least be protected via file permissions.
<p>ExecCredentialStatus 中包含传输组件要使用的凭据。</p>
<p>字段 token 和 clientKeyData 都是敏感字段。此数据只能在
客户端与 exec 插件进程之间使用内存来传递。exec 插件本身至少
应通过文件访问许可来实施保护。</p>
应通过文件访问许可来实施保护。</p>
<table class="table">
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
@@ -1,12 +1,22 @@
---
title: Client Authentication (v1beta1)
title: 客户端身份认证(Client Authentication(v1beta1)
content_type: tool-reference
package: client.authentication.k8s.io/v1beta1
auto_generated: true
---
<!--
title: Client Authentication (v1beta1)
content_type: tool-reference
package: client.authentication.k8s.io/v1beta1
auto_generated: true
-->
<!--
## Resource Types
-->
## 资源类型 {#resource-types}
- [ExecCredential](#client-authentication-k8s-io-v1beta1-ExecCredential)
@@ -20,11 +30,14 @@ auto_generated: true
<!--
ExecCredential is used by exec-based plugins to communicate credentials to
HTTP transports.
-->
ExecCredential 由基于 exec 的插件使用,与 HTTP 传输组件沟通凭据信息。
<table class="table">
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
<tbody>
<tr><td><code>apiVersion</code><br/>string</td><td><code>client.authentication.k8s.io/v1beta1</code></td></tr>
@@ -33,11 +46,13 @@ HTTP transports.
<tr><td><code>spec</code> <B>[Required]</B><br/>
<tr><td><code>spec</code> <B><!--[Required]-->[必需]</B><br/>
<a href="#client-authentication-k8s-io-v1beta1-ExecCredentialSpec"><code>ExecCredentialSpec</code></a>
</td>
<td>
Spec holds information passed to the plugin by the transport.</td>
<!--Spec holds information passed to the plugin by the transport.-->
字段 spec 包含由 HTTP 传输组件传递给插件的信息。
</td>
</tr>
@@ -45,8 +60,10 @@ HTTP transports.
<a href="#client-authentication-k8s-io-v1beta1-ExecCredentialStatus"><code>ExecCredentialStatus</code></a>
</td>
<td>
Status is filled in by the plugin and holds the credentials that the transport
should use to contact the API.</td>
<!--Status is filled in by the plugin and holds the credentials that the transport
should use to contact the API.-->
字段 status 由插件填充,包含传输组件与 API 服务器连接时需要提供的凭据。
</td>
</tr>
@@ -60,11 +77,13 @@ should use to contact the API.</td>
**Appears in:**
<!--**Appears in:**-->
**出现在:**
- [ExecCredentialSpec](#client-authentication-k8s-io-v1beta1-ExecCredentialSpec)
<!--
Cluster contains information to allow an exec plugin to communicate
with the kubernetes cluster being authenticated to.
@@ -72,18 +91,27 @@ To ensure that this struct contains everything someone would need to communicate
with a kubernetes cluster (just like they would via a kubeconfig), the fields
should shadow "k8s.io/client-go/tools/clientcmd/api/v1".Cluster, with the exception
of CertificateAuthority, since CA data will always be passed to the plugin as bytes.
-->
Cluster 中包含允许 exec 插件与 Kubernetes 集群进行通信身份认证时所需
的信息。
为了确保该结构体包含需要与 Kubernetes 集群进行通信的所有内容(就像通过 Kubeconfig 一样),
该字段应该映射到 "k8s.io/client-go/tools/clientcmd/api/v1".cluster
除了证书授权之外,由于 CA 数据将始终以字节形式传递给插件。
<table class="table">
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
<tbody>
<tr><td><code>server</code> <B>[Required]</B><br/>
<tr><td><code>server</code> <B><!--[Required]-->[必需]</B><br/>
<code>string</code>
</td>
<td>
Server is the address of the kubernetes cluster (https://hostname:port).</td>
<!--Server is the address of the kubernetes cluster (https://hostname:port).-->
字段 server 是 Kubernetes 集群的地址(https://hostname:port)。
</td>
</tr>
@@ -91,9 +119,14 @@ of CertificateAuthority, since CA data will always be passed to the plugin as by
<code>string</code>
</td>
<td>
<!--
TLSServerName is passed to the server for SNI and is used in the client to
check server certificates against. If ServerName is empty, the hostname
used to contact the server is used.</td>
used to contact the server is used.
-->
tls-server-name 是用来提供给服务器用作 SNI 解析的,客户端以此检查服务器的证书。
如此字段为空,则使用链接服务器时使用的主机名。
</td>
</tr>
@@ -101,8 +134,13 @@ used to contact the server is used.</td>
<code>bool</code>
</td>
<td>
<!--
InsecureSkipTLSVerify skips the validity check for the server's certificate.
This will make your HTTPS connections insecure.</td>
This will make your HTTPS connections insecure.
-->
设置此字段之后,会令客户端跳过对服务器端证书的合法性检查。
这会使得你的 HTTPS 链接不再安全。
</td>
</tr>
@@ -110,8 +148,13 @@ This will make your HTTPS connections insecure.</td>
<code>[]byte</code>
</td>
<td>
<!--
CAData contains PEM-encoded certificate authority certificates.
If empty, system roots should be used.</td>
If empty, system roots should be used.
-->
此字段包含 PEM 编码的证书机构(CA)证书。
如果为空,则使用系统的根证书。
</td>
</tr>
@@ -119,8 +162,9 @@ If empty, system roots should be used.</td>
<code>string</code>
</td>
<td>
ProxyURL is the URL to the proxy to be used for all requests to this
cluster.</td>
<!--ProxyURL is the URL to the proxy to be used for all requests to this cluster.-->
此字段用来设置向集群发送所有请求时要使用的代理服务器。
</td>
</tr>
@@ -128,27 +172,40 @@ cluster.</td>
<a href="https://godoc.org/k8s.io/apimachinery/pkg/runtime/#RawExtension"><code>k8s.io/apimachinery/pkg/runtime.RawExtension</code></a>
</td>
<td>
<!--
Config holds additional config data that is specific to the exec
plugin with regards to the cluster being authenticated to.
This data is sourced from the clientcmd Cluster object's
extensions[client.authentication.k8s.io/exec] field:
extensions[client.authentication.k8s.io/exec] field:
-->
<p>此字段包含一些额外的、特定于 exec 插件和所连接的集群的数据,</p>
<p>此字段来自于 clientcmd 集群对象的 <code>extensions[client.authentication.k8s.io/exec]</code>
字段:</p>
<pre>
clusters:
- name: my-cluster
cluster:
...
extensions:
- name: client.authentication.k8s.io/exec # reserved extension name for per cluster exec config
- name: client.authentication.k8s.io/exec # 针对每个集群 exec 配置所预留的扩展名称
extension:
audience: 06e3fbd18de8 # arbitrary config
audience: 06e3fbd18de8 # 任意配置信息
</pre>
<!--
In some environments, the user config may be exactly the same across many clusters
(i.e. call this exec plugin) minus some details that are specific to each cluster
such as the audience. This field allows the per cluster config to be directly
specified with the cluster info. Using this field to store secret data is not
recommended as one of the prime benefits of exec plugins is that no secrets need
to be stored directly in the kubeconfig.</td>
to be stored directly in the kubeconfig.
-->
<p>在某些环境中,用户配置可能对很多集群而言都完全一样(即调用同一个 exec 插件),
只是针对不同集群会有一些细节上的差异,例如 audience。
此字段使得特定于集群的配置可以直接使用集群信息来设置。
不建议使用此字段来保存 Secret 数据,因为 exec 插件的主要优势之一是不需要在
kubeconfig 中保存 Secret 数据。</p>
</td>
</tr>
@@ -162,16 +219,20 @@ to be stored directly in the kubeconfig.</td>
**Appears in:**
<!-- **Appears in:** -->
**出现在:**
- [ExecCredential](#client-authentication-k8s-io-v1beta1-ExecCredential)
<!--
ExecCredentialSpec holds request and runtime specific information provided by
the transport.
the transport.
-->
ExecCredentialSpec 保存传输组件所提供的特定于请求和运行时的信息。
<table class="table">
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
<tbody>
@@ -180,10 +241,16 @@ the transport.
<a href="#client-authentication-k8s-io-v1beta1-Cluster"><code>Cluster</code></a>
</td>
<td>
<!--
Cluster contains information to allow an exec plugin to communicate with the
kubernetes cluster being authenticated to. Note that Cluster is non-nil only
when provideClusterInfo is set to true in the exec provider config (i.e.,
ExecConfig.ProvideClusterInfo).</td>
ExecConfig.ProvideClusterInfo).
-->
此字段中包含的信息使得 exec 插件能够与要访问的 Kubernetes 集群通信。
注意,cluster 字段只有在 exec 驱动的配置中 provideClusterInfo
(即:ExecConfig.ProvideClusterInfo)被设置为 true 时才不能为空。
</td>
</tr>
@@ -197,20 +264,27 @@ ExecConfig.ProvideClusterInfo).</td>
**Appears in:**
<!-- **Appears in:** -->
**出现在:**
- [ExecCredential](#client-authentication-k8s-io-v1beta1-ExecCredential)
<!--
ExecCredentialStatus holds credentials for the transport to use.
Token and ClientKeyData are sensitive fields. This data should only be
transmitted in-memory between client and exec plugin process. Exec plugin
itself should at least be protected via file permissions.
-->
<p>ExecCredentialStatus 中包含传输组件要使用的凭据。</p>
<p>字段 token 和 clientKeyData 都是敏感字段。
此数据只能在客户端与 exec 插件进程之间使用内存来传递。
exec 插件本身至少应通过文件访问许可来实施保护。</p>
<table class="table">
<thead><tr><th width="30%">Field</th><th>Description</th></tr></thead>
<tbody>
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
@@ -218,31 +292,39 @@ itself should at least be protected via file permissions.
<a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#time-v1-meta"><code>meta/v1.Time</code></a>
</td>
<td>
ExpirationTimestamp indicates a time when the provided credentials expire.</td>
<!-- ExpirationTimestamp indicates a time when the provided credentials expire. -->
给出所提供的凭据到期的时间。
</td>
</tr>
<tr><td><code>token</code> <B>[Required]</B><br/>
<tr><td><code>token</code> <B><!--[Required]-->[必需]</B><br/>
<code>string</code>
</td>
<td>
Token is a bearer token used by the client for request authentication.</td>
<!-- Token is a bearer token used by the client for request authentication. -->
客户端用做请求身份认证的持有者令牌。
</td>
</tr>
<tr><td><code>clientCertificateData</code> <B>[Required]</B><br/>
<tr><td><code>clientCertificateData</code> <B><!--[Required]-->[必需]</B><br/>
<code>string</code>
</td>
<td>
PEM-encoded client TLS certificates (including intermediates, if any).</td>
<!-- PEM-encoded client TLS certificates (including intermediates, if any). -->
PEM 编码的客户端 TLS 证书(如果有临时证书,也会包含)。
</td>
</tr>
<tr><td><code>clientKeyData</code> <B>[Required]</B><br/>
<tr><td><code>clientKeyData</code> <B><!--[Required]-->[必需]</B><br/>
<code>string</code>
</td>
<td>
PEM-encoded private key for the above certificate.</td>
<!-- PEM-encoded private key for the above certificate. -->
与上述证书对应的、PEM 编码的私钥。
</td>
</tr>
@@ -0,0 +1,5 @@
---
title: "身份认证资源"
weight: 4
auto_generated: true
---
@@ -0,0 +1,7 @@
---
title: "鉴权资源"
weight: 5
auto_generated: true
---
@@ -0,0 +1,7 @@
---
title: "集群资源"
weight: 8
auto_generated: true
---
@@ -0,0 +1,400 @@
---
api_metadata:
apiVersion: ""
import: "k8s.io/apimachinery/pkg/apis/meta/v1"
kind: "ObjectMeta"
content_type: "api_reference"
description: "ObjectMeta 是所有持久化资源必须具有的元数据,其中包括用户必须创建的所有对象。"
title: "ObjectMeta"
weight: 7
auto_generated: true
---
<!--
api_metadata:
apiVersion: ""
import: "k8s.io/apimachinery/pkg/apis/meta/v1"
kind: "ObjectMeta"
content_type: "api_reference"
description: "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create."
title: "ObjectMeta"
weight: 7
auto_generated: true
-->
<!--
The file is auto-generated from the Go source code of the component using a generic
[generator](https://github.com/kubernetes-sigs/reference-docs/). To learn how
to generate the reference documentation, please read
[Contributing to the reference documentation](/docs/contribute/generate-ref-docs/).
To update the reference content, please follow the
[Contributing upstream](/docs/contribute/generate-ref-docs/contribute-upstream/)
guide. You can file document formatting bugs against the
[reference-docs](https://github.com/kubernetes-sigs/reference-docs/) project.
-->
`import "k8s.io/apimachinery/pkg/apis/meta/v1"`
<!--
ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.
-->
ObjectMeta 是所有持久化资源必须具有的元数据,其中包括用户必须创建的所有对象。
<hr>
- **name** (string)
<!--
Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names
-->
name 在命名空间内必须是唯一的。创建资源时需要,尽管某些资源可能允许客户端请求自动地生成适当的名称。
名称主要用于创建幂等性和配置定义。无法更新。
更多信息:http://kubernetes.io/docs/user-guide/identifiers#names
- **generateName** (string)
<!--
GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.
-->
generateName 是一个可选前缀,由服务器使用,**仅在**未提供 name 字段时生成唯一名称。
如果使用此字段,则返回给客户端的名称将与传递的名称不同。该值还将与唯一的后缀组合。
提供的值与 name 字段具有相同的验证规则,并且可能会根据所需的后缀长度被截断,以使该值在服务器上唯一。
<!--
If this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).
Applied only if Name is not specified. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency
-->
如果指定了此字段并且生成的名称存在,则服务器将不会返回 409 ——相反,它将返回 201 Created 或 500
原因是 ServerTimeout 指示在分配的时间内找不到唯一名称,客户端应重试(可选,在 Retry-After 标头中指定的时间之后)。
仅在未指定 name 时应用。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency
- **namespace** (string)
<!--
Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.
Must be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces
-->
namespace 定义了一个值空间,其中每个名称必须唯一。空命名空间相当于 “default” 命名空间,但 “default” 是规范表示。
并非所有对象都需要限定在命名空间中——这些对象的此字段的值将为空。
必须是 DNS_LABEL。无法更新。更多信息:http://kubernetes.io/docs/user-guide/namespaces
- **labels** (map[string]string)
<!--
Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels
-->
可用于组织和分类(确定范围和选择)对象的字符串键和值的映射。
可以匹配 ReplicationControllers 和 Service 的选择器。更多信息:http://kubernetes.io/docs/user-guide/labels
- **annotations** (map[string]string)
<!--
Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations
-->
annotations 是一个非结构化的键值映射,存储在资源中,可以由外部工具设置以存储和检索任意元数据。
它们不可查询,在修改对象时应保留。更多信息:http://kubernetes.io/docs/user-guide/annotations
<!-- ### System {#System} -->
### 系统字段 {#System}
- **finalizers** ([]string)
<!--
Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list.
-->
在从注册表中删除对象之前该字段必须为空。
每个条目都是负责的组件的标识符,各组件将从列表中删除自己对应的条目。
如果对象的 deletionTimestamp 非空,则只能删除此列表中的条目。
终结器可以按任何顺序处理和删除。**没有**按照顺序执行,
因为它引入了终结器卡住的重大风险。finalizers 是一个共享字段,
任何有权限的参与者都可以对其进行重新排序。如果按顺序处理终结器列表,
那么这可能导致列表中第一个负责终结器的组件正在等待列表中靠后负责终结器的组件产生的信号(字段值、外部系统或其他),
从而导致死锁。在没有强制排序的情况下,终结者可以在它们之间自由排序,
并且不容易受到列表中排序更改的影响。
- **managedFields** ([]ManagedFieldsEntry)
<!--
ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object.
-->
managedFields 将 workflow-id 和版本映射到由该工作流管理的字段集。
这主要用于内部管理,用户通常不需要设置或理解该字段。
工作流可以是用户名、控制器名或特定应用路径的名称,如 “ci-cd”。
字段集始终存在于修改对象时工作流使用的版本。
<a name="ManagedFieldsEntry"></a>
<!--
*ManagedFieldsEntry is a workflow-id, a FieldSet and the group version of the resource that the fieldset applies to.*
-->
ManagedFieldsEntry 是一个 workflow-id,一个 FieldSet,也是该字段集适用的资源的组版本。
- **managedFields.apiVersion** (string)
<!--
APIVersion defines the version of this resource that this field set applies to. The format is "group/version" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted.
-->
apiVersion 定义此字段集适用的资源的版本。
格式是 “group/version”,就像顶级 apiVersion 字段一样。
必须跟踪字段集的版本,因为它不能自动转换。
- **managedFields.fieldsType** (string)
<!--
FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: "FieldsV1"
-->
FieldsType 是不同字段格式和版本的鉴别器。
目前只有一个可能的值:“FieldsV1”
- **managedFields.fieldsV1** (FieldsV1)
<!-- FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. -->
FieldsV1 包含类型 “FieldsV1” 中描述的第一个 JSON 版本格式。
<a name="FieldsV1"></a>
<!--
*FieldsV1 stores a set of fields in a data structure like a Trie, in JSON format.
Each key is either a '.' representing the field itself, and will always map to an empty set,
or a string representing a sub-field or item. The string will follow one of these four formats:
'f:<name>', where <name> is the name of a field in a struct, or key in a map
'v:<value>', where <value> is the exact json formatted value of a list item
'i:<index>', where <index> is position of a item in a list
'k:<keys>', where <keys> is a map of a list item's key fields to their unique values
If a key maps to an empty Fields value, the field that key represents is part of the set.
The exact format is defined in sigs.k8s.io/structured-merge-diff*
-->
FieldsV1 以 JSON 格式将一组字段存储在像 Trie 这样的数据结构中。
每个键或是 `.` 表示字段本身,并且始终映射到一个空集,
或是一个表示子字段或元素的字符串。该字符串将遵循以下四种格式之一:
1. `f:<name>`,其中 `<name>` 是结构中字段的名称,或映射中的键
2. `v:<value>`,其中 `<value>` 是列表项的精确 json 格式值
3. `i:<index>`,其中 `<index>` 是列表中项目的位置
4. `k:<keys>`,其中 `<keys>` 是列表项的关键字段到其唯一值的映射
如果一个键映射到一个空的 Fields 值,则该键表示的字段是集合的一部分。
确切的格式在 sigs.k8s.io/structured-merge-diff 中定义。
- **managedFields.manager** (string)
<!-- Manager is an identifier of the workflow managing these fields. -->
manager 是管理这些字段的工作流的标识符。
- **managedFields.operation** (string)
<!--
Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'.
-->
operation 是导致创建此 managedFields 表项的操作类型。
此字段的仅有合法值是 “Apply” 和 “Update”。
- **managedFields.subresource** (string)
<!--
Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource.
-->
subresource 是用于更新该对象的子资源的名称,如果对象是通过主资源更新的,则为空字符串。
该字段的值用于区分管理者,即使他们共享相同的名称。例如,状态更新将不同于使用相同管理者名称的常规更新。
请注意,apiVersion 字段与 subresource 字段无关,它始终对应于主资源的版本。
- **managedFields.time** (Time)
<!--
Time is timestamp of when these fields were set. It should always be empty if Operation is 'Apply'
-->
time 是设置这些字段的时间戳。如果 operation 为 “Apply”,则它应始终为空
<a name="Time"></a>
<!--
*Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.*
-->
time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。
为 time 包提供的许多工厂方法提供了包装类。
- **ownerReferences** ([]OwnerReference)
<!--
*Patch strategy: merge on key `uid`*
List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.
-->
补丁策略:在键 `uid` 上执行合并操作
此对象所依赖的对象列表。如果列表中的所有对象都已被删除,则该对象将被垃圾回收。
如果此对象由控制器管理,则此列表中的条目将指向此控制器,controller 字段设置为 true。
管理控制器不能超过一个。
<a name="OwnerReference"></a>
<!--
*OwnerReference contains enough information to let you identify an owning object. An owning object must be in the same namespace as the dependent, or be cluster-scoped, so there is no namespace field.*
-->
OwnerReference 包含足够可以让你识别拥有对象的信息。
拥有对象必须与依赖对象位于同一命名空间中,或者是集群作用域的,因此没有命名空间字段。
- **ownerReferences.apiVersion** (string)<!-- required -->必选
<!-- API version of the referent. -->
被引用资源的 API 版本。
- **ownerReferences.kind** (string)<!-- required -->必选
<!-- Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds -->
被引用资源的类别。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- **ownerReferences.name** (string)<!-- required -->必选
<!-- Name of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#names -->
被引用资源的名称。更多信息:http://kubernetes.io/docs/user-guide/identifiers#names
- **ownerReferences.uid** (string)<!-- required -->必选
<!-- UID of the referent. More info: http://kubernetes.io/docs/user-guide/identifiers#uids -->
被引用资源的 uid。更多信息:http://kubernetes.io/docs/user-guide/identifiers#uids
- **ownerReferences.blockOwnerDeletion** (boolean)
<!--
If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned.
-->
如果为 true,**并且**如果所有者具有 “foregroundDeletion” 终结器,
则在删除此引用之前,无法从键值存储中删除所有者。
默认为 false。要设置此字段,用户需要所有者的 “delete” 权限,
否则将返回 422 (Unprocessable Entity)。
- **ownerReferences.controller** (boolean)
<!-- If true, this reference points to the managing controller. -->
如果为 true,则此引用指向管理的控制器。
<!-- ### Read-only {#Read-only} -->
### 只读字段 {#Read-only}
- **creationTimestamp** (Time)
<!--
CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.
Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
-->
creationTimestamp 是一个时间戳,表示创建此对象时的服务器时间。
不能保证在单独的操作中按发生前的顺序设置。
客户端不得设置此值。它以 RFC3339 形式表示,并采用 UTC。
由系统填充。只读。列表为空。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
<a name="Time"></a>
<!--
*Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.*
-->
time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。
为 time 包提供的许多工厂方法提供了包装类。
- **deletionGracePeriodSeconds** (int64)
<!--
Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.
-->
此对象从系统中删除之前允许正常终止的秒数。
仅当设置了 deletionTimestamp 时才设置。
只能缩短。只读。
- **deletionTimestamp** (Time)
<!--
DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.
Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
-->
deletionTimestamp 是删除此资源的 RFC 3339 日期和时间。
该字段在用户请求优雅删除时由服务器设置,客户端不能直接设置。
一旦 finalizers 列表为空,该资源预计将在此字段中的时间之后被删除
(不再从资源列表中可见,并且无法通过名称访问)。
只要 finalizers 列表包含项目,就阻止删除。一旦设置了 deletionTimestamp
该值可能不会被取消设置或在未来进一步设置,尽管它可能会缩短或在此时间之前可能会删除资源。
例如,用户可能要求在 30 秒内删除一个 Pod。
Kubelet 将通过向 Pod 中的容器发送优雅的终止信号来做出反应。
30 秒后,Kubelet 将向容器发送硬终止信号(SIGKILL),
并在清理后从 API 中删除 Pod。在网络存在分区的情况下,
此对象可能在此时间戳之后仍然存在,直到管理员或自动化进程可以确定资源已完全终止。
如果未设置,则未请求优雅删除该对象。
请求优雅删除时由系统填充。只读。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
<a name="Time"></a>
<!--
*Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.*
-->
“Time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。
为 time 包提供的许多工厂方法提供了包装类。”
- **generation** (int64)
<!--
A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.
-->
表示期望状态的特定生成的序列号。由系统填充。只读。
- **resourceVersion** (string)
<!--
An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.
Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
-->
一个不透明的值,表示此对象的内部版本,客户端可以使用该值来确定对象是否已被更改。
可用于乐观并发、变更检测以及对资源或资源集的监听操作。
客户端必须将这些值视为不透明的,且未更改地传回服务器。
它们可能仅对特定资源或一组资源有效。
由系统填充。只读。客户端必须将值视为不透明。
更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
- **selfLink** (string)
<!--
SelfLink is a URL representing this object. Populated by the system. Read-only.
DEPRECATED Kubernetes will stop propagating this field in 1.20 release and the field is planned to be removed in 1.21 release.
-->
selfLink 是表示此对象的 URL。由系统填充。只读。
**已弃用**。Kubernetes 将在 1.20 版本中停止传播该字段,并计划在 1.21 版本中删除该字段。
- **uid** (string)
<!--
UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.
Populated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids
-->
UID 是该对象在时间和空间上的唯一值。它通常由服务器在成功创建资源时生成,并且不允许使用 PUT 操作更改。
由系统填充。只读。更多信息:http://kubernetes.io/docs/user-guide/identifiers#uids
<!-- ### Ignored {#Ignored} -->
### 忽略字段 {#Ignored}
- **clusterName** (string)
<!--
The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.
-->
对象所属的集群的名称。这用于区分不同集群中具有相同名称和命名空间的资源。
该字段现在没有在任何地方设置,如果在创建或更新请求中设置,apiserver 将忽略它。
@@ -0,0 +1,208 @@
---
api_metadata:
apiVersion: ""
import: "k8s.io/apimachinery/pkg/apis/meta/v1"
kind: "Status"
content_type: "api_reference"
description: "状态(Status)是不返回其他对象的调用的返回值。"
title: "Status"
weight: 12
auto_generated: true
---
<!--
api_metadata:
apiVersion: ""
import: "k8s.io/apimachinery/pkg/apis/meta/v1"
kind: "Status"
content_type: "api_reference"
description: "Status is a return value for calls that don't return other objects."
title: "Status"
weight: 12
auto_generated: true
-->
<!--
The file is auto-generated from the Go source code of the component using a generic
[generator](https://github.com/kubernetes-sigs/reference-docs/). To learn how
to generate the reference documentation, please read
[Contributing to the reference documentation](/docs/contribute/generate-ref-docs/).
To update the reference content, please follow the
[Contributing upstream](/docs/contribute/generate-ref-docs/contribute-upstream/)
guide. You can file document formatting bugs against the
[reference-docs](https://github.com/kubernetes-sigs/reference-docs/) project.
-->
`import "k8s.io/apimachinery/pkg/apis/meta/v1"`
<!-- Status is a return value for calls that don't return other objects. -->
状态(Status)是不返回其他对象的调用的返回值。
<hr>
- **apiVersion** (string)
<!--
APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
-->
APIVersion 定义对象表示的版本化模式。
服务器应将已识别的模式转换为最新的内部值,并可能拒绝无法识别的值。
更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
- **code** (int32)
<!-- Suggested HTTP return code for this status, 0 if not set. -->
此状态的建议 HTTP 返回代码,如果未设置,则为 0。
- **details** (StatusDetails)
<!--
Extended data associated with the reason. Each reason may define its own extended details.
This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type.
-->
与原因(Reason)相关的扩展数据。每个原因都可以定义自己的扩展细节。
此字段是可选的,并且不保证返回的数据符合任何模式,除非由原因类型定义。
<a name="StatusDetails"></a>
<!--
*StatusDetails is a set of additional properties that MAY be set by the server to provide additional information about a response.
The Reason field of a Status object defines what attributes will be set.
Clients must ignore fields that do not match the defined type of each attribute,
and should assume that any attribute may be empty, invalid, or under defined.*
-->
*StatusDetails 是一组附加属性,可以由服务器设置以提供有关响应的附加信息。*
*状态对象的原因字段定义将设置哪些属性。*
*客户端必须忽略与每个属性的定义类型不匹配的字段,并且应该假定任何属性可能为空、无效或未定义。*
- **details.causes** ([]StatusCause)
<!--
The Causes array includes more details associated with the StatusReason failure.
Not all StatusReasons may provide detailed causes.
-->
Causes 数组包含与 StatusReason 故障相关的更多详细信息。
并非所有 StatusReasons 都可以提供详细的原因。
<a name="StatusCause"></a>
<!--
*StatusCause provides more information about an api.Status failure, including cases when multiple errors are encountered.*
-->
*StatusCause 提供有关 api.Status 失败的更多信息,包括遇到多个错误的情况。*
- **details.causes.field** (string)
<!--
The field of the resource that has caused this error, as named by its JSON serialization.
May include dot and postfix notation for nested attributes. Arrays are zero-indexed.
Fields may appear more than once in an array of causes due to fields having multiple errors. Optional.
-->
导致此错误的资源字段,由其 JSON 序列化命名。
可能包括嵌套属性的点和后缀表示法。数组是从零开始索引的。
由于字段有多个错误,字段可能会在一系列原因中出现多次。可选。
<!--
Examples:
"name" - the field "name" on the current resource
"items[0].name" - the field "name" on the first array entry in "items"
-->
示例:
- “name”:当前资源上的字段 “name”
- “items[0].name”:“items” 中第一个数组条目上的字段 “name”
- **details.causes.message** (string)
<!-- A human-readable description of the cause of the error. This field may be presented as-is to a reader. -->
对错误原因的可读描述。该字段可以按原样呈现给读者。
- **details.causes.reason** (string)
<!-- A machine-readable description of the cause of the error. If this value is empty there is no information available. -->
错误原因的机器可读描述。如果此值为空,则没有可用信息。
- **details.group** (string)
<!-- The group attribute of the resource associated with the status StatusReason. -->
与状态 StatusReason 关联的资源的组属性。
- **details.kind** (string)
<!--
The kind attribute of the resource associated with the status StatusReason.
On some operations may differ from the requested resource Kind.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
-->
与状态 StatusReason 关联的资源的种类属性。
在某些操作上可能与请求的资源种类不同。
更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- **details.name** (string)
<!-- The name attribute of the resource associated with the status StatusReason (when there is a single name which can be described). -->
与状态 StatusReason 关联的资源的名称属性(当有一个可以描述的名称时)。
- **details.retryAfterSeconds** (int32)
<!--
If specified, the time in seconds before the operation should be retried.
Some errors may indicate the client must take an alternate action -
for those errors this field may indicate how long to wait before taking the alternate action.
-->
如果指定,则应重试操作前的时间(以秒为单位)。
一些错误可能表明客户端必须采取替代操作——对于这些错误,此字段可能指示在采取替代操作之前等待多长时间。
- **details.uid** (string)
<!--
UID of the resource. (when there is a single resource which can be described).
More info: http://kubernetes.io/docs/user-guide/identifiers#uids
-->
资源的 UID(当有单个可以描述的资源时)。
更多信息:http://kubernetes.io/docs/user-guide/identifiers#uids
- **kind** (string)
<!--
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated. In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
-->
Kind 是一个字符串值,表示此对象表示的 REST 资源。
服务器可以从客户端提交请求的端点推断出这一点。
无法更新。驼峰式规则。
更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- **message** (string)
<!-- A human-readable description of the status of this operation. -->
此操作状态的人类可读描述。
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
<!-- Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds -->
标准列表元数据。
更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
- **reason** (string)
<!--
A machine-readable description of why this operation is in the "Failure" status.
If this value is empty there is no information available.
A Reason clarifies an HTTP status code but does not override it.
-->
机器可读的说明,说明此操作为何处于“失败”状态。
如果此值为空,则没有可用信息。
Reason 澄清了 HTTP 状态代码,但不会覆盖它。
- **status** (string)
<!--
Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
-->
操作状态。“Success”或“Failure” 之一。
更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
@@ -0,0 +1,220 @@
---
api_metadata:
apiVersion: ""
import: ""
kind: "Common Parameters"
content_type: "api_reference"
description: ""
title: "常用参数"
weight: 10
auto_generated: true
---
<!--
The file is auto-generated from the Go source code of the component using a generic
[generator](https://github.com/kubernetes-sigs/reference-docs/). To learn how
to generate the reference documentation, please read
[Contributing to the reference documentation](/docs/contribute/generate-ref-docs/).
To update the reference content, please follow the
[Contributing upstream](/docs/contribute/generate-ref-docs/contribute-upstream/)
guide. You can file document formatting bugs against the
[reference-docs](https://github.com/kubernetes-sigs/reference-docs/) project.
-->
## allowWatchBookmarks {#allowWatchBookmarks}
<!--
allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored.
<hr>
-->
allowWatchBookmarks 字段请求类型为 BOOKMARK 的监视事件。
没有实现书签的服务器可能会忽略这个标志,并根据服务器的判断发送书签。
客户端不应该假设书签会在任何特定的时间间隔返回,也不应该假设服务器会在会话期间发送任何书签事件。
如果当前请求不是 watch 请求,则忽略该字段。
<hr>
## continue {#continue}
<!--
The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token.
-->
当需要从服务器检索更多结果时,应该设置 continue 选项。由于这个值是服务器定义的,
客户端只能使用先前查询结果中具有相同查询参数的 continue 值(continue值除外)
服务器可能拒绝它识别不到的 continue 值。
如果指定的 continue 值不再有效,无论是由于过期(通常是 5 到 15 分钟)
还是服务器上的配置更改,服务器将响应 "410 ResourceExpired" 错误和一个 continue 令牌。
<!--
If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key".
-->
如果客户端需要一个一致的列表,它必须在没有 continue 字段的情况下重新发起 list 请求。
否则,客户端可能会发送另一个带有 410 错误令牌的 list 请求,服务器将响应从下一个键开始的列表,
但列表数据来自最新的快照,这与之前
的列表结果不一致。第一个列表请求之后的对象创建,修改,或删除的对象将被包含在响应中,
只要他们的键是在“下一个键”之后。
<!--
This field is not supported when watch is true. Clients may start a watch from the last resourceVersion value returned by the server and not miss any modifications.
-->
当 watch 字段为 true 时,不支持此字段。客户端可以从服务器返回的最后一个 resourceVersion 值开始监视,就不会错过任何修改。
<hr>
## dryRun {#dryRun}
<!--
When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed
<hr>
-->
表示不应该持久化所请求的修改。无效或无法识别的 dryRun 指令将导致错误响应,
并且服务器不再对请求进行进一步处理。有效值为:
- All: 将处理所有的演练阶段
<hr>
## fieldManager {#fieldManager}
<!--
fieldManager is a name associated with the actor or entity that is making these changes. The value must be less than or 128 characters long, and only contain printable characters, as defined by https://golang.org/pkg/unicode/#IsPrint.
<hr>
-->
fieldManager 是与进行这些更改的参与者或实体相关联的名称。
长度小于或128个字符且仅包含可打印字符,如 https://golang.org/pkg/unicode/#IsPrint 所定义。
<hr>
## fieldSelector {#fieldSelector}
<!--
A selector to restrict the list of returned objects by their fields. Defaults to everything.
<hr>
-->
根据返回对象的字段限制返回对象列表的选择器。默认为返回所有字段。
<hr>
## force {#force}
<!--
Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests.
<hr>
-->
Force 将“强制”应用请求。这意味着用户将重新获得他人拥有的冲突领域。
对于非应用补丁请求,Force 标志必须不设置。
<hr>
## gracePeriodSeconds {#gracePeriodSeconds}
<!--
The duration in seconds before the object should be deleted. Value must be non-negative integer. The value zero indicates delete immediately. If this value is nil, the default grace period for the specified type will be used. Defaults to a per object value if not specified. zero means delete immediately.
<hr>
-->
删除对象前的持续时间(秒数)。值必须为非负整数。取值为 0 表示立即删除。
如果该值为 nil,将使用指定类型的默认宽限期。如果没有指定,默认为每个对象的设置值。0 表示立即删除。
<hr>
## labelSelector {#labelSelector}
<!--
A selector to restrict the list of returned objects by their labels. Defaults to everything.
<hr>
-->
通过标签限制返回对象列表的选择器。默认为返回所有对象。
<hr>
## limit {#limit}
<!--
limit is a maximum number of responses to return for a list call. If more items exist, the server will set the `continue` field on the list metadata to a value that can be used with the same initial query to retrieve the next set of results.
-->
limit 是一个列表调用返回的最大响应数。如果有更多的条目,服务器会将列表元数据上的
'continue' 字段设置为一个值,该值可以用于相同的初始查询来检索下一组结果。
<!--
Setting a limit may return fewer than the requested amount of items (up to zero items) in the event all requested objects are filtered out and clients should only use the presence of the continue field to determine whether more results are available. Servers may choose not to support the limit argument and will return all of the available results. If limit is specified and the continue field is empty, clients may assume that no more results are available. This field is not supported if watch is true.
-->
设置 limit 可能会在所有请求的对象被过滤掉的情况下返回少于请求的条目数量(下限为零),
并且客户端应该只根据 continue 字段是否存在来确定是否有更多的结果可用。
服务器可能选择不支持 limit 参数,并将返回所有可用的结果。
如果指定了 limit 并且 continue 字段为空,客户端可能会认为没有更多的结果可用。
如果 watch 为 true,则不支持此字段。
<!--
The server guarantees that the objects returned when using continue will be identical to issuing a single list call without a limit - that is, no objects created, modified, or deleted after the first request is issued will be included in any subsequent continued requests.
-->
服务器保证在使用 continue 时返回的对象将与不带 limit 的列表调用相同,——
也就是说,在发出第一个请求后所创建、修改或删除的对象将不包含在任何后续的继续请求中。
<!--
This is sometimes referred to as a consistent snapshot, and ensures that a client that is using limit to receive smaller chunks of a very large result can ensure they see all possible objects. If objects are updated during a chunked list the version of the object that was present at the time the first list result was calculated is returned.
<hr>
-->
这有时被称为一致性快照,确保使用 limit 的客户端在分块接收非常大的结果的客户端能够看到所有可能的对象。
如果对象在分块列表期间被更新,则返回计算第一个列表结果时存在的对象版本。
<hr>
## namespace {#namespace}
<!--
object name and auth scope, such as for teams and projects
<hr>
-->
对象名称和身份验证范围,例如用于团队和项目。
<hr>
## pretty {#pretty}
<!--
If 'true', then the output is pretty printed.
<hr>
-->
如果设置为 'true' ,那么输出是规范的打印。
<hr>
## propagationPolicy {#propagationPolicy}
<!--
Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground.
<hr>
-->
该字段决定是否以及如何执行垃圾收集。可以设置此字段或 OrphanDependents,但不能同时设置。
默认策略由 metadata.finalizers 和特定资源的默认策略设置决定。可接受的值是:
- 'Orphan':孤立依赖项;
- 'Background':允许垃圾回收器后台删除依赖;
- 'Foreground':一个级联策略,前台删除所有依赖项。
<hr>
## resourceVersion {#resourceVersion}
<!--
resourceVersion sets a constraint on what resource versions a request may be served from. See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
Defaults to unset
<hr>
-->
resourceVersion 对请求所针对的资源版本设置约束。
详情请参见 https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions。
默认不设置
<hr>
## resourceVersionMatch {#resourceVersionMatch}
<!--
resourceVersionMatch determines how resourceVersion is applied to list calls. It is highly recommended that resourceVersionMatch be set for list calls where resourceVersion is set See https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions for details.
Defaults to unset
<hr>
-->
resourceVersionMatch 字段决定如何将 resourceVersion 应用于列表调用。
强烈建议对设置了 resourceVersion 的列表调用设置 resourceVersion 匹配,
具体请参见 https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions。
默认不设置
<hr>
## timeoutSeconds {#timeoutSeconds}
<!--
Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity.
<hr>
-->
list/watch 调用的超时秒数。这选项限制调用的持续时间,无论是否有活动。
<hr>
## watch {#watch}
<!--
Watch for changes to the described resources and return them as a stream of add, update, and remove notifications. Specify resourceVersion.
<hr>
-->
监视对所述资源的更改,并将其这类变更以添加、更新和删除通知流的形式返回。指定 resourceVersion。
<hr>
@@ -0,0 +1,7 @@
---
title: "配置和存储资源"
weight: 3
auto_generated: true
---
@@ -0,0 +1,8 @@
---
title: "扩展资源"
weight: 7
auto_generated: true
---
@@ -0,0 +1,7 @@
---
title: "策略资源"
weight: 6
auto_generated: true
---
@@ -0,0 +1,7 @@
---
title: "Service 资源"
weight: 2
auto_generated: true
---
@@ -0,0 +1,6 @@
---
title: "工作负载资源"
weight: 1
auto_generated: true
---
+460 -155
View File
@@ -22,7 +22,7 @@ file and passing its path as a command line argument.
<!--
A scheduling Profile allows you to configure the different stages of scheduling
in the {{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}}.
Each stage is exposed in a extension point. Plugins provide scheduling behaviors
Each stage is exposed in an extension point. Plugins provide scheduling behaviors
by implementing one or more of these extension points.
-->
调度模板(Profile)允许你配置 {{< glossary_tooltip text="kube-scheduler" term_id="kube-scheduler" >}}
@@ -31,17 +31,19 @@ by implementing one or more of these extension points.
<!--
You can specify scheduling profiles by running `kube-scheduler --config <filename>`,
using the
[KubeSchedulerConfiguration (v1beta1)](/docs/reference/config-api/kube-scheduler-config.v1beta1/)
KubeSchedulerConfiguration ([v1beta2](/docs/reference/config-api/kube-scheduler-config.v1beta2/)
or [v1beta3](/docs/reference/config-api/kube-scheduler-config.v1beta3/))
struct.
-->
你可以通过运行 `kube-scheduler --config <filename>` 来设置调度模板,
使用 [KubeSchedulerConfiguration (v1beta1)](/docs/reference/config-api/kube-scheduler-config.v1beta1/) 结构体。
使用 KubeSchedulerConfiguration [v1beta2](/zh/docs/reference/config-api/kube-scheduler-config.v1beta2/)
或者 [v1beta3](/zh/docs/reference/config-api/kube-scheduler-config.v1beta3/) 结构体。
<!-- A minimal configuration looks as follows: -->
最简单的配置如下:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta1
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
clientConnection:
kubeconfig: /etc/srv/kubernetes/kube-scheduler/kubeconfig
@@ -77,62 +79,74 @@ extension points:
调度行为发生在一系列阶段中,这些阶段是通过以下扩展点公开的:
<!--
1. `QueueSort`: These plugins provide an ordering function that is used to
1. `queueSort`: These plugins provide an ordering function that is used to
sort pending Pods in the scheduling queue. Exactly one queue sort plugin
may be enabled at a time.
-->
1. `QueueSort`:这些插件对调度队列中的悬决的 Pod 排序。
1. `queueSort`:这些插件对调度队列中的悬决的 Pod 排序。
一次只能启用一个队列排序插件。
<!--
2. `PreFilter`: These plugins are used to pre-process or check information
2. `preFilter`: These plugins are used to pre-process or check information
about a Pod or the cluster before filtering. They can mark a pod as
unschedulable.
-->
2. `PreFilter`:这些插件用于在过滤之前预处理或检查 Pod 或集群的信息。
2. `preFilter`:这些插件用于在过滤之前预处理或检查 Pod 或集群的信息。
它们可以将 Pod 标记为不可调度。
<!--
3. `Filter`: These plugins are the equivalent of Predicates in a scheduling
3. `filter`: These plugins are the equivalent of Predicates in a scheduling
Policy and are used to filter out nodes that can not run the Pod. Filters
are called in the configured order. A pod is marked as unschedulable if no
nodes pass all the filters.
-->
3. `Filter`:这些插件相当于调度策略中的断言(Predicates),用于过滤不能运行 Pod 的节点。
3. `filter`:这些插件相当于调度策略中的断言(Predicates),用于过滤不能运行 Pod 的节点。
过滤器的调用顺序是可配置的。
如果没有一个节点通过所有过滤器的筛选,Pod 将会被标记为不可调度。
<!--
4. `PreScore`: This is an informational extension point that can be used
4. `postFilter`: These plugins are called in their configured order when no
feasible nodes were found for the pod. If any `postFilter` plugin marks the
Pod _schedulable_, the remaining plugins are not called.
-->
4. `postFilter`:当无法为 Pod 找到可用节点时,按照这些插件的配置顺序调用他们。
如果任何 `postFilter` 插件将 Pod 标记为“可调度”,则不会调用其余插件。
<!--
1. `preScore`: This is an informational extension point that can be used
for doing pre-scoring work.
-->
4. `PreScore`:这是一个信息扩展点,可用于预打分工作。
5. `preScore`:这是一个信息扩展点,可用于预打分工作。
<!--
5. `Score`: These plugins provide a score to each node that has passed the
6. `score`: These plugins provide a score to each node that has passed the
filtering phase. The scheduler will then select the node with the highest
weighted scores sum.
-->
5. `Score`:这些插件给通过筛选阶段的节点打分。调度器会选择得分最高的节点。
6. `score`:这些插件给通过筛选阶段的节点打分。调度器会选择得分最高的节点。
<!--
6. `Reserve`: This is an informational extension point that notifies plugins
7. `reserve`: This is an informational extension point that notifies plugins
when resources have been reserved for a given Pod. Plugins also implement an
`Unreserve` call that gets called in the case of failure during or after
`Reserve`.
-->
6. `Reserve`:这是一个信息扩展点,当资源已经预留给 Pod 时,会通知插件。
7. `reserve`:这是一个信息扩展点,当资源已经预留给 Pod 时,会通知插件。
这些插件还实现了 `Unreserve` 接口,在 `Reserve` 期间或之后出现故障时调用。
<!-- 7. `Permit`: These plugins can prevent or delay the binding of a Pod. -->
7. `Permit`:这些插件可以阻止或延迟 Pod 绑定。
<!-- 8. `PreBind`: These plugins perform any work required before a Pod is bound.-->
8. `PreBind`:这些插件在 Pod 绑定节点之前执行。
<!-- 8. `permit`: These plugins can prevent or delay the binding of a Pod. -->
8. `permit`:这些插件可以阻止或延迟 Pod 绑定。
<!-- 9. `preBind`: These plugins perform any work required before a Pod is bound.-->
9. `preBind`:这些插件在 Pod 绑定节点之前执行。
<!--
9. `Bind`: The plugins bind a Pod to a Node. Bind plugins are called in order
10. `bind`: The plugins bind a Pod to a Node. Bind plugins are called in order
and once one has done the binding, the remaining plugins are skipped. At
least one bind plugin is required.
-->
9. `Bind`:这个插件将 Pod 与节点绑定。绑定插件是按顺序调用的,只要有一个插件完成了绑定,其余插件都会跳过。绑定插件至少需要一个。
10. `bind`:这个插件将 Pod 与节点绑定。绑定插件是按顺序调用的,只要有一个插件完成了绑定,其余插件都会跳过。绑定插件至少需要一个。
<!--
10. `PostBind`: This is an informational extension point that is called after
11. `postBind`: This is an informational extension point that is called after
a Pod has been bound.
-->
10. `PostBind`:这是一个信息扩展点,在 Pod 绑定了节点之后调用。
11. `postBind`:这是一个信息扩展点,在 Pod 绑定了节点之后调用。
<!--
12. `multiPoint`: This is a config-only field that allows plugins to be enabled
or disabled for all of their applicable extension points simultaneously.
-->
12. `multiPoint`:这是一个仅配置字段,允许同时为所有适用的扩展点启用或禁用插件。
<!--
For each extension point, you could disable specific [default plugins](#scheduling-plugins)
@@ -141,13 +155,13 @@ or enable your own. For example:
对每个扩展点,你可以禁用[默认插件](#scheduling-plugins)或者是启用自己的插件,例如:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta1
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
profiles:
- plugins:
score:
disabled:
- name: NodeResourcesLeastAllocated
- name: PodTopologySpread
enabled:
- name: MyCustomPluginA
weight: 2
@@ -164,16 +178,7 @@ desired.
如果需要,这个字段也可以用来对插件重新顺序。
<!-- ### Scheduling plugins -->
### 调度插件 {#scheduling-plugin}
<!--
1. `UnReserve`: This is an informational extension point that is called if
a Pod is rejected after being reserved and put on hold by a `Permit` plugin.
-->
1. `UnReserve`:这是一个信息扩展点,如果一个 Pod 在预留后被拒绝,并且被 `Permit` 插件搁置,它就会被调用。
<!-- ## Scheduling plugins -->
## 调度插件 {#scheduling-plugins}
### 调度插件 {#scheduling-plugins}
<!--
The following plugins, enabled by default, implement one or more of these
@@ -181,200 +186,175 @@ extension points:
-->
下面默认启用的插件实现了一个或多个扩展点:
<!--
- `SelectorSpread`: Favors spreading across nodes for Pods that belong to
{{< glossary_tooltip text="Services" term_id="service" >}},
{{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} and
{{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}}.
Extension points: `PreScore`, `Score`.
-->
- `SelectorSpread`:对于属于 {{< glossary_tooltip text="Services" term_id="service" >}}、
{{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} 和
{{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} 的 Pod,偏好跨多个节点部署。
实现的扩展点:`PreScore``Score`
<!--
- `ImageLocality`: Favors nodes that already have the container images that the
Pod runs.
Extension points: `Score`.
Extension points: `score`.
-->
- `ImageLocality`:选择已经存在 Pod 运行所需容器镜像的节点。
实现的扩展点:`Score`
实现的扩展点:`score`
<!--
- `TaintToleration`: Implements
[taints and tolerations](/docs/concepts/scheduling-eviction/taint-and-toleration/).
Implements extension points: `Filter`, `Prescore`, `Score`.
Implements extension points: `filter`, `prescore`, `score`.
-->
- `TaintToleration`:实现了[污点和容忍](/zh/docs/concepts/scheduling-eviction/taint-and-toleration/)。
实现的扩展点:`Filter``Prescore``Score`
实现的扩展点:`filter``prescore``score`
<!--
- `NodeName`: Checks if a Pod spec node name matches the current node.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `NodeName`:检查 Pod 指定的节点名称与当前节点是否匹配。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `NodePorts`: Checks if a node has free ports for the requested Pod ports.
Extension points: `PreFilter`, `Filter`.
Extension points: `preFilter`, `filter`.
-->
- `NodePorts`:检查 Pod 请求的端口在节点上是否可用。
实现的扩展点:`PreFilter``Filter`
<!--
- `NodePreferAvoidPods`: Scores nodes according to the node
{{< glossary_tooltip text=" " term_id="annotation" >}}
`scheduler.alpha.kubernetes.io/preferAvoidPods`.
Extension points: `Score`.
-->
- `NodePreferAvoidPods`:基于节点的 {{< glossary_tooltip text="注解" term_id="annotation" >}}
`scheduler.alpha.kubernetes.io/preferAvoidPods` 打分。
实现的扩展点:`preFilter``filter`
实现的扩展点:`Score`
<!--
- `NodeAffinity`: Implements
[node selectors](/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
and [node affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity).
Extension points: `Filter`, `Score`.
Extension points: `filter`, `score`.
-->
- `NodeAffinity`:实现了[节点选择器](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
和[节点亲和性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity)。
实现的扩展点:`Filter``Score`.
实现的扩展点:`filter``score`.
<!--
- `PodTopologySpread`: Implements
[Pod topology spread](/docs/concepts/workloads/pods/pod-topology-spread-constraints/).
Extension points: `PreFilter`, `Filter`, `PreScore`, `Score`.
Extension points: `preFilter`, `filter`, `preScore`, `score`.
-->
- `PodTopologySpread`:实现了 [Pod 拓扑分布](/zh/docs/concepts/workloads/pods/pod-topology-spread-constraints/)。
实现的扩展点:`PreFilter``Filter``PreScore``Score`
实现的扩展点:`preFilter``filter``preScore``score`
<!--
- `NodeUnschedulable`: Filters out nodes that have `.spec.unschedulable` set to
true.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `NodeUnschedulable`:过滤 `.spec.unschedulable` 值为 true 的节点。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `NodeResourcesFit`: Checks if the node has all the resources that the Pod is
requesting.
Extension points: `PreFilter`, `Filter`.
requesting. The score can use one of three strategies: `LeastAllocated`
(default), `MostAllocated` and `RequestedToCapacityRatio`.
Extension points: `preFilter`, `filter`, `score`.
-->
- `NodeResourcesFit`:检查节点是否拥有 Pod 请求的所有资源。
得分可以使用以下三种策略之一:`LeastAllocated`(默认)、`MostAllocated`
`RequestedToCapacityRatio`
实现的扩展点:`PreFilter``Filter`
实现的扩展点:`preFilter``filter``score`
<!--
- `NodeResourcesBalancedAllocation`: Favors nodes that would obtain a more
balanced resource usage if the Pod is scheduled there.
Extension points: `Score`.
Extension points: `score`.
-->
- `NodeResourcesBalancedAllocation`:调度 Pod 时,选择资源使用更为均衡的节点。
实现的扩展点:`Score`
<!--
- `NodeResourcesLeastAllocated`: Favors nodes that have a low allocation of
resources.
Extension points: `Score`.
-->
- `NodeResourcesLeastAllocated`:选择资源分配较少的节点。
实现的扩展点:`score`
实现的扩展点:`Score`
<!--
- `VolumeBinding`: Checks if the node has or if it can bind the requested
{{< glossary_tooltip text="volumes" term_id="volume" >}}.
Extension points: `PreFilter`, `Filter`, `Reserve`, `PreBind`, `Score`.
Extension points: `preFilter`, `filter`, `reserve`, `preBind`, `score`.
{{< note >}}
`Score` extension point is enabled when `VolumeCapacityPriority` feature is
`score` extension point is enabled when `VolumeCapacityPriority` feature is
enabled. It prioritizes the smallest PVs that can fit the requested volume
size.
{{< /note >}}
-->
- `VolumeBinding`:检查节点是否有请求的卷,或是否可以绑定请求的卷。
实现的扩展点: `PreFilter``Filter``Reserve``PreBind``Score`
实现的扩展点: `preFilter``filter``reserve``preBind``score`
{{< note >}}
`VolumeCapacityPriority` 特性被启用时,`Score` 扩展点也被启用。
`VolumeCapacityPriority` 特性被启用时,`score` 扩展点也被启用。
它优先考虑可以满足所需卷大小的最小 PV。
{{< /note >}}
<!--
- `VolumeRestrictions`: Checks that volumes mounted in the node satisfy
restrictions that are specific to the volume provider.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `VolumeRestrictions`:检查挂载到节点上的卷是否满足卷提供程序的限制。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `VolumeZone`: Checks that volumes requested satisfy any zone requirements they
might have.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `VolumeZone`:检查请求的卷是否在任何区域都满足。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `NodeVolumeLimits`: Checks that CSI volume limits can be satisfied for the
node.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `NodeVolumeLimits`:检查该节点是否满足 CSI 卷限制。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `EBSLimits`: Checks that AWS EBS volume limits can be satisfied for the node.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `EBSLimits`:检查节点是否满足 AWS EBS 卷限制。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `GCEPDLimits`: Checks that GCP-PD volume limits can be satisfied for the node.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `GCEPDLimits`:检查该节点是否满足 GCP-PD 卷限制。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `AzureDiskLimits`: Checks that Azure disk volume limits can be satisfied for
the node.
Extension points: `Filter`.
Extension points: `filter`.
-->
- `AzureDiskLimits`:检查该节点是否满足 Azure 卷限制。
实现的扩展点:`Filter`
实现的扩展点:`filter`
<!--
- `InterPodAffinity`: Implements
[inter-Pod affinity and anti-affinity](/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity).
Extension points: `PreFilter`, `Filter`, `PreScore`, `Score`.
Extension points: `preFilter`, `filter`, `preScore`, `score`.
-->
- `InterPodAffinity`:实现 [Pod 间亲和性与反亲和性](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity)。
实现的扩展点:`PreFilter``Filter``PreScore``Score`
实现的扩展点:`preFilter``filter``preScore``score`
<!--
- `PrioritySort`: Provides the default priority based sorting.
Extension points: `QueueSort`.
Extension points: `queueSort`.
-->
- `PrioritySort`:提供默认的基于优先级的排序。
实现的扩展点:`QueueSort`
实现的扩展点:`queueSort`
<!--
- `DefaultBinder`: Provides the default binding mechanism.
Extension points: `Bind`.
Extension points: `bind`.
-->
- `DefaultBinder`:提供默认的绑定机制。
实现的扩展点:`Bind`
实现的扩展点:`bind`
<!--
- `DefaultPreemption`: Provides the default preemption mechanism.
Extension points: `PostFilter`.
-->
- `DefaultPreemption`:提供默认的抢占机制。
实现的扩展点:`PostFilter`
实现的扩展点:`postFilter`
<!--
You can also enable the following plugins, through the component config APIs,
@@ -382,53 +362,29 @@ that are not enabled by default:
-->
你也可以通过组件配置 API 启用以下插件(默认不启用):
<!--
- `NodeResourcesMostAllocated`: Favors nodes that have a high allocation of
resources.
Extension points: `Score`.
<!--
- `SelectorSpread`: Favors spreading across nodes for Pods that belong to
{{< glossary_tooltip text="Services" term_id="service" >}},
{{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} and
{{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}}.
Extension points: `preScore`, `score`.
-->
- `NodeResourcesMostAllocated`:选择已分配资源多的节点。
- `SelectorSpread`:偏向把属于
{{< glossary_tooltip text="Services" term_id="service" >}}
{{< glossary_tooltip text="ReplicaSets" term_id="replica-set" >}} 和
{{< glossary_tooltip text="StatefulSets" term_id="statefulset" >}} 的 Pod 跨节点分布。
实现的扩展点:`Score`
<!--
- `RequestedToCapacityRatio`: Favor nodes according to a configured function of
the allocated resources.
Extension points: `Score`.
实现的扩展点:`preScore``score`
<!--
- `CinderLimits`: Checks that [OpenStack Cinder](https://docs.openstack.org/cinder/)
volume limits can be satisfied for the node.
Extension points: `filter`.
-->
- `RequestedToCapacityRatio`:根据已分配资源的某函数设置选择节点。
- `CinderLimits`:检查是否可以满足节点的 [OpenStack Cinder](https://docs.openstack.org/cinder/)
卷限制
实现的扩展点:`Score`
<!--
- `CinderVolume`: Checks that OpenStack Cinder volume limits can be satisfied
for the node.
Extension points: `Filter`.
-->
- `CinderVolume`:检查该节点是否满足 OpenStack Cinder 卷限制。
实现的扩展点:`Filter`
<!--
- `NodeLabel`: Filters and / or scores a node according to configured
{{< glossary_tooltip text="label(s)" term_id="label" >}}.
Extension points: `Filter`, `Score`.
-->
- `NodeLabel`:根据配置的 {{< glossary_tooltip text="标签" term_id="label" >}}
过滤节点和/或给节点打分。
实现的扩展点:`Filter``Score`
<!--
- `ServiceAffinity`: Checks that Pods that belong to a
{{< glossary_tooltip term_id="service" >}} fit in a set of nodes defined by
configured labels. This plugin also favors spreading the Pods belonging to a
Service across nodes.
Extension points: `PreFilter`, `Filter`, `Score`.
-->
- `ServiceAffinity`:检查属于某个 {{< glossary_tooltip term_id="service" >}} 的 Pod
与配置的标签所定义的节点集是否适配。
这个插件还支持将属于某个 Service 的 Pod 分散到各个节点。
实现的扩展点:`PreFilter``Filter``Score`
<!-- ### Multiple profiles -->
### 多配置文件 {#multiple-profiles}
<!--
@@ -447,7 +403,7 @@ disabled.
使用下面的配置样例,调度器将运行两个配置文件:一个使用默认插件,另一个禁用所有打分插件。
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta1
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: default-scheduler
@@ -496,23 +452,372 @@ Pod 的调度事件把 `.spec.schedulerName` 字段值作为 ReportingController
{{< note >}}
<!--
All profiles must use the same plugin in the QueueSort extension point and have
All profiles must use the same plugin in the queueSort extension point and have
the same configuration parameters (if applicable). This is because the scheduler
only has one pending pods queue.
-->
所有配置文件必须在 QueueSort 扩展点使用相同的插件,并具有相同的配置参数(如果适用)。
所有配置文件必须在 queueSort 扩展点使用相同的插件,并具有相同的配置参数(如果适用)。
这是因为调度器只有一个保存 pending 状态 Pod 的队列。
{{< /note >}}
<!--
### Plugins that apply to multiple extension points {#multipoint}
-->
### 应用于多个扩展点的插件 {#multipoint}
<!--
Starting from `kubescheduler.config.k8s.io/v1beta3`, there is an additional field in the
profile config, `multiPoint`, which allows for easily enabling or disabling a plugin
across several extension points. The intent of `multiPoint` config is to simplify the
configuration needed for users and administrators when using custom profiles.
-->
`kubescheduler.config.k8s.io/v1beta3` 开始,配置文件配置中有一个附加字段 `multiPoint`,它允许跨多个扩展点轻松启用或禁用插件。
`multiPoint` 配置的目的是简化用户和管理员在使用自定义配置文件时所需的配置。
<!--
Consider a plugin, `MyPlugin`, which implements the `preScore`, `score`, `preFilter`,
and `filter` extension points. To enable `MyPlugin` for all its available extension
points, the profile config looks like:
-->
考虑一个插件,`MyPlugin`,它实现了 `preScore``score``preFilter``filter` 扩展点。
要为其所有可用的扩展点启用 `MyPlugin`,配置文件配置如下所示:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: multipoint-scheduler
plugins:
multiPoint:
enabled:
- name: MyPlugin
```
<!--
This would equate to manually enabling `MyPlugin` for all of its extension
points, like so:
-->
这相当于为所有扩展点手动启用`MyPlugin`,如下所示:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: non-multipoint-scheduler
plugins:
preScore:
enabled:
- name: MyPlugin
score:
enabled:
- name: MyPlugin
preFilter:
enabled:
- name: MyPlugin
filter:
enabled:
- name: MyPlugin
```
<!--
One benefit of using `multiPoint` here is that if `MyPlugin` implements another
extension point in the future, the `multiPoint` config will automatically enable it
for the new extension.
-->
在这里使用 `multiPoint` 的一个好处是,如果 `MyPlugin` 将来实现另一个扩展点,`multiPoint` 配置将自动为新扩展启用它。
<!--
Specific extension points can be excluded from `MultiPoint` expansion using
the `disabled` field for that extension point. This works with disabling default
plugins, non-default plugins, or with the wildcard (`'*'`) to disable all plugins.
An example of this, disabling `Score` and `PreScore`, would be:
-->
可以使用该扩展点的 `disabled` 字段将特定扩展点从 `MultiPoint` 扩展中排除。
这适用于禁用默认插件、非默认插件或使用通配符 (`'*'`) 来禁用所有插件。
禁用 `Score``PreScore` 的一个例子是:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: non-multipoint-scheduler
plugins:
multiPoint:
enabled:
- name: 'MyPlugin'
preScore:
disabled:
- name: '*'
score:
disabled:
- name: '*'
```
<!--
In `v1beta3`, all [default plugins](#scheduling-plugins) are enabled internally through `MultiPoint`.
However, individual extension points are still available to allow flexible
reconfiguration of the default values (such as ordering and Score weights). For
example, consider two Score plugins `DefaultScore1` and `DefaultScore2`, each with
a weight of `1`. They can be reordered with different weights like so:
-->
`v1beta3` 中,所有 [默认插件](#scheduling-plugins) 都通过 `MultiPoint` 在内部启用。
但是,仍然可以使用单独的扩展点来灵活地重新配置默认值(例如排序和分数权重)。
例如,考虑两个Score插件 `DefaultScore1``DefaultScore2` ,每个插件的权重为 `1`
它们可以用不同的权重重新排序,如下所示:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: multipoint-scheduler
plugins:
score:
enabled:
- name: 'DefaultScore2'
weight: 5
```
<!--
In this example, it's unnecessary to specify the plugins in `MultiPoint` explicitly
because they are default plugins. And the only plugin specified in `Score` is `DefaultScore2`.
This is because plugins set through specific extension points will always take precedence
over `MultiPoint` plugins. So, this snippet essentially re-orders the two plugins
without needing to specify both of them.
-->
在这个例子中,没有必要在 `MultiPoint` 中明确指定插件,因为它们是默认插件。
`Score` 中指定的唯一插件是 `DefaultScore2`
这是因为通过特定扩展点设置的插件将始终优先于 `MultiPoint` 插件。
因此,此代码段实质上重新排序了这两个插件,而无需同时指定它们。
<!--
The general hierarchy for precedence when configuring `MultiPoint` plugins is as follows:
-->
配置 `MultiPoint` 插件时优先级的一般层次结构如下:
<!--
1. Specific extension points run first, and their settings override whatever is set elsewhere
-->
1. 特定的扩展点首先运行,它们的设置会覆盖其他地方的设置
<!--2. Plugins manually configured through `MultiPoint` and their settings
-->
2. 通过 `MultiPoint` 手动配置的插件及其设置
<!--3. Default plugins and their default settings
-->
3. 默认插件及其默认设置
<!--
To demonstrate the above hierarchy, the following example is based on these plugins:
-->
为了演示上述层次结构,以下示例基于这些插件:
|插件|扩展点|
|---|---|
|`DefaultQueueSort`|`QueueSort`|
|`CustomQueueSort`|`QueueSort`|
|`DefaultPlugin1`|`Score`, `Filter`|
|`DefaultPlugin2`|`Score`|
|`CustomPlugin1`|`Score`, `Filter`|
|`CustomPlugin2`|`Score`, `Filter`|
<!--
A valid sample configuration for these plugins would be:
-->
这些插件的一个有效示例配置是:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta3
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: multipoint-scheduler
plugins:
multiPoint:
enabled:
- name: 'CustomQueueSort'
- name: 'CustomPlugin1'
weight: 3
- name: 'CustomPlugin2'
disabled:
- name: 'DefaultQueueSort'
filter:
disabled:
- name: 'DefaultPlugin1'
score:
enabled:
- name: 'DefaultPlugin2'
```
<!--
Note that there is no error for re-declaring a `MultiPoint` plugin in a specific
extension point. The re-declaration is ignored (and logged), as specific extension points
take precedence.
-->
请注意,在特定扩展点中重新声明 `MultiPoint` 插件不会出错。
重新声明被忽略(并记录),因为特定的扩展点优先。
<!--
Besides keeping most of the config in one spot, this sample does a few things:
-->
除了将大部分配置保存在一个位置之外,此示例还做了一些事情:
<!--
* Enables the custom `queueSort` plugin and disables the default one
* Enables `CustomPlugin1` and `CustomPlugin2`, which will run first for all of their extension points
* Disables `DefaultPlugin1`, but only for `filter`
* Reorders `DefaultPlugin2` to run first in `score` (even before the custom plugins)
-->
* 启用自定义 `queueSort` 插件并禁用默认插件
* 启用 `CustomPlugin1``CustomPlugin2`,这将首先为它们的所有扩展点运行
* 禁用 `DefaultPlugin1`,但仅适用于 `filter`
* 重新排序 `DefaultPlugin2` 以在 `score` 中首先运行(甚至在自定义插件之前)
<!--
In versions of the config before `v1beta3`, without `multiPoint`, the above snippet would equate to this:
-->
`v1beta3` 之前的配置版本中,没有 `multiPoint`,上面的代码片段等同于:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
profiles:
- schedulerName: multipoint-scheduler
plugins:
# Disable the default QueueSort plugin
queueSort:
enabled:
- name: 'CustomQueueSort'
disabled:
- name: 'DefaultQueueSort'
# Enable custom Filter plugins
filter:
enabled:
- name: 'CustomPlugin1'
- name: 'CustomPlugin2'
- name: 'DefaultPlugin2'
disabled:
- name: 'DefaultPlugin1'
# Enable and reorder custom score plugins
score:
enabled:
- name: 'DefaultPlugin2'
weight: 1
- name: 'DefaultPlugin1'
weight: 3
```
<!--
While this is a complicated example, it demonstrates the flexibility of `MultiPoint` config
as well as its seamless integration with the existing methods for configuring extension points.
-->
虽然这是一个复杂的例子,但它展示了 `MultiPoint` 配置的灵活性以及它与配置扩展点的现有方法的无缝集成。
<!--
## Scheduler configuration migrations
-->
## 调度程序配置迁移
{{< tabs name="tab_with_md" >}}
{{% tab name="v1beta1 → v1beta2" %}}
<!--
* With the v1beta2 configuration version, you can use a new score extension for the
`NodeResourcesFit` plugin.
The new extension combines the functionalities of the `NodeResourcesLeastAllocated`,
`NodeResourcesMostAllocated` and `RequestedToCapacityRatio` plugins.
For example, if you previously used the `NodeResourcesMostAllocated` plugin, you
would instead use `NodeResourcesFit` (enabled by default) and add a `pluginConfig`
with a `scoreStrategy` that is similar to:
-->
* 在 v1beta2 配置版本中,你可以为 `NodeResourcesFit` 插件使用新的 score 扩展。
新的扩展结合了 `NodeResourcesLeastAllocated``NodeResourcesMostAllocated``RequestedToCapacityRatio` 插件的功能。
例如,如果你之前使用了 `NodeResourcesMostAllocated` 插件,
则可以改用 `NodeResourcesFit`(默认启用)并添加一个 `pluginConfig``scoreStrategy`,类似于:
```yaml
apiVersion: kubescheduler.config.k8s.io/v1beta2
kind: KubeSchedulerConfiguration
profiles:
- pluginConfig:
- args:
scoringStrategy:
resources:
- name: cpu
weight: 1
type: MostAllocated
name: NodeResourcesFit
```
<!--
* The scheduler plugin `NodeLabel` is deprecated; instead, use the [`NodeAffinity`](/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) plugin (enabled by default) to achieve similar behavior.
-->
* 调度器插件 `NodeLabel` 已弃用;
相反,要使用 [`NodeAffinity`](/zh/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity)
插件(默认启用)来实现类似的行为。
<!--
* The scheduler plugin `ServiceAffinity` is deprecated; instead, use the [`InterPodAffinity`](/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity) plugin (enabled by default) to achieve similar behavior.
-->
* 调度程序插件 `ServiceAffinity` 已弃用;
相反,使用 [`InterPodAffinity`](/zh/doc/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity)
插件(默认启用)来实现类似的行为。
<!--
* The scheduler plugin `NodePreferAvoidPods` is deprecated; instead, use [node taints](/docs/concepts/scheduling-eviction/taint-and-toleration/) to achieve similar behavior.
-->
* 调度器插件 `NodePreferAvoidPods` 已弃用;
相反,使用 [节点污点](/zh/docs/concepts/scheduling-eviction/taint-and-toleration/) 来实现类似的行为。
<!--
* A plugin enabled in a v1beta2 configuration file takes precedence over the default configuration for that plugin.
-->
* 在 v1beta2 配置文件中启用的插件优先于该插件的默认配置。
<!--
* Invalid `host` or `port` configured for scheduler healthz and metrics bind address will cause validation failure.
-->
* 调度器的健康检查和审计的绑定地址,所配置的 `host``port` 无效将导致验证失败。
{{% /tab %}}
{{% tab name="v1beta2 → v1beta3" %}}
<!--
* Three plugins' weight are increased by default:
* `InterPodAffinity` from 1 to 2
* `NodeAffinity` from 1 to 2
* `TaintToleration` from 1 to 3
-->
* 默认增加三个插件的权重:
* `InterPodAffinity` 从 1 到 2
* `NodeAffinity` 从 1 到 2
* `TaintToleration` 从 1 到 3
{{% /tab %}}
{{< /tabs >}}
## {{% heading "whatsnext" %}}
<!--
* Read the [kube-scheduler reference](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/)
* Read the [kube-scheduler reference](/docs/reference/command-line-tools-reference/kube-scheduler/)
* Learn about [scheduling](/docs/concepts/scheduling-eviction/kube-scheduler/)
* Read the [kube-scheduler configuration (v1beta1)](/docs/reference/config-api/kube-scheduler-config.v1beta1/) reference
* Read the [kube-scheduler configuration (v1beta2)](/docs/reference/config-api/kube-scheduler-config.v1beta2/) reference
* Read the [kube-scheduler configuration (v1beta3)](/docs/reference/config-api/kube-scheduler-config.v1beta3/) reference
-->
* 阅读 [kube-scheduler 参考](/zh/docs/reference/command-line-tools-reference/kube-scheduler/)
* 了解[调度](/zh/docs/concepts/scheduling-eviction/kube-scheduler/)
* 阅读 [kube-scheduler 配置 (v1beta1)](/zh/docs/reference/config-api/kube-scheduler-config.v1beta1/) 参考
* 阅读 [kube-scheduler 配置 (v1beta2)](/zh/docs/reference/config-api/kube-scheduler-config.v1beta2/) 参考
* 阅读 [kube-scheduler 配置 (v1beta3)](/zh/docs/reference/config-api/kube-scheduler-config.v1beta3/) 参考