|
| 1 | +--- |
| 2 | +title: Kubelet CredentialProvider (v1alpha1) |
| 3 | +content_type: tool-reference |
| 4 | +package: credentialprovider.kubelet.k8s.io/v1alpha1 |
| 5 | +--- |
| 6 | +<!-- |
| 7 | +title: Kubelet CredentialProvider (v1alpha1) |
| 8 | +content_type: tool-reference |
| 9 | +package: credentialprovider.kubelet.k8s.io/v1alpha1 |
| 10 | +auto_generated: true |
| 11 | +--> |
| 12 | + |
| 13 | +<!-- |
| 14 | +## Resource Types |
| 15 | +--> |
| 16 | +## 资源类型 {#resource-types} |
| 17 | + |
| 18 | +- [CredentialProviderRequest](#credentialprovider-kubelet-k8s-io-v1alpha1-CredentialProviderRequest) |
| 19 | +- [CredentialProviderResponse](#credentialprovider-kubelet-k8s-io-v1alpha1-CredentialProviderResponse) |
| 20 | + |
| 21 | +## `CredentialProviderRequest` {#credentialprovider-kubelet-k8s-io-v1alpha1-CredentialProviderRequest} |
| 22 | + |
| 23 | +<!-- |
| 24 | +CredentialProviderRequest includes the image that the kubelet requires authentication for. |
| 25 | +Kubelet will pass this request object to the plugin via stdin. In general, plugins should |
| 26 | +prefer responding with the same apiVersion they were sent. |
| 27 | +--> |
| 28 | +<p> |
| 29 | +CredentialProviderRequest 包含 kubelet 需要进行身份验证的镜像。 |
| 30 | +Kubelet 会通过标准输入将此请求对象传递给插件。一般来说,插件倾向于用它们所收到的相同的 apiVersion 来响应。 |
| 31 | +</p> |
| 32 | + |
| 33 | +<table class="table"> |
| 34 | +<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead> |
| 35 | +<tbody> |
| 36 | + |
| 37 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>credentialprovider.kubelet.k8s.io/v1alpha1</code></td></tr> |
| 38 | +<tr><td><code>kind</code><br/>string</td><td><code>CredentialProviderRequest</code></td></tr> |
| 39 | + |
| 40 | + |
| 41 | +<tr><td><code>image</code> <B><!--[Required]-->[必需]</B><br/> |
| 42 | +<code>string</code> |
| 43 | +</td> |
| 44 | +<td> |
| 45 | +<!-- |
| 46 | + image is the container image that is being pulled as part of the |
| 47 | +credential provider plugin request. Plugins may optionally parse the image |
| 48 | +to extract any information required to fetch credentials. |
| 49 | +--> |
| 50 | + <p> |
| 51 | + <code>image</code> 是容器镜像,作为凭据提供程序插件请求的一部分。 |
| 52 | + 插件可以有选择地解析镜像以提取获取凭据所需的任何信息。 |
| 53 | + </p> |
| 54 | +</td> |
| 55 | +</tr> |
| 56 | +</tbody> |
| 57 | +</table> |
| 58 | + |
| 59 | +## `CredentialProviderResponse` {#credentialprovider-kubelet-k8s-io-v1alpha1-CredentialProviderResponse} |
| 60 | + |
| 61 | +<!-- |
| 62 | +CredentialProviderResponse holds credentials that the kubelet should use for the specified |
| 63 | +image provided in the original request. Kubelet will read the response from the plugin via stdout. |
| 64 | +This response should be set to the same apiVersion as CredentialProviderRequest. |
| 65 | +--> |
| 66 | +<p> |
| 67 | +CredentialProviderResponse 持有 kubelet 应用于原始请求中提供的指定镜像的凭据。 |
| 68 | +kubelet 将通过标准输出读取插件的响应。此响应的 apiVersion 值应设置为与 CredentialProviderRequest 中 apiVersion 值相同。 |
| 69 | +</p> |
| 70 | + |
| 71 | + |
| 72 | +<table class="table"> |
| 73 | +<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead> |
| 74 | +<tbody> |
| 75 | + |
| 76 | +<tr><td><code>apiVersion</code><br/>string</td><td><code>credentialprovider.kubelet.k8s.io/v1alpha1</code></td></tr> |
| 77 | +<tr><td><code>kind</code><br/>string</td><td><code>CredentialProviderResponse</code></td></tr> |
| 78 | + |
| 79 | + |
| 80 | +<tr><td><code>cacheKeyType</code> <B><!--[Required]-->[必需]</B><br/> |
| 81 | +<a href="#credentialprovider-kubelet-k8s-io-v1alpha1-PluginCacheKeyType"><code>PluginCacheKeyType</code></a> |
| 82 | +</td> |
| 83 | +<td> |
| 84 | +<!-- |
| 85 | +cacheKeyType indiciates the type of caching key to use based on the image provided |
| 86 | +in the request. There are three valid values for the cache key type: Image, Registry, and |
| 87 | +Global. If an invalid value is specified, the response will NOT be used by the kubelet. |
| 88 | +--> |
| 89 | + <p> |
| 90 | + <code>cacheKeyType</code> 表明基于请求中所给镜像而要使用的缓存键类型。缓存键类型有三个有效值: |
| 91 | + Image、Registry 和 Global。如果指定了无效值,则 kubelet 不会使用该响应。 |
| 92 | + </p> |
| 93 | +</td> |
| 94 | +</tr> |
| 95 | +<tr><td><code>cacheDuration</code><br/> |
| 96 | +<a href="https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Duration"><code>meta/v1.Duration</code></a> |
| 97 | +</td> |
| 98 | +<td> |
| 99 | +<!-- |
| 100 | +cacheDuration indicates the duration the provided credentials should be cached for. |
| 101 | +The kubelet will use this field to set the in-memory cache duration for credentials |
| 102 | +in the AuthConfig. If null, the kubelet will use defaultCacheDuration provided in |
| 103 | +CredentialProviderConfig. If set to 0, the kubelet will not cache the provided AuthConfig. |
| 104 | +--> |
| 105 | + <p> |
| 106 | + <code>cacheDuration</code> 表示所提供的凭据应该被缓存的时间。kubelet 使用这个字段为 |
| 107 | + <code>auth</code> 中的凭据设置内存中数据的缓存时间。如果为空,kubelet 将使用 CredentialProviderConfig |
| 108 | + 中提供的 defaultCacheDuration。如果设置为 0,kubelet 将不会缓存所提供的 <code>auth</code> 数据。 |
| 109 | + </p> |
| 110 | +</td> |
| 111 | +</tr> |
| 112 | +<tr><td><code>auth</code><br/> |
| 113 | +<a href="#credentialprovider-kubelet-k8s-io-v1alpha1-AuthConfig"><code>map[string]k8s.io/kubelet/pkg/apis/credentialprovider/v1alpha1.AuthConfig</code></a> |
| 114 | +</td> |
| 115 | +<td> |
| 116 | +<!-- |
| 117 | + auth is a map containing authentication information passed into the kubelet. |
| 118 | +Each key is a match image string (more on this below). The corresponding authConfig value |
| 119 | +should be valid for all images that match against this key. A plugin should set |
| 120 | +this field to null if no valid credentials can be returned for the requested image. |
| 121 | +--> |
| 122 | + <p> |
| 123 | + <code>auth</code> 是一个映射,其中包含传递到 kubelet 的身份验证信息。 |
| 124 | + 每个键都是一个匹配镜像字符串(下面将对此进行详细介绍)。相应的 authConfig 值应该对所有与此键匹配的镜像有效。 |
| 125 | + 如果不能为请求的镜像返回有效的凭据,插件应将此字段设置为 null。 |
| 126 | + </p> |
| 127 | +<!-- |
| 128 | +Each key in the map is a pattern which can optionally contain a port and a path. |
| 129 | +Globs can be used in the domain, but not in the port or the path. Globs are supported |
| 130 | +as subdomains like '<em>.k8s.io' or 'k8s.</em>.io', and top-level-domains such as 'k8s.<em>'. |
| 131 | +Matching partial subdomains like 'app</em>.k8s.io' is also supported. Each glob can only match |
| 132 | +a single subdomain segment, so *.io does not match *.k8s.io. |
| 133 | +--> |
| 134 | + <p> |
| 135 | + 映射中每个键值都是一个正则表达式,可以选择包含端口和路径。 |
| 136 | + 域名部分可以包含通配符,但在端口或路径中不能使用通配符。 |
| 137 | + 支持通配符作为子域,如 <code>*.k8s.io</code> 或 <code>k8s.*.io</code>,以及顶级域,如 <code>k8s.*</code>。 |
| 138 | + 还支持匹配部分子域,如 <code>app*.k8s.io</code>。每个通配符只能匹配一个子域段, |
| 139 | + 因此 <code>*.io</code> 不匹配 <code>*.k8s.io</code>。 |
| 140 | + </p> |
| 141 | +<!-- |
| 142 | +<p>The kubelet will match images against the key when all of the below are true:</p> |
| 143 | +<ul> |
| 144 | +<li>Both contain the same number of domain parts and each part matches.</li> |
| 145 | +<li>The URL path of an imageMatch must be a prefix of the target image URL path.</li> |
| 146 | +<li>If the imageMatch contains a port, then the port must match in the image as well.</li> |
| 147 | +</ul> |
| 148 | +--> |
| 149 | + <p> |
| 150 | + 当满足以下所有条件时,kubelet 会将镜像与键值匹配: |
| 151 | + </p> |
| 152 | + <ul> |
| 153 | + <li>两者都包含相同数量的域部分,并且每个部分都匹配。</li> |
| 154 | + <li><code>imageMatch</code> 的 URL 路径必须是目标镜像的 URL 路径的前缀。</li> |
| 155 | + <li>如果 <code>imageMatch</code> 包含端口,则该端口也必须在镜像中匹配。</li> |
| 156 | + </ul> |
| 157 | +<!-- |
| 158 | +<p>When multiple keys are returned, the kubelet will traverse all keys in reverse order so that:</p> |
| 159 | +<ul> |
| 160 | +<li>longer keys come before shorter keys with the same prefix</li> |
| 161 | +<li>non-wildcard keys come before wildcard keys with the same prefix.</li> |
| 162 | +</ul> |
| 163 | +--> |
| 164 | + <p> |
| 165 | + 当返回多个键(key)时,kubelet 会倒序遍历所有键,这样: |
| 166 | + </p> |
| 167 | + <ul> |
| 168 | + <li>具有相同前缀的较长键位于较短键之前</li> |
| 169 | + <li>具有相同前缀的非通配符键位于通配符键之前。</li> |
| 170 | + </ul> |
| 171 | +<!-- |
| 172 | +<p>For any given match, the kubelet will attempt an image pull with the provided credentials, |
| 173 | +stopping after the first successfully authenticated pull.</p> |
| 174 | +<p>Example keys:</p> |
| 175 | +--> |
| 176 | + <p> |
| 177 | + 对于任何给定的匹配,kubelet 将尝试使用提供的凭据进行镜像拉取,并在第一次成功验证后停止拉取。 |
| 178 | + </p> |
| 179 | + <p>键值示例:</p> |
| 180 | +<ul> |
| 181 | +<li>123456789.dkr.ecr.us-east-1.amazonaws.com</li> |
| 182 | +<li>*.azurecr.io</li> |
| 183 | +<li>gcr.io</li> |
| 184 | +<li><em>.</em>.registry.io</li> |
| 185 | +<li>registry.io:8080/path</li> |
| 186 | +</ul> |
| 187 | +</td> |
| 188 | +</tr> |
| 189 | +</tbody> |
| 190 | +</table> |
| 191 | + |
| 192 | +## `AuthConfig` {#credentialprovider-kubelet-k8s-io-v1alpha1-AuthConfig} |
| 193 | + |
| 194 | +<!-- |
| 195 | +**Appears in:** |
| 196 | +--> |
| 197 | +**出现在:** |
| 198 | + |
| 199 | +- [CredentialProviderResponse](#credentialprovider-kubelet-k8s-io-v1alpha1-CredentialProviderResponse) |
| 200 | + |
| 201 | +<!-- |
| 202 | +<p>AuthConfig contains authentication information for a container registry. |
| 203 | +Only username/password based authentication is supported today, but more authentication |
| 204 | +mechanisms may be added in the future.</p> |
| 205 | +--> |
| 206 | +AuthConfig 包含容器仓库的身份验证信息。目前仅支持基于用户名/密码的身份验证,但未来可能会添加更多身份验证机制。 |
| 207 | + |
| 208 | +<table class="table"> |
| 209 | +<thead><tr><th width="30%"><!--Field-->字段</th><th><!--Description-->描述</th></tr></thead> |
| 210 | +<tbody> |
| 211 | + |
| 212 | + |
| 213 | +<tr><td><code>username</code> <B><!--[Required]-->[必需]</B><br/> |
| 214 | +<code>string</code> |
| 215 | +</td> |
| 216 | +<td> |
| 217 | +<!-- |
| 218 | + <p>username is the username used for authenticating to the container registry |
| 219 | +An empty username is valid.</p> |
| 220 | +--> |
| 221 | + <p> |
| 222 | + <code>username</code> 是用于向容器仓库进行身份验证的用户名。空的用户名是合法的。 |
| 223 | + </p> |
| 224 | +</td> |
| 225 | +</tr> |
| 226 | +<tr><td><code>password</code> <B><!--[Required]-->[必需]</B><br/> |
| 227 | +<code>string</code> |
| 228 | +</td> |
| 229 | +<td> |
| 230 | +<!-- |
| 231 | + <p>password is the password used for authenticating to the container registry |
| 232 | +An empty password is valid.</p> |
| 233 | +--> |
| 234 | + <p> |
| 235 | + <code>password</code> 是用于向容器仓库进行身份验证的密码。空密码是合法的。 |
| 236 | + </p> |
| 237 | +</td> |
| 238 | +</tr> |
| 239 | +</tbody> |
| 240 | +</table> |
| 241 | + |
| 242 | +## `PluginCacheKeyType` {#credentialprovider-kubelet-k8s-io-v1alpha1-PluginCacheKeyType} |
| 243 | + |
| 244 | +<!-- |
| 245 | +(Alias of `string`) |
| 246 | +
|
| 247 | +**Appears in:** |
| 248 | +--> |
| 249 | +(<code>string</code> 数据类型的别名) |
| 250 | + |
| 251 | +**出现在:** |
| 252 | + |
| 253 | +- [CredentialProviderResponse](#credentialprovider-kubelet-k8s-io-v1alpha1-CredentialProviderResponse) |
0 commit comments