From 36be4cb47a2768c0a8f23a363458586f949ccadd Mon Sep 17 00:00:00 2001 From: howieyuen Date: Mon, 18 Apr 2022 19:35:31 +0800 Subject: [PATCH] [zh] translate zh/docs/reference/config-api/client-authentication.v1beta1 --- .../config-api/client-authentication.v1.md | 9 +- .../client-authentication.v1beta1.md | 152 ++++++++++++++---- 2 files changed, 124 insertions(+), 37 deletions(-) diff --git a/content/zh/docs/reference/config-api/client-authentication.v1.md b/content/zh/docs/reference/config-api/client-authentication.v1.md index e3b919b9c4..b1cf6a708b 100644 --- a/content/zh/docs/reference/config-api/client-authentication.v1.md +++ b/content/zh/docs/reference/config-api/client-authentication.v1.md @@ -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 数据将始终以字节形式传递给插件。 + @@ -167,7 +171,7 @@ clusters: 只是针对不同集群会有一些细节上的差异,例如 audience。 此字段使得特定于集群的配置可以直接使用集群信息来设置。 不建议使用此字段来保存 Secret 数据,因为 exec 插件的主要优势之一是不需要在 - kubeconfig 中保存 Secret 数据。 + kubeconfig 中保存 Secret 数据。

@@ -222,6 +226,7 @@ ExecCredentialSpec 保存传输组件所提供的特定于请求和运行时的 +**出现在:** - [ExecCredential](#client-authentication-k8s-io-v1-ExecCredential) @@ -235,7 +240,7 @@ itself should at least be protected via file permissions.

ExecCredentialStatus 中包含传输组件要使用的凭据。

字段 token 和 clientKeyData 都是敏感字段。此数据只能在 客户端与 exec 插件进程之间使用内存来传递。exec 插件本身至少 -应通过文件访问许可来实施保护。

》 +应通过文件访问许可来实施保护。

字段描述
diff --git a/content/zh/docs/reference/config-api/client-authentication.v1beta1.md b/content/zh/docs/reference/config-api/client-authentication.v1beta1.md index e78edd23f6..b683ed5736 100644 --- a/content/zh/docs/reference/config-api/client-authentication.v1beta1.md +++ b/content/zh/docs/reference/config-api/client-authentication.v1beta1.md @@ -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 --- + + + +## 资源类型 {#resource-types} - [ExecCredential](#client-authentication-k8s-io-v1beta1-ExecCredential) @@ -20,11 +30,14 @@ auto_generated: true + +ExecCredential 由基于 exec 的插件使用,与 HTTP 传输组件沟通凭据信息。
字段描述
- + @@ -33,11 +46,13 @@ HTTP transports. - + + 字段 spec 包含由 HTTP 传输组件传递给插件的信息。 + @@ -45,8 +60,10 @@ HTTP transports. ExecCredentialStatus + + 字段 status 由插件填充,包含传输组件与 API 服务器连接时需要提供的凭据。 + @@ -60,11 +77,13 @@ should use to contact the API. -**Appears in:** + +**出现在:** - [ExecCredentialSpec](#client-authentication-k8s-io-v1beta1-ExecCredentialSpec) + +Cluster 中包含允许 exec 插件与 Kubernetes 集群进行通信身份认证时所需 +的信息。 + +为了确保该结构体包含需要与 Kubernetes 集群进行通信的所有内容(就像通过 Kubeconfig 一样), +该字段应该映射到 "k8s.io/client-go/tools/clientcmd/api/v1".cluster, +除了证书授权之外,由于 CA 数据将始终以字节形式传递给插件。
FieldDescription
字段描述
apiVersion
string
client.authentication.k8s.io/v1beta1
spec [Required]
+
spec [必需]
ExecCredentialSpec
- Spec holds information passed to the plugin by the transport.
- Status is filled in by the plugin and holds the credentials that the transport -should use to contact the API.
- + - + + 字段 server 是 Kubernetes 集群的地址(https://hostname:port)。 + @@ -91,9 +119,14 @@ of CertificateAuthority, since CA data will always be passed to the plugin as by string @@ -101,8 +134,13 @@ used to contact the server is used.bool @@ -110,8 +148,13 @@ This will make your HTTPS connections insecure.[]byte @@ -119,8 +162,9 @@ If empty, system roots should be used.string + + 此字段用来设置向集群发送所有请求时要使用的代理服务器。 + @@ -128,27 +172,40 @@ cluster.k8s.io/apimachinery/pkg/runtime.RawExtension @@ -162,16 +219,20 @@ to be stored directly in the kubeconfig. -**Appears in:** + +**出现在:** - [ExecCredential](#client-authentication-k8s-io-v1beta1-ExecCredential) + +ExecCredentialSpec 保存传输组件所提供的特定于请求和运行时的信息。
FieldDescription
字段描述
server [Required]
+
server [必需]
string
- Server is the address of the kubernetes cluster (https://hostname:port).
+ + tls-server-name 是用来提供给服务器用作 SNI 解析的,客户端以此检查服务器的证书。 + 如此字段为空,则使用链接服务器时使用的主机名。 +
+ + 设置此字段之后,会令客户端跳过对服务器端证书的合法性检查。 + 这会使得你的 HTTPS 链接不再安全。 +
+ + 此字段包含 PEM 编码的证书机构(CA)证书。 + 如果为空,则使用系统的根证书。 +
- ProxyURL is the URL to the proxy to be used for all requests to this -cluster.
+ +

此字段包含一些额外的、特定于 exec 插件和所连接的集群的数据,

+

此字段来自于 clientcmd 集群对象的 extensions[client.authentication.k8s.io/exec] + 字段:

+
 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  # 任意配置信息
+
+ +

在某些环境中,用户配置可能对很多集群而言都完全一样(即调用同一个 exec 插件), +只是针对不同集群会有一些细节上的差异,例如 audience。 +此字段使得特定于集群的配置可以直接使用集群信息来设置。 +不建议使用此字段来保存 Secret 数据,因为 exec 插件的主要优势之一是不需要在 +kubeconfig 中保存 Secret 数据。

+
- + @@ -180,10 +241,16 @@ the transport. Cluster @@ -197,20 +264,27 @@ ExecConfig.ProvideClusterInfo). -**Appears in:** + +**出现在:** - [ExecCredential](#client-authentication-k8s-io-v1beta1-ExecCredential) + +

ExecCredentialStatus 中包含传输组件要使用的凭据。

+ +

字段 token 和 clientKeyData 都是敏感字段。 +此数据只能在客户端与 exec 插件进程之间使用内存来传递。 +exec 插件本身至少应通过文件访问许可来实施保护。

FieldDescription
字段描述
+ + 此字段中包含的信息使得 exec 插件能够与要访问的 Kubernetes 集群通信。 + 注意,cluster 字段只有在 exec 驱动的配置中 provideClusterInfo + (即:ExecConfig.ProvideClusterInfo)被设置为 true 时才不能为空。 +
- - + @@ -218,31 +292,39 @@ itself should at least be protected via file permissions. meta/v1.Time + + 给出所提供的凭据到期的时间。 + - + + 客户端用做请求身份认证的持有者令牌。 + - + + PEM 编码的客户端 TLS 证书(如果有临时证书,也会包含)。 + - + + 与上述证书对应的、PEM 编码的私钥。 +
FieldDescription
字段描述
- ExpirationTimestamp indicates a time when the provided credentials expire.
token [Required]
+
token [必需]
string
- Token is a bearer token used by the client for request authentication.
clientCertificateData [Required]
+
clientCertificateData [必需]
string
- PEM-encoded client TLS certificates (including intermediates, if any).
clientKeyData [Required]
+
clientKeyData [必需]
string
- PEM-encoded private key for the above certificate.