Switch language name 'zh' to 'zh-cn'

This is the first step to rename 'zh' to 'zh-cn'. There are several reasons why we rename the language name.

- The upstream docsy theme changed the language name, leading to many warnings during site build;
  The side-effect is that the i18n strings are no longer working.
- We believe renaming the language is the right thing to do, because this move can make room for other variants of Chinese language, such as 'zh-tw', 'zh-sg' etc.

There would be several follow-ups to this PR, such as fixing the intra-site links, adding redirects etc.

We will lock up changes to zh/zh-cn pages for the moment, until this one gets in.

This PR is based on commit cdad0a7342.
This commit is contained in:
Qiming Teng
2022-06-10 20:25:27 +08:00
parent 3d345b1816
commit c52818c03d
1347 changed files with 8 additions and 6 deletions
@@ -0,0 +1,5 @@
---
title: "身份认证资源"
weight: 4
auto_generated: true
---
@@ -0,0 +1,817 @@
---
api_metadata:
apiVersion: "v1"
import: "k8s.io/api/core/v1"
kind: "ServiceAccount"
content_type: "api_reference"
description: "ServiceAccount 将以下内容绑定在一起:1. 用户可以理解的名称,也可能是外围系统理解的身份标识 2. 可以验证和授权的主体 3. 一组 secret。"
title: "ServiceAccount"
weight: 1
auto_generated: true
---
<!--
api_metadata:
apiVersion: "v1"
import: "k8s.io/api/core/v1"
kind: "ServiceAccount"
content_type: "api_reference"
description: "ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets."
title: "ServiceAccount"
weight: 1
auto_generated: true
-->
<!--
The file is auto-generated from the Go source code of the component using a generic
[generator](https://github.com/kubernetes-sigs/reference-docs/). To learn how
to generate the reference documentation, please read
[Contributing to the reference documentation](/docs/contribute/generate-ref-docs/).
To update the reference content, please follow the
[Contributing upstream](/docs/contribute/generate-ref-docs/contribute-upstream/)
guide. You can file document formatting bugs against the
[reference-docs](https://github.com/kubernetes-sigs/reference-docs/) project.
-->
`apiVersion: v1`
`import "k8s.io/api/core/v1"`
## ServiceAccount {#ServiceAccount}
<!--
ServiceAccount binds together: * a name, understood by users, and perhaps by peripheral systems, for an identity * a principal that can be authenticated and authorized * a set of secrets
-->
ServiceAccount 将以下内容绑定在一起:
* 用户可以理解的名称,也可能是外围系统理解的身份标识
* 可以验证和授权的主体
* 一组 secret
<hr>
- **apiVersion**: v1
- **kind**: ServiceAccount
- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)
<!--
Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
-->
标准对象的元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- **automountServiceAccountToken** (boolean)
<!--
AutomountServiceAccountToken indicates whether pods running as this service account should have an API token automatically mounted. Can be overridden at the pod level.
-->
AutomountServiceAccountToken 指示作为此服务帐户运行的 pod 是否应自动挂载 API 令牌,
可以在 pod 级别覆盖。
- **imagePullSecrets** ([]<a href="{{< ref "../common-definitions/local-object-reference#LocalObjectReference" >}}">LocalObjectReference</a>)
<!--
ImagePullSecrets is a list of references to secrets in the same namespace to use for pulling any images in pods that reference this ServiceAccount. ImagePullSecrets are distinct from Secrets because Secrets can be mounted in the pod, but ImagePullSecrets are only accessed by the kubelet. More info: https://kubernetes.io/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
-->
imagePullSecrets 是对同一命名空间中 Secret 的引用列表,用于拉取引用此 ServiceAccount 的 Pod 中的任何镜像。
imagePullSecrets 与 Secrets 不同,因为 Secrets 可以挂载在 Pod 中,但 imagePullSecrets 只能由 kubelet 访问。
更多信息: https://kubernetes.io/zh/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
- **secrets** ([]<a href="{{< ref "../common-definitions/object-reference#ObjectReference" >}}">ObjectReference</a>)
<!--
*Patch strategy: merge on key `name`*
Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use. Pods are only limited to this list if this service account has a "kubernetes.io/enforce-mountable-secrets" annotation set to "true". This field should not be used to find auto-generated service account token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or service account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret
Secrets is a list of the secrets in the same namespace that pods running using this ServiceAccount are allowed to use
Pods are only limited to this list if this service account has a "kubernetes.io/enforce-mountabl
-secrets" annotation set to "true". This field should not be used to find auto-generated service accoun
token secrets for use outside of pods. Instead, tokens can be requested directly using the TokenRequest API, or servic
account token secrets can be manually created. More info: https://kubernetes.io/docs/concepts/configuration/secret
-->
**补丁策略:基于键 `name` 合并**
Secrets 是允许使用此 ServiceAccount 运行的 pod 使用的同一命名空间中的秘密列表。
仅当此服务帐户的 “kubernetes.io/enforce-mountable-secrets” 注释设置为 “true” 时,Pod 才限于此列表。
此字段不应用于查找自动生成的服务帐户令牌机密以在 pod 之外使用。
相反,可以使用 TokenRequest API 直接请求令牌,或者可以手动创建服务帐户令牌 secret。
更多信息: https://kubernetes.io/docs/concepts/configuration/secret
## ServiceAccountList {#ServiceAccountList}
<!--
ServiceAccountList is a list of ServiceAccount objects
-->
ServiceAccountList 是 ServiceAccount 对象的列表
<hr>
- **apiVersion**: v1
- **kind**: ServiceAccountList
- **metadata** (<a href="{{< ref "../common-definitions/list-meta#ListMeta" >}}">ListMeta</a>)
<!--
Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
-->
标准列表元数据, 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
<!--
- **items** ([]<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>), required
-->
- **items** ([]<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>), 必需
<!--
List of ServiceAccounts. More info: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
-->
ServiceAccount 列表,更多信息: https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-service-account/
<!--
## Operations {#Operations}
-->
## 操作 {#Operations}
<hr>
<!--
### `get` read the specified ServiceAccount
#### HTTP Request
-->
### `get` 读取指定的 ServiceAccount
#### HTTP 请求
GET /api/v1/namespaces/{namespace}/serviceaccounts/{name}
<!--
#### Parameters
-->
#### 参数
<!--
- **name** (*in path*): string, required
-->
- **name** (**位于路径中**): string, 必需
<!--
name of the ServiceAccount
-->
ServiceAccount 的名称
<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**位于路径中**): string, 必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): OK
401: Unauthorized
<!--
### `list` list or watch objects of kind ServiceAccount
#### HTTP Request
-->
### `list` 列出或监控 ServiceAccount 类型的对象
#### HTTP 请求
GET /api/v1/namespaces/{namespace}/serviceaccounts
<!--
#### Parameters
-->
#### 参数
<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**位于路径中**): string, 必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
<!--
- **allowWatchBookmarks** (*in query*): boolean
-->
- **allowWatchBookmarks** (**查询字符串**): boolean
<a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks</a>
<!--
- **continue** (*in query*): string
-->
- **continue** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>
<!--
- **fieldSelector** (*in query*): string
-->
- **fieldSelector** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>
<!--
- **labelSelector** (*in query*): string
-->
- **labelSelector** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>
<!--
- **limit** (*in query*): integer
-->
- **limit** (*查询字符串*): integer
<a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
- **resourceVersion** (*in query*): string
-->
- **resourceVersion** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>
<!--
- **resourceVersionMatch** (*in query*): string
-->
- **resourceVersionMatch** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
<!--
- **timeoutSeconds** (*in query*): integer
-->
- **timeoutSeconds** (**查询字符串**): integer
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
<!--
- **watch** (*in query*): boolean
-->
- **watch** (**查询字符串**): boolean
<a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccountList" >}}">ServiceAccountList</a>): OK
401: Unauthorized
<!--
### `list` list or watch objects of kind ServiceAccount
#### HTTP Request
-->
### `list` 列出或监控 ServiceAccount 类型的对象
#### HTTP 请求
GET /api/v1/serviceaccounts
<!--
#### Parameters
-->
#### 参数
<!--
- **allowWatchBookmarks** (*in query*): boolean
-->
- **allowWatchBookmarks** (**查询字符串**): boolean
<a href="{{< ref "../common-parameters/common-parameters#allowWatchBookmarks" >}}">allowWatchBookmarks</a>
<!--
- **continue** (*in query*): string
-->
- **continue** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>
<!--
- **fieldSelector** (*in query*): string
-->
- **fieldSelector** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>
<!--
- **labelSelector** (*in query*): string
-->
- **labelSelector** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>
<!--
- **limit** (*in query*): integer
-->
- **limit** (**查询字符串**): integer
<a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
- **resourceVersion** (*in query*): string
-->
- **resourceVersion** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>
<!--
- **resourceVersionMatch** (*in query*): string
-->
- **resourceVersionMatch** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
<!--
- **timeoutSeconds** (*in query*): integer
-->
- **timeoutSeconds** (**查询字符串**): integer
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
<!--
- **watch** (*in query*): boolean
-->
- **watch** (**查询字符串**): boolean
<a href="{{< ref "../common-parameters/common-parameters#watch" >}}">watch</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccountList" >}}">ServiceAccountList</a>): OK
401: Unauthorized
<!--
### `create` create a ServiceAccount
#### HTTP Request
-->
### `create` 创建一个 ServiceAccount
#### HTTP 请求
POST /api/v1/namespaces/{namespace}/serviceaccounts
<!--
#### Parameters
-->
#### 参数
<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**位于路径中**): string, 必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
<!--
- **body**: <a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>, required
-->
- **body**: <a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>,必需
<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
<!--
- **fieldManager** (*in query*): string
-->
- **fieldManager** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>
<!--
- **fieldValidation** (*in query*): string
-->
- **fieldValidation** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): OK
201 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): Created
202 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): Accepted
401: Unauthorized
<!--
### `update` replace the specified ServiceAccount
#### HTTP Request
-->
`update` 替换指定的ServiceAccount
#### HTTP 请求
PUT /api/v1/namespaces/{namespace}/serviceaccounts/{name}
<!--
#### Parameters
-->
#### 参数
<!--
- **name** (*in path*): string, required
-->
- **name** (**位于路径中**): string, required
name of the ServiceAccount
<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**位于路径中**): string, 必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
<!--
- **body**: <a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>, required
-->
- **body**: <a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>,必需
<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
<!--
- **fieldManager** (*in query*): string
-->
- **fieldManager** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>
<!--
- **fieldValidation** (*in query*): string
-->
- **fieldValidation** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): OK
201 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): Created
401: Unauthorized
<!--
### `patch` partially update the specified ServiceAccount
#### HTTP Request
-->
`patch` 部分更新指定的 ServiceAccount
#### HTTP 请求
PATCH /api/v1/namespaces/{namespace}/serviceaccounts/{name}
<!--
#### Parameters
-->
#### 参数
<!--
- **name** (*in path*): string, required
-->
- **name** (**位于路径中**): string, 必需
<!--
name of the ServiceAccount
-->
ServiceAccount 的名称
<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**位于路径中**): string, 必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../common-definitions/patch#Patch" >}}">Patch</a>, required
<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
<!--
- **fieldManager** (*in query*): string
-->
- **fieldManager** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>
<!--
- **fieldValidation** (*in query*): string
-->
- **fieldValidation** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>
<!--
- **force** (*in query*): boolean
-->
- **force** (**查询字符串**): boolean
<a href="{{< ref "../common-parameters/common-parameters#force" >}}">force</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): OK
201 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): Created
401: Unauthorized
<!--
### `delete` delete a ServiceAccount
#### HTTP Request
-->
### `delete` 删除一个 ServiceAccount
#### HTTP 请求
DELETE /api/v1/namespaces/{namespace}/serviceaccounts/{name}
<!--
#### Parameters
-->
#### 参数
<!--
- **name** (*in path*): string, required
-->
- **name** (**位于路径中**): string, 必需
<!--
name of the ServiceAccount
-->
ServiceAccount 的名称
<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**位于路径中**): string, 必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions</a>
<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
<!--
- **gracePeriodSeconds** (*in query*): integer
-->
- **gracePeriodSeconds** (*查询字符串*): integer
<a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
- **propagationPolicy** (*in query*): string
<a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): OK
202 (<a href="{{< ref "../authentication-resources/service-account-v1#ServiceAccount" >}}">ServiceAccount</a>): Accepted
401: Unauthorized
<!--
### `deletecollection` delete collection of ServiceAccount
#### HTTP Request
-->
### `deletecollection` 删除 ServiceAccount 的集合
#### HTTP 请求
DELETE /api/v1/namespaces/{namespace}/serviceaccounts
<!--
#### Parameters
-->
#### 参数
<!--
- **namespace** (*in path*): string, required
-->
- **namespace** (**位于路径中**): string, 必需
<a href="{{< ref "../common-parameters/common-parameters#namespace" >}}">namespace</a>
- **body**: <a href="{{< ref "../common-definitions/delete-options#DeleteOptions" >}}">DeleteOptions</a>
<!--
- **continue** (*in query*): string
-->
- **continue** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#continue" >}}">continue</a>
<!--
- **dryRun** (*in query*): string
-->
- **dryRun** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
<!--
- **fieldSelector** (*in query*): string
-->
- **fieldSelector** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#fieldSelector" >}}">fieldSelector</a>
<!--
- **gracePeriodSeconds** (*in query*): integer
-->
- **gracePeriodSeconds** (*查询字符串*): integer
<a href="{{< ref "../common-parameters/common-parameters#gracePeriodSeconds" >}}">gracePeriodSeconds</a>
<!--
- **labelSelector** (*in query*): string
-->
- **labelSelector** (*查询字符串*): string
<a href="{{< ref "../common-parameters/common-parameters#labelSelector" >}}">labelSelector</a>
<!--
- **limit** (*in query*): integer
-->
- **limit** (*查询字符串*): integer
<a href="{{< ref "../common-parameters/common-parameters#limit" >}}">limit</a>
<!--
- **pretty** (*in query*): string
-->
- **pretty** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
- **propagationPolicy** (*in query*): string
-->
- **propagationPolicy** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#propagationPolicy" >}}">propagationPolicy</a>
<!--
- **resourceVersion** (*in query*): string
-->
- **resourceVersion** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersion" >}}">resourceVersion</a>
<!--
- **resourceVersionMatch** (*in query*): string
-->
- **resourceVersionMatch** (**查询字符串**): string
<a href="{{< ref "../common-parameters/common-parameters#resourceVersionMatch" >}}">resourceVersionMatch</a>
<!--
- **timeoutSeconds** (*in query*): integer
-->
- **timeoutSeconds** (**查询字符串**): integer
<a href="{{< ref "../common-parameters/common-parameters#timeoutSeconds" >}}">timeoutSeconds</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../common-definitions/status#Status" >}}">Status</a>): OK
401: Unauthorized
@@ -0,0 +1,222 @@
---
api_metadata:
apiVersion: "authentication.k8s.io/v1"
import: "k8s.io/api/authentication/v1"
kind: "TokenReview"
content_type: "api_reference"
description: "TokenReview 尝试通过验证令牌来确认已知用户。"
title: "TokenReview"
weight: 3
auto_generated: true
---
<!--
api_metadata:
apiVersion: "authentication.k8s.io/v1"
import: "k8s.io/api/authentication/v1"
kind: "TokenReview"
content_type: "api_reference"
description: "TokenReview attempts to authenticate a token to a known user."
title: "TokenReview"
weight: 3
auto_generated: true
-->
`apiVersion: authentication.k8s.io/v1`
`import "k8s.io/api/authentication/v1"`
<!--
## TokenReview {#TokenReview}
TokenReview attempts to authenticate a token to a known user. Note: TokenReview requests may be cached by the webhook token authenticator plugin in the kube-apiserver.
-->
## TokenReview {#TokenReview}
TokenReview 尝试通过验证令牌来确认已知用户。
注意:TokenReview 请求可能会被 kube-apiserver 中的 webhook 令牌验证器插件缓存。
<hr>
- **apiVersion**: authentication.k8s.io/v1
- **kind**: TokenReview
- **metadata** (<a href="{{< ref "../common-definitions/object-meta#ObjectMeta" >}}">ObjectMeta</a>)
<!--
Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
-->
标准对象的元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
- **spec** (<a href="{{< ref "../authentication-resources/token-review-v1#TokenReviewSpec" >}}">TokenReviewSpec</a>), required
<!--
Spec holds information about the request being evaluated
-->
spec 保存有关正在评估的请求的信息
- **status** (<a href="{{< ref "../authentication-resources/token-review-v1#TokenReviewStatus" >}}">TokenReviewStatus</a>)
<!--
Status is filled in by the server and indicates whether the request can be authenticated.
-->
status 由服务器填写,指示请求是否可以通过身份验证。
## TokenReviewSpec {#TokenReviewSpec}
<!--
TokenReviewSpec is a description of the token authentication request.
-->
TokenReviewPec 是对令牌身份验证请求的描述。
<hr>
- **audiences** ([]string)
<!--
Audiences is a list of the identifiers that the resource server presented with the token identifies as. Audience-aware token authenticators will verify that the token was intended for at least one of the audiences in this list. If no audiences are provided, the audience will default to the audience of the Kubernetes apiserver.
-->
audiences 是带有令牌的资源服务器标识为受众的标识符列表。
受众感知令牌身份验证器将验证令牌是否适用于此列表中的至少一个受众。
如果未提供受众,受众将默认为 Kubernetes API 服务器的受众。
- **token** (string)
<!--
Token is the opaque bearer token.
-->
token 是不透明的持有者令牌(Bearer Token)。
## TokenReviewStatus {#TokenReviewStatus}
<!--
TokenReviewStatus is the result of the token authentication request.
-->
TokenReviewStatus 是令牌认证请求的结果。
<hr>
- **audiences** ([]string)
<!--
Audiences are audience identifiers chosen by the authenticator that are compatible with both the TokenReview and token. An identifier is any identifier in the intersection of the TokenReviewSpec audiences and the token's audiences. A client of the TokenReview API that sets the spec.audiences field should validate that a compatible audience identifier is returned in the status.audiences field to ensure that the TokenReview server is audience aware. If a TokenReview returns an empty status.audience field where status.authenticated is "true", the token is valid against the audience of the Kubernetes API server.
-->
audiences 是身份验证者选择的与 TokenReview 和令牌兼容的受众标识符。标识符是
TokenReviewSpec 受众和令牌受众的交集中的任何标识符。设置 spec.audiences
字段的 TokenReview API 的客户端应验证在 status.audiences 字段中返回了兼容的受众标识符,
以确保 TokenReview 服务器能够识别受众。如果 TokenReview
返回一个空的 status.audience 字段,其中 status.authenticated 为 “true”,
则该令牌对 Kubernetes API 服务器的受众有效。
- **authenticated** (boolean)
<!--
Authenticated indicates that the token was associated with a known user.
-->
authenticated 表示令牌与已知用户相关联。
- **error** (string)
<!--
Error indicates that the token couldn't be checked
-->
error 表示无法检查令牌
- **user** (UserInfo)
<!--
User is the UserInfo associated with the provided token.
-->
user 是与提供的令牌关联的 UserInfo。
<a name="UserInfo"></a>
<--
*UserInfo holds the information about the user needed to implement the user.Info interface.*
-->
**UserInfo 保存实现 user.Info 接口所需的用户信息**
- **user.extra** (map[string][]string)
<!--
Any additional information provided by the authenticator.
-->
验证者提供的任何附加信息。
- **user.groups** ([]string)
<!--
The names of groups this user is a part of.
-->
此用户所属的组的名称。
- **user.uid** (string)
<!--
A unique value that identifies this user across time. If this user is deleted and another user by the same name is added, they will have different UIDs.
-->
跨时间标识此用户的唯一值。如果删除此用户并添加另一个同名用户,他们将拥有不同的 UID。
- **user.username** (string)
<!--
The name that uniquely identifies this user among all active users.
-->
在所有活动用户中唯一标识此用户的名称。
<!--
## Operations {#Operations}
-->
## 操作 {#Operations}
<hr>
<!--
### `create` create a TokenReview
#### HTTP Request
-->
### `create` 创建一个TokenReview
#### HTTP 请求
POST /apis/authentication.k8s.io/v1/tokenreviews
<!--
#### Parameters
- **body**: <a href="{{< ref "../authentication-resources/token-review-v1#TokenReview" >}}">TokenReview</a>, required
-->
#### 参数
- **body**: <a href="{{< ref "../authentication-resources/token-review-v1#TokenReview" >}}">TokenReview</a>, 必需
- **dryRun** (*in query*): string
<a href="{{< ref "../common-parameters/common-parameters#dryRun" >}}">dryRun</a>
- **fieldManager** (*in query*): string
<a href="{{< ref "../common-parameters/common-parameters#fieldManager" >}}">fieldManager</a>
- **fieldValidation** (*in query*): string
<a href="{{< ref "../common-parameters/common-parameters#fieldValidation" >}}">fieldValidation</a>
- **pretty** (*in query*): string
<a href="{{< ref "../common-parameters/common-parameters#pretty" >}}">pretty</a>
<!--
#### Response
-->
#### 响应
200 (<a href="{{< ref "../authentication-resources/token-review-v1#TokenReview" >}}">TokenReview</a>): OK
201 (<a href="{{< ref "../authentication-resources/token-review-v1#TokenReview" >}}">TokenReview</a>): Created
202 (<a href="{{< ref "../authentication-resources/token-review-v1#TokenReview" >}}">TokenReview</a>): Accepted
401: Unauthorized