Skip to content

Commit aeb8093

Browse files
authored
Merge pull request #42362 from helen-frank/zh-cn/kubelet-config.v1
[zh] Translate kubelet config v1 reference
2 parents b03ba92 + 0948f3e commit aeb8093

File tree

1 file changed

+254
-0
lines changed

1 file changed

+254
-0
lines changed
Lines changed: 254 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,254 @@
1+
---
2+
title: Kubelet 配置 (v1)
3+
content_type: tool-reference
4+
package: kubelet.config.k8s.io/v1
5+
auto_generated: true
6+
---
7+
8+
<!--
9+
title: Kubelet Configuration (v1)
10+
content_type: tool-reference
11+
package: kubelet.config.k8s.io/v1
12+
auto_generated: true
13+
-->
14+
15+
16+
<!--
17+
## Resource Types
18+
-->
19+
20+
## 资源类型
21+
22+
- [CredentialProviderConfig](#kubelet-config-k8s-io-v1-CredentialProviderConfig)
23+
24+
25+
26+
## `CredentialProviderConfig` {#kubelet-config-k8s-io-v1-CredentialProviderConfig}
27+
28+
29+
30+
<!--
31+
CredentialProviderConfig is the configuration containing information about
32+
each exec credential provider. Kubelet reads this configuration from disk and enables
33+
each provider as specified by the CredentialProvider type.
34+
-->
35+
CredentialProviderConfig 包含有关每个 exec 凭据提供者的配置信息。
36+
Kubelet 从磁盘上读取这些配置信息,并根据 CredentialProvider 类型启用各个提供者。
37+
38+
<table class="table">
39+
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
40+
<tbody>
41+
42+
<tr><td><code>apiVersion</code><br/>string</td><td><code>kubelet.config.k8s.io/v1</code></td></tr>
43+
<tr><td><code>kind</code><br/>string</td><td><code>CredentialProviderConfig</code></td></tr>
44+
45+
46+
<tr><td><code>providers</code> <B><!--[Required]-->[必需]</B><br/>
47+
<a href="#kubelet-config-k8s-io-v1-CredentialProvider"><code>[]CredentialProvider</code></a>
48+
</td>
49+
<td>
50+
<!--
51+
providers is a list of credential provider plugins that will be enabled by the kubelet.
52+
Multiple providers may match against a single image, in which case credentials
53+
from all providers will be returned to the kubelet. If multiple providers are called
54+
for a single image, the results are combined. If providers return overlapping
55+
auth keys, the value from the provider earlier in this list is used.
56+
-->
57+
<p>
58+
<code>providers</code> 是一组凭据提供者插件,这些插件会被 kubelet 启用。
59+
多个提供者可以匹配到同一镜像上,这时,来自所有提供者的凭据信息都会返回给 kubelet。
60+
如果针对同一镜像调用了多个提供者,则结果会被组合起来。如果提供者返回的认证主键有重复,
61+
列表中先出现的提供者所返回的值将被使用。
62+
</p>
63+
</td>
64+
</tr>
65+
</tbody>
66+
</table>
67+
68+
## `CredentialProvider` {#kubelet-config-k8s-io-v1-CredentialProvider}
69+
70+
<!--
71+
**Appears in:**
72+
-->
73+
**出现在:**
74+
75+
- [CredentialProviderConfig](#kubelet-config-k8s-io-v1-CredentialProviderConfig)
76+
77+
<!--
78+
CredentialProvider represents an exec plugin to be invoked by the kubelet. The plugin is only
79+
invoked when an image being pulled matches the images handled by the plugin (see matchImages).
80+
-->
81+
CredentialProvider 代表的是要被 kubelet 调用的一个 exec 插件。
82+
这一插件只会在所拉取的镜像与该插件所处理的镜像匹配时才会被调用(参见 <code>matchImages</code>)。
83+
84+
85+
<table class="table">
86+
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
87+
<tbody>
88+
89+
90+
<tr><td><code>name</code> <B><!--[Required]-->[必需]</B><br/>
91+
<code>string</code>
92+
</td>
93+
<td>
94+
<!-- name is the required name of the credential provider. It must match the name of the
95+
provider executable as seen by the kubelet. The executable must be in the kubelet's
96+
bin directory (set by the --image-credential-provider-bin-dir flag). -->
97+
<p>
98+
<code>name</code> 是凭据提供者的名称(必需)。此名称必须与 kubelet
99+
所看到的提供者可执行文件的名称匹配。可执行文件必须位于 kubelet 的
100+
<code>bin</code> 目录(通过 <code>--image-credential-provider-bin-dir</code> 设置)下。
101+
</p>
102+
</td>
103+
</tr>
104+
<tr><td><code>matchImages</code> <B><!--[Required]-->[必需]</B><br/>
105+
<code>[]string</code>
106+
</td>
107+
<td>
108+
<!--
109+
matchImages is a required list of strings used to match against images in order to
110+
determine if this provider should be invoked. If one of the strings matches the
111+
requested image from the kubelet, the plugin will be invoked and given a chance
112+
to provide credentials. Images are expected to contain the registry domain
113+
and URL path.
114+
-->
115+
<p><code>matchImages</code> 是一个必须设置的字符串列表,用来匹配镜像以便确定是否要调用此提供者。
116+
如果字符串之一与 kubelet 所请求的镜像匹配,则此插件会被调用并给予提供凭证的机会。
117+
镜像应该包含镜像库域名和 URL 路径。</p>
118+
<!--
119+
Each entry in matchImages is a pattern which can optionally contain a port and a path.
120+
Globs can be used in the domain, but not in the port or the path. Globs are supported
121+
as subdomains like <code>&ast;.k8s.io</code> or <code>k8s.&ast;.io</code>, and top-level-domains such as <code>k8s.&ast;</code>.
122+
Matching partial subdomains like <code>app&ast;.k8s.io</code> is also supported. Each glob can only match
123+
a single subdomain segment, so <code>&ast;.io</code> does not match <code>&ast;.k8s.io</code>.
124+
-->
125+
<p><code>matchImages</code> 中的每个条目都是一个模式字符串,其中可以包含端口号和路径。
126+
域名部分可以包含统配符,但端口或路径部分不可以。通配符可以用作子域名,例如
127+
<code>&ast;.k8s.io</code> 或 <code>k8s.&ast;.io</code>,以及顶级域名,如 <code>k8s.&ast;</code>。</p>
128+
<p>对类似 <code>app&ast;.k8s.io</code> 这类部分子域名的匹配也是支持的。
129+
每个通配符只能用来匹配一个子域名段,所以 <code>&ast;.io</code> 不会匹配 <code>&ast;.k8s.io</code>。</p>
130+
<!--
131+
A match exists between an image and a matchImage when all of the below are true:
132+
-->
133+
<p>镜像与 <code>matchImages</code> 之间存在匹配时,以下条件都要满足:</p>
134+
<ul>
135+
<!--
136+
<li>Both contain the same number of domain parts and each part matches.</li>
137+
<li>The URL path of an imageMatch must be a prefix of the target image URL path.</li>
138+
<li>If the imageMatch contains a port, then the port must match in the image as well.</li>
139+
-->
140+
<li>二者均包含相同个数的域名部分,并且每个域名部分都对应匹配;</li>
141+
<li><code>matchImages</code> 条目中的 URL 路径部分必须是目标镜像的 URL 路径的前缀;</li>
142+
<li>如果 <code>matchImages</code> 条目中包含端口号,则端口号也必须与镜像端口号匹配。</li>
143+
</ul>
144+
<!--
145+
Example values of matchImages:
146+
-->
147+
<p><code>matchImages</code> 的一些示例如下:</p>
148+
<ul>
149+
<li>123456789.dkr.ecr.us-east-1.amazonaws.com</li>
150+
<li>&ast;.azurecr.io</li>
151+
<li>gcr.io</li>
152+
<li>&ast;.&ast;.registry.io</li>
153+
<li>registry.io:8080/path</li>
154+
</ul>
155+
</td>
156+
</tr>
157+
<tr><td><code>defaultCacheDuration</code> <B><!--[Required]-->[必需]</B><br/>
158+
<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration"><code>meta/v1.Duration</code></a>
159+
</td>
160+
<td>
161+
<!--
162+
defaultCacheDuration is the default duration the plugin will cache credentials in-memory
163+
if a cache duration is not provided in the plugin response. This field is required.
164+
-->
165+
<p>
166+
<code>defaultCacheDuration</code> 是插件在内存中缓存凭据的默认时长,
167+
在插件响应中没有给出缓存时长时,使用这里设置的值。此字段是必需的。
168+
</p>
169+
</td>
170+
</tr>
171+
<tr><td><code>apiVersion</code> <B><!--[Required]-->[必需]</B><br/>
172+
<code>string</code>
173+
</td>
174+
<td>
175+
<!--
176+
Required input version of the exec CredentialProviderRequest. The returned CredentialProviderResponse
177+
MUST use the same encoding version as the input. Current supported values are:
178+
-->
179+
<p>
180+
要求 exec 插件 CredentialProviderRequest 请求的输入版本。
181+
所返回的 CredentialProviderResponse 必须使用与输入相同的编码版本。当前支持的值有:
182+
</p>
183+
<ul>
184+
<li>credentialprovider.kubelet.k8s.io/v1</li>
185+
</ul>
186+
</td>
187+
</tr>
188+
<tr><td><code>args</code><br/>
189+
<code>[]string</code>
190+
</td>
191+
<td>
192+
<!--
193+
Arguments to pass to the command when executing it.
194+
-->
195+
<p>在执行插件可执行文件时要传递给命令的参数。</p>
196+
</td>
197+
</tr>
198+
<tr><td><code>env</code><br/>
199+
<a href="#kubelet-config-k8s-io-v1-ExecEnvVar"><code>[]ExecEnvVar</code></a>
200+
</td>
201+
<td>
202+
<!--
203+
Env defines additional environment variables to expose to the process. These
204+
are unioned with the host's environment, as well as variables client-go uses
205+
to pass argument to the plugin.
206+
-->
207+
<p>
208+
<code>env</code> 定义要提供给插件进程的额外的环境变量。
209+
这些环境变量会与主机上的其他环境变量以及 client-go 所使用的环境变量组合起来,
210+
一起传递给插件。
211+
</p>
212+
</td>
213+
</tr>
214+
</tbody>
215+
</table>
216+
217+
## `ExecEnvVar` {#kubelet-config-k8s-io-v1-ExecEnvVar}
218+
219+
<!--
220+
**Appears in:**
221+
-->
222+
**出现在:**
223+
224+
- [CredentialProvider](#kubelet-config-k8s-io-v1-CredentialProvider)
225+
226+
<!--
227+
ExecEnvVar is used for setting environment variables when executing an exec-based
228+
credential plugin.
229+
-->
230+
ExecEnvVar 用来在执行基于 exec 的凭据插件时设置环境变量。
231+
232+
233+
<table class="table">
234+
<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead>
235+
<tbody>
236+
237+
238+
<tr><td><code>name</code> <B><!--[Required]-->[必需]</B><br/>
239+
<code>string</code>
240+
</td>
241+
<td>
242+
<!--span class="text-muted">No description provided.</span-->
243+
<p>环境变量名称</p>
244+
</tr>
245+
<tr><td><code>value</code> <B>[Required]</B><br/>
246+
<code>string</code>
247+
</td>
248+
<td>
249+
<!--span class="text-muted">No description provided.</span-->
250+
<p>环境变量取值</p>
251+
</tr>
252+
</tbody>
253+
</table>
254+

0 commit comments

Comments
 (0)