您正在查看 Kubernetes 版本的文档: v1.24

Kubernetes v1.24 版本的文档已不再维护。您现在看到的版本来自于一份静态的快照。如需查阅最新文档,请点击 最新版本。

ServiceAccount

ServiceAccount 将以下内容绑定在一起:1. 用户可以理解的名称,也可能是外围系统理解的身份标识 2. 可以验证和授权的主体 3. 一组 secret。

apiVersion: v1

import "k8s.io/api/core/v1"

ServiceAccount

ServiceAccount 将以下内容绑定在一起:

  • 用户可以理解的名称,也可能是外围系统理解的身份标识
  • 可以验证和授权的主体
  • 一组 secret

ServiceAccountList

ServiceAccountList 是 ServiceAccount 对象的列表


操作


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

  • continue (查询参数): string

    continue

  • limit (查询参数): integer

    limit

  • pretty (查询参数): string

    pretty

  • watch (查询参数): boolean

    watch

响应

200 (ServiceAccountList): OK

401: Unauthorized

list 列出或监控 ServiceAccount 类型的对象

HTTP 请求

GET /api/v1/serviceaccounts

参数

  • continue (查询参数): string

    continue

  • limit (查询参数): integer

    limit

  • pretty (查询参数): string

    pretty

  • watch (查询参数): boolean

    watch

响应

200 (ServiceAccountList): OK

401: Unauthorized

create 创建一个 ServiceAccount

HTTP 请求

POST /api/v1/namespaces/{namespace}/serviceaccounts

参数

  • namespace (路径参数): string, 必需

    namespace

  • dryRun (查询参数): string

    dryRun

  • 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

  • dryRun (查询参数): string

    dryRun

  • 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

  • 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 的名称

  • dryRun (查询参数): string

    dryRun

响应

200 (ServiceAccount): OK

202 (ServiceAccount): Accepted

401: Unauthorized

deletecollection 删除 ServiceAccount 的集合

HTTP 请求

DELETE /api/v1/namespaces/{namespace}/serviceaccounts

参数

  • continue (查询参数): string

    continue

  • dryRun (查询参数): string

    dryRun

  • limit (查询参数): integer

    limit

  • pretty (查询参数): string

    pretty

响应

200 (Status): OK

401: Unauthorized