diff --git a/content/zh/docs/reference/access-authn-authz/authentication.md b/content/zh/docs/reference/access-authn-authz/authentication.md index 030a628860..bd3aa07909 100644 --- a/content/zh/docs/reference/access-authn-authz/authentication.md +++ b/content/zh/docs/reference/access-authn-authz/authentication.md @@ -351,7 +351,7 @@ talk to the API server. Accounts may be explicitly associated with pods using th 服务账号通常由 API 服务器自动创建并通过 `ServiceAccount` [准入控制器](/zh/docs/reference/access-authn-authz/admission-controllers/) 关联到集群中运行的 Pod 上。 -持有者令牌会挂载到 Pod 中可预知的为之,允许集群内进程与 API 服务器通信。 +持有者令牌会挂载到 Pod 中可预知的位置,允许集群内进程与 API 服务器通信。 服务账号也可以使用 Pod 规约的 `serviceAccountName` 字段显式地关联到 Pod 上。 + +调用此插件时可以选择性地设置环境变量 `KUBERNETES_EXEC_INFO`。 +该变量包含了此插件获取凭据所针对的集群信息。此信息可用于执行群集特定的凭据获取逻辑。 +为了启用此行为,必须在 [kubeconfig](/zh/docs/concepts/configuration/organize-cluster-access-kubeconfig/) +中的 exec user 字段上设置`provideClusterInfo`字段。 +下面是上述 `KUBERNETES_EXEC_INFO` 环境变量的示例。 + +```json +{ + "apiVersion": "client.authentication.k8s.io/v1beta1", + "kind": "ExecCredential", + "spec": { + "cluster": { + "server": "https://172.17.4.100:6443", + "certificate-authority-data": "LS0t...", + "config": { + "arbitrary": "config", + "this": "在设置 provideClusterInfo 时可通过环境变量 KUBERNETES_EXEC_INFO 指定", + "you": ["can", "put", "anything", "here"] + } + } + } +} +```