From 9bbaab5d0b8f577f7f9f7bd58b0576a61cf5a9f5 Mon Sep 17 00:00:00 2001 From: "xin.li" Date: Tue, 26 Apr 2022 19:29:12 +0800 Subject: [PATCH] [zh] Create kubernetes-api/authentication-resources/service-account-v1.md Signed-off-by: xin.li --- .../service-account-v1.md | 808 ++++++++++++++++++ 1 file changed, 808 insertions(+) create mode 100644 content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md diff --git a/content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md b/content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md new file mode 100644 index 0000000000..f306b2cf21 --- /dev/null +++ b/content/zh/docs/reference/kubernetes-api/authentication-resources/service-account-v1.md @@ -0,0 +1,808 @@ +--- +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 +--- + + + + + +`apiVersion: v1` + +`import "k8s.io/api/core/v1"` + + +## ServiceAccount {#ServiceAccount} + + +ServiceAccount 将以下内容绑定在一起: +* 用户可以理解的名称,也可能是外围系统理解的身份标识 +* 可以验证和授权的主体 +* 一组 secret + +
+ +- **apiVersion**: v1 + + +- **kind**: ServiceAccount + + +- **metadata** (}}">ObjectMeta) + + + 标准对象的元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + +- **automountServiceAccountToken** (boolean) + + + AutomountServiceAccountToken 指示作为此服务帐户运行的 pod 是否应自动挂载 API 令牌, + 可以在 pod 级别覆盖。 + +- **imagePullSecrets** ([]}}">LocalObjectReference) + + + imagePullSecrets 是对同一命名空间中 Secret 的引用列表,用于拉取引用此 ServiceAccount 的 Pod 中的任何镜像。 + imagePullSecrets 与 Secrets 不同,因为 Secrets 可以挂载在 Pod 中,但 imagePullSecrets 只能由 kubelet 访问。 + 更多信息:https://kubernetes.io/zh/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod + +- **secrets** ([]}}">ObjectReference) + + + **补丁策略:基于键 `name` 合并** + Secrets 是允许使用此 ServiceAccount 运行的 Pod 使用的 Secret 列表。 + 更多信息:https://kubernetes.io/zh/docs/concepts/configuration/secret + +## ServiceAccountList {#ServiceAccountList} + + +ServiceAccountList 是 ServiceAccount 对象的列表 + +
+ +- **apiVersion**: v1 + + +- **kind**: ServiceAccountList + + +- **metadata** (}}">ListMeta) + + + 标准列表元数据, 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + + +- **items** ([]}}">ServiceAccount), 必需 + + + ServiceAccount 列表,更多信息:https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-service-account/ + + +## 操作 {#Operations} + +
+ + +### `get` 读取指定的 ServiceAccount + +#### HTTP 请求 + +GET /api/v1/namespaces/{namespace}/serviceaccounts/{name} + + +#### 参数 + + +- **name** (**位于路径中**): string, 必需 + + + ServiceAccount 的名称 + + +- **namespace** (**位于路径中**): string, 必需 + + }}">namespace + + +- **pretty** (**查询字符串**): string + + }}">pretty + + +#### 响应 + +200 (}}">ServiceAccount): OK + +401: Unauthorized + + +### `list` 列出或监控 ServiceAccount 类型的对象 + +#### HTTP 请求 + +GET /api/v1/namespaces/{namespace}/serviceaccounts + + +#### 参数 + + +- **namespace** (**位于路径中**): string, 必需 + + }}">namespace + + +- **allowWatchBookmarks** (**查询字符串**): boolean + + }}">allowWatchBookmarks + + +- **continue** (**查询字符串**): string + + }}">continue + + +- **fieldSelector** (**查询字符串**): string + + }}">fieldSelector + + + +- **labelSelector** (**查询字符串**): string + + }}">labelSelector + + + +- **limit** (*查询字符串*): integer + + }}">limit + + +- **pretty** (**查询字符串**): string + + }}">pretty + + +- **resourceVersion** (**查询字符串**): string + + }}">resourceVersion + + +- **resourceVersionMatch** (**查询字符串**): string + + }}">resourceVersionMatch + + +- **timeoutSeconds** (**查询字符串**): integer + + }}">timeoutSeconds + + +- **watch** (**查询字符串**): boolean + + }}">watch + + +#### 响应 + + +200 (}}">ServiceAccountList): OK + +401: Unauthorized + + +### `list` 列出或监控 ServiceAccount 类型的对象 + +#### HTTP 请求 + +GET /api/v1/serviceaccounts + + +#### 参数 + + +- **allowWatchBookmarks** (**查询字符串**): boolean + + }}">allowWatchBookmarks + + +- **continue** (**查询字符串**): string + + }}">continue + + +- **fieldSelector** (**查询字符串**): string + + }}">fieldSelector + + + +- **labelSelector** (**查询字符串**): string + + }}">labelSelector + + +- **limit** (**查询字符串**): integer + + }}">limit + + +- **pretty** (**查询字符串**): string + + }}">pretty + + +- **resourceVersion** (**查询字符串**): string + + }}">resourceVersion + + +- **resourceVersionMatch** (**查询字符串**): string + + }}">resourceVersionMatch + + +- **timeoutSeconds** (**查询字符串**): integer + + }}">timeoutSeconds + + +- **watch** (**查询字符串**): boolean + + }}">watch + + + +#### 响应 + +200 (}}">ServiceAccountList): OK + +401: Unauthorized + + +### `create` 创建一个 ServiceAccount + +#### HTTP 请求 + +POST /api/v1/namespaces/{namespace}/serviceaccounts + + +#### 参数 + + +- **namespace** (**位于路径中**): string, 必需 + + }}">namespace + + +- **body**: }}">ServiceAccount,必需 + + +- **dryRun** (**查询字符串**): string + + }}">dryRun + + +- **fieldManager** (**查询字符串**): string + + }}">fieldManager + + +- **fieldValidation** (**查询字符串**): string + + }}">fieldValidation + + + +- **pretty** (**查询字符串**): string + + }}">pretty + + + +#### 响应 + +200 (}}">ServiceAccount): OK + +201 (}}">ServiceAccount): Created + +202 (}}">ServiceAccount): Accepted + +401: Unauthorized + + +`update` 替换指定的ServiceAccount + +#### HTTP 请求 + +PUT /api/v1/namespaces/{namespace}/serviceaccounts/{name} + + +#### 参数 + + +- **name** (**位于路径中**): string, required + + name of the ServiceAccount + + + +- **namespace** (**位于路径中**): string, 必需 + + }}">namespace + + +- **body**: }}">ServiceAccount,必需 + + +- **dryRun** (**查询字符串**): string + + }}">dryRun + + +- **fieldManager** (**查询字符串**): string + + }}">fieldManager + + +- **fieldValidation** (**查询字符串**): string + + }}">fieldValidation + + + +- **pretty** (**查询字符串**): string + + }}">pretty + + +#### 响应 + +200 (}}">ServiceAccount): OK + +201 (}}">ServiceAccount): Created + +401: Unauthorized + + +`patch` 部分更新指定的 ServiceAccount + +#### HTTP 请求 + +PATCH /api/v1/namespaces/{namespace}/serviceaccounts/{name} + + +#### 参数 + + +- **name** (**位于路径中**): string, 必需 + + + ServiceAccount 的名称 + + +- **namespace** (**位于路径中**): string, 必需 + + }}">namespace + + +- **body**: }}">Patch, required + + + +- **dryRun** (**查询字符串**): string + + }}">dryRun + + +- **fieldManager** (**查询字符串**): string + + }}">fieldManager + + +- **fieldValidation** (**查询字符串**): string + + }}">fieldValidation + + +- **force** (**查询字符串**): boolean + + }}">force + + + +- **pretty** (**查询字符串**): string + + }}">pretty + + + +#### 响应 + + +200 (}}">ServiceAccount): OK + +201 (}}">ServiceAccount): Created + +401: Unauthorized + + +### `delete` 删除一个 ServiceAccount +#### HTTP 请求 + + +DELETE /api/v1/namespaces/{namespace}/serviceaccounts/{name} + + +#### 参数 + + +- **name** (**位于路径中**): string, 必需 + + + ServiceAccount 的名称 + + + +- **namespace** (**位于路径中**): string, 必需 + + }}">namespace + + +- **body**: }}">DeleteOptions + + +- **dryRun** (**查询字符串**): string + + }}">dryRun + + +- **gracePeriodSeconds** (*查询字符串*): integer + + }}">gracePeriodSeconds + + + +- **pretty** (**查询字符串**): string + + }}">pretty + + +- **propagationPolicy** (*in query*): string + + }}">propagationPolicy + + + +#### 响应 + +200 (}}">ServiceAccount): OK + +202 (}}">ServiceAccount): Accepted + +401: Unauthorized + + +### `deletecollection` 删除 ServiceAccount 的集合 + +#### HTTP 请求 + +DELETE /api/v1/namespaces/{namespace}/serviceaccounts + + +#### 参数 + + +- **namespace** (**位于路径中**): string, 必需 + + }}">namespace + + +- **body**: }}">DeleteOptions + + +- **continue** (**查询字符串**): string + + }}">continue + + + +- **dryRun** (**查询字符串**): string + + }}">dryRun + + +- **fieldSelector** (**查询字符串**): string + + }}">fieldSelector + + + +- **gracePeriodSeconds** (*查询字符串*): integer + + }}">gracePeriodSeconds + + +- **labelSelector** (*查询字符串*): string + + }}">labelSelector + + +- **limit** (*查询字符串*): integer + + }}">limit + + + +- **pretty** (**查询字符串**): string + + }}">pretty + + +- **propagationPolicy** (**查询字符串**): string + + }}">propagationPolicy + + +- **resourceVersion** (**查询字符串**): string + + }}">resourceVersion + + +- **resourceVersionMatch** (**查询字符串**): string + + }}">resourceVersionMatch + + +- **timeoutSeconds** (**查询字符串**): integer + + }}">timeoutSeconds + + + +#### 响应 + +200 (}}">Status): OK + +401: Unauthorized +