Merge pull request #42367 from windsonsea/configy

[zh] polish /config-api/kubelet-config.v1.md
This commit is contained in:
Kubernetes Prow Robot 2023-08-03 05:52:21 -07:00 committed by GitHub
commit 057d5de5f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 53 additions and 63 deletions

View File

@ -2,9 +2,7 @@
title: Kubelet 配置 (v1) title: Kubelet 配置 (v1)
content_type: tool-reference content_type: tool-reference
package: kubelet.config.k8s.io/v1 package: kubelet.config.k8s.io/v1
auto_generated: true
--- ---
<!-- <!--
title: Kubelet Configuration (v1) title: Kubelet Configuration (v1)
content_type: tool-reference content_type: tool-reference
@ -12,28 +10,22 @@ package: kubelet.config.k8s.io/v1
auto_generated: true auto_generated: true
--> -->
<!-- <!--
## Resource Types ## Resource Types
--> -->
## 资源类型 ## 资源类型
- [CredentialProviderConfig](#kubelet-config-k8s-io-v1-CredentialProviderConfig) - [CredentialProviderConfig](#kubelet-config-k8s-io-v1-CredentialProviderConfig)
## `CredentialProviderConfig` {#kubelet-config-k8s-io-v1-CredentialProviderConfig} ## `CredentialProviderConfig` {#kubelet-config-k8s-io-v1-CredentialProviderConfig}
<!-- <!--
CredentialProviderConfig is the configuration containing information about CredentialProviderConfig is the configuration containing information about
each exec credential provider. Kubelet reads this configuration from disk and enables each exec credential provider. Kubelet reads this configuration from disk and enables
each provider as specified by the CredentialProvider type. each provider as specified by the CredentialProvider type.
--> -->
CredentialProviderConfig 包含有关每个 exec 凭据提供的配置信息。 CredentialProviderConfig 包含有关每个 exec 凭据提供程序的配置信息。
Kubelet 从磁盘上读取这些配置信息,并根据 CredentialProvider 类型启用各个提供 Kubelet 从磁盘上读取这些配置信息,并根据 CredentialProvider 类型启用各个提供程序
<table class="table"> <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>
@ -42,23 +34,22 @@ Kubelet 从磁盘上读取这些配置信息,并根据 CredentialProvider 类
<tr><td><code>apiVersion</code><br/>string</td><td><code>kubelet.config.k8s.io/v1</code></td></tr> <tr><td><code>apiVersion</code><br/>string</td><td><code>kubelet.config.k8s.io/v1</code></td></tr>
<tr><td><code>kind</code><br/>string</td><td><code>CredentialProviderConfig</code></td></tr> <tr><td><code>kind</code><br/>string</td><td><code>CredentialProviderConfig</code></td></tr>
<tr><td><code>providers</code> <B><!--[Required]-->[必需]</B><br/> <tr><td><code>providers</code> <B><!--[Required]-->[必需]</B><br/>
<a href="#kubelet-config-k8s-io-v1-CredentialProvider"><code>[]CredentialProvider</code></a> <a href="#kubelet-config-k8s-io-v1-CredentialProvider"><code>[]CredentialProvider</code></a>
</td> </td>
<td> <td>
<!-- <!--
providers is a list of credential provider plugins that will be enabled by the kubelet. providers is a list of credential provider plugins that will be enabled by the kubelet.
Multiple providers may match against a single image, in which case credentials Multiple providers may match against a single image, in which case credentials
from all providers will be returned to the kubelet. If multiple providers are called from all providers will be returned to the kubelet. If multiple providers are called
for a single image, the results are combined. If providers return overlapping for a single image, the results are combined. If providers return overlapping
auth keys, the value from the provider earlier in this list is used. auth keys, the value from the provider earlier in this list is used.
--> -->
<p> <p>
<code>providers</code> 是一组凭据提供插件,这些插件会被 kubelet 启用。 <code>providers</code> 是一组凭据提供程序插件,这些插件会被 kubelet 启用。
多个提供者可以匹配到同一镜像上,这时,来自所有提供者的凭据信息都会返回给 kubelet。 多个提供程序可以匹配到同一镜像上,这时,来自所有提供程序的凭据信息都会返回给 kubelet。
如果针对同一镜像调用了多个提供者,则结果会被组合起来。如果提供者返回的认证主键有重复, 如果针对同一镜像调用了多个提供程序,则结果会被组合起来。如果提供程序返回的认证主键有重复,
列表中先出现的提供所返回的值将被使用。 列表中先出现的提供程序所返回的值将被使用。
</p> </p>
</td> </td>
</tr> </tr>
@ -81,22 +72,22 @@ invoked when an image being pulled matches the images handled by the plugin (see
CredentialProvider 代表的是要被 kubelet 调用的一个 exec 插件。 CredentialProvider 代表的是要被 kubelet 调用的一个 exec 插件。
这一插件只会在所拉取的镜像与该插件所处理的镜像匹配时才会被调用(参见 <code>matchImages</code>)。 这一插件只会在所拉取的镜像与该插件所处理的镜像匹配时才会被调用(参见 <code>matchImages</code>)。
<table class="table"> <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> <tbody>
<tr><td><code>name</code> <B><!--[Required]-->[必需]</B><br/> <tr><td><code>name</code> <B><!--[Required]-->[必需]</B><br/>
<code>string</code> <code>string</code>
</td> </td>
<td> <td>
<!-- name is the required name of the credential provider. It must match the name of the <!--
provider executable as seen by the kubelet. The executable must be in the kubelet's name is the required name of the credential provider. It must match the name of the
bin directory (set by the --image-credential-provider-bin-dir flag). --> provider executable as seen by the kubelet. The executable must be in the kubelet's
bin directory (set by the --image-credential-provider-bin-dir flag).
-->
<p> <p>
<code>name</code> 是凭据提供者的名称(必需)。此名称必须与 kubelet <code>name</code> 是凭据提供程序的名称(必需)。此名称必须与 kubelet
所看到的提供可执行文件的名称匹配。可执行文件必须位于 kubelet 的 所看到的提供程序可执行文件的名称匹配。可执行文件必须位于 kubelet 的
<code>bin</code> 目录(通过 <code>--image-credential-provider-bin-dir</code> 设置)下。 <code>bin</code> 目录(通过 <code>--image-credential-provider-bin-dir</code> 设置)下。
</p> </p>
</td> </td>
@ -112,9 +103,10 @@ requested image from the kubelet, the plugin will be invoked and given a chance
to provide credentials. Images are expected to contain the registry domain to provide credentials. Images are expected to contain the registry domain
and URL path. and URL path.
--> -->
<p><code>matchImages</code> 是一个必须设置的字符串列表,用来匹配镜像以便确定是否要调用此提供 <p><code>matchImages</code> 是一个必须设置的字符串列表,用来匹配镜像以便确定是否要调用此提供程序
如果字符串之一与 kubelet 所请求的镜像匹配,则此插件会被调用并给予提供凭的机会。 如果字符串之一与 kubelet 所请求的镜像匹配,则此插件会被调用并给予提供凭的机会。
镜像应该包含镜像库域名和 URL 路径。</p> 镜像应该包含镜像库域名和 URL 路径。</p>
<!-- <!--
Each entry in matchImages is a pattern which can optionally contain a port and a path. Each entry in matchImages is a pattern which can optionally contain a port and a path.
Globs can be used in the domain, but not in the port or the path. Globs are supported Globs can be used in the domain, but not in the port or the path. Globs are supported
@ -123,20 +115,21 @@ Matching partial subdomains like <code>app&ast;.k8s.io</code> is also supported.
a single subdomain segment, so <code>&ast;.io</code> does not match <code>&ast;.k8s.io</code>. a single subdomain segment, so <code>&ast;.io</code> does not match <code>&ast;.k8s.io</code>.
--> -->
<p><code>matchImages</code> 中的每个条目都是一个模式字符串,其中可以包含端口号和路径。 <p><code>matchImages</code> 中的每个条目都是一个模式字符串,其中可以包含端口号和路径。
域名部分可以包含统配符,但端口或路径部分不可以。通配符可以用作子域名,例如 域名部分可以包含通配符,但端口或路径部分不可以。
<code>&ast;.k8s.io</code><code>k8s.&ast;.io</code>,以及顶级域名,如 <code>k8s.&ast;</code></p> <code>&ast;.k8s.io</code><code>k8s.&ast;.io</code> 等子域名以及
<p>对类似 <code>app&ast;.k8s.io</code> 这类部分子域名的匹配也是支持的。 <code>k8s.&ast;</code> 这类顶级域名都支持通配符。</p>
<p>对于 <code>app&ast;.k8s.io</code> 这类部分子域名的匹配也是支持的。
每个通配符只能用来匹配一个子域名段,所以 <code>&ast;.io</code> 不会匹配 <code>&ast;.k8s.io</code></p> 每个通配符只能用来匹配一个子域名段,所以 <code>&ast;.io</code> 不会匹配 <code>&ast;.k8s.io</code></p>
<!-- <!--
A match exists between an image and a matchImage when all of the below are true: A match exists between an image and a matchImage when all of the below are true:
--> -->
<p>镜像与 <code>matchImages</code> 之间存在匹配时,以下条件都要满足:</p> <p>镜像与 <code>matchImages</code> 之间存在匹配时,以下条件都要满足:</p>
<ul> <ul>
<!-- <!--
<li>Both contain the same number of domain parts and each part matches.</li> <li>Both contain the same number of domain parts and each part matches.</li>
<li>The URL path of an imageMatch must be a prefix of the target image URL path.</li> <li>The URL path of an imageMatch must be a prefix of the target image URL path.</li>
<li>If the imageMatch contains a port, then the port must match in the image as well.</li> <li>If the imageMatch contains a port, then the port must match in the image as well.</li>
--> -->
<li>二者均包含相同个数的域名部分,并且每个域名部分都对应匹配;</li> <li>二者均包含相同个数的域名部分,并且每个域名部分都对应匹配;</li>
<li><code>matchImages</code> 条目中的 URL 路径部分必须是目标镜像的 URL 路径的前缀;</li> <li><code>matchImages</code> 条目中的 URL 路径部分必须是目标镜像的 URL 路径的前缀;</li>
<li>如果 <code>matchImages</code> 条目中包含端口号,则端口号也必须与镜像端口号匹配。</li> <li>如果 <code>matchImages</code> 条目中包含端口号,则端口号也必须与镜像端口号匹配。</li>
@ -158,10 +151,10 @@ Example values of matchImages:
<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration"><code>meta/v1.Duration</code></a> <a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration"><code>meta/v1.Duration</code></a>
</td> </td>
<td> <td>
<!-- <!--
defaultCacheDuration is the default duration the plugin will cache credentials in-memory defaultCacheDuration is the default duration the plugin will cache credentials in-memory
if a cache duration is not provided in the plugin response. This field is required. if a cache duration is not provided in the plugin response. This field is required.
--> -->
<p> <p>
<code>defaultCacheDuration</code> 是插件在内存中缓存凭据的默认时长, <code>defaultCacheDuration</code> 是插件在内存中缓存凭据的默认时长,
在插件响应中没有给出缓存时长时,使用这里设置的值。此字段是必需的。 在插件响应中没有给出缓存时长时,使用这里设置的值。此字段是必需的。
@ -172,10 +165,10 @@ if a cache duration is not provided in the plugin response. This field is requir
<code>string</code> <code>string</code>
</td> </td>
<td> <td>
<!-- <!--
Required input version of the exec CredentialProviderRequest. The returned CredentialProviderResponse Required input version of the exec CredentialProviderRequest. The returned CredentialProviderResponse
MUST use the same encoding version as the input. Current supported values are: MUST use the same encoding version as the input. Current supported values are:
--> -->
<p> <p>
要求 exec 插件 CredentialProviderRequest 请求的输入版本。 要求 exec 插件 CredentialProviderRequest 请求的输入版本。
所返回的 CredentialProviderResponse 必须使用与输入相同的编码版本。当前支持的值有: 所返回的 CredentialProviderResponse 必须使用与输入相同的编码版本。当前支持的值有:
@ -189,9 +182,9 @@ MUST use the same encoding version as the input. Current supported values are:
<code>[]string</code> <code>[]string</code>
</td> </td>
<td> <td>
<!-- <!--
Arguments to pass to the command when executing it. Arguments to pass to the command when executing it.
--> -->
<p>在执行插件可执行文件时要传递给命令的参数。</p> <p>在执行插件可执行文件时要传递给命令的参数。</p>
</td> </td>
</tr> </tr>
@ -199,11 +192,11 @@ Arguments to pass to the command when executing it.
<a href="#kubelet-config-k8s-io-v1-ExecEnvVar"><code>[]ExecEnvVar</code></a> <a href="#kubelet-config-k8s-io-v1-ExecEnvVar"><code>[]ExecEnvVar</code></a>
</td> </td>
<td> <td>
<!-- <!--
Env defines additional environment variables to expose to the process. These Env defines additional environment variables to expose to the process. These
are unioned with the host's environment, as well as variables client-go uses are unioned with the host's environment, as well as variables client-go uses
to pass argument to the plugin. to pass argument to the plugin.
--> -->
<p> <p>
<code>env</code> 定义要提供给插件进程的额外的环境变量。 <code>env</code> 定义要提供给插件进程的额外的环境变量。
这些环境变量会与主机上的其他环境变量以及 client-go 所使用的环境变量组合起来, 这些环境变量会与主机上的其他环境变量以及 client-go 所使用的环境变量组合起来,
@ -229,26 +222,23 @@ credential plugin.
--> -->
ExecEnvVar 用来在执行基于 exec 的凭据插件时设置环境变量。 ExecEnvVar 用来在执行基于 exec 的凭据插件时设置环境变量。
<table class="table"> <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> <tbody>
<tr><td><code>name</code> <B><!--[Required]-->[必需]</B><br/> <tr><td><code>name</code> <B><!--[Required]-->[必需]</B><br/>
<code>string</code> <code>string</code>
</td> </td>
<td> <td>
<!--span class="text-muted">No description provided.</span--> <!-- No description provided. -->
<p>环境变量名称</p> <span class="text-muted">环境变量名称</span></td>
</tr> </tr>
<tr><td><code>value</code> <B>[Required]</B><br/> <tr><td><code>value</code> <B><!--[Required]-->[必需]</B><br/>
<code>string</code> <code>string</code>
</td> </td>
<td> <td>
<!--span class="text-muted">No description provided.</span--> <!-- No description provided. -->
<p>环境变量取值</p> <span class="text-muted">环境变量取值</span></td>
</tr> </tr>
</tbody> </tbody>
</table> </table>