Secret
apiVersion: v1
import "k8s.io/api/core/v1"
Secret
Secret 包含特定类型的秘密数据。Data 字段中所有值的总字节数必须小于 MaxSecretSize 字节。
- apiVersion: v1 
- kind: Secret 
- metadata (ObjectMeta) - 标准对象的元数据。更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- data (map[string][]byte) - Data 包含秘密数据。每个键必须由字母数字字符、'-'、'_' 或 '.' 组成。秘密数据的序列化形式是一个 base64 编码字符串,表示此处的任意(可能非字符串)数据值。详见 https://tools.ietf.org/html/rfc4648#section-4 
- immutable (boolean) - 如果设置为 true,Immutable 会确保存储在 Secret 中的数据无法更新(只能修改对象元数据)。如果未设置为 true,该字段可以随时修改。默认为 nil。 
- stringData (map[string]string) - stringData 允许以字符串形式指定非二进制秘密数据。它作为只写输入字段提供,以方便使用。所有键和值在写入时会合并到 data 字段中,覆盖任何现有值。从 API 读取时,stringData 字段永不输出。 
- type (string) - 用于方便对秘密数据的程序化处理。更多信息:https://kubernetes.ac.cn/docs/concepts/configuration/secret/#secret-types 
SecretList
SecretList 是 Secret 的列表。
- apiVersion: v1 
- kind: SecretList 
- metadata (ListMeta) - 标准列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 
- items ([]Secret), 必需 - Items 是秘密对象的列表。更多信息:https://kubernetes.ac.cn/docs/concepts/configuration/secret 
操作
get 读取指定的 Secret
HTTP 请求
GET /api/v1/namespaces/{namespace}/secrets/{name}
参数
响应
200 (Secret): 正常
401: 未授权
list 列出或监视 Secret 类型的对象
HTTP 请求
GET /api/v1/namespaces/{namespace}/secrets
参数
- namespace (在路径中): string,必填 
- allowWatchBookmarks (在查询中): boolean 
- continue (在查询中): string 
- fieldSelector (在查询中): string 
- labelSelector (在查询中): string 
- limit (在查询中): integer 
- pretty (在查询中): string 
- resourceVersion (在查询中): string 
- resourceVersionMatch (在查询中): string 
- sendInitialEvents (在查询中): boolean 
- timeoutSeconds (在查询中): integer 
- watch (在查询中): boolean 
响应
200 (SecretList): 正常
401: 未授权
list 列出或监视 Secret 类型的对象
HTTP 请求
GET /api/v1/secrets
参数
- allowWatchBookmarks (在查询中): boolean 
- continue (在查询中): string 
- fieldSelector (在查询中): string 
- labelSelector (在查询中): string 
- limit (在查询中): integer 
- pretty (在查询中): string 
- resourceVersion (在查询中): string 
- resourceVersionMatch (在查询中): string 
- sendInitialEvents (在查询中): boolean 
- timeoutSeconds (在查询中): integer 
- watch (在查询中): boolean 
响应
200 (SecretList): 正常
401: 未授权
create 创建一个 Secret
HTTP 请求
POST /api/v1/namespaces/{namespace}/secrets
参数
- namespace (在路径中): string,必填 
- body: Secret, 必需 
- dryRun (在查询中): string 
- fieldManager (在查询中): string 
- fieldValidation (在查询中): string 
- pretty (在查询中): string 
响应
200 (Secret): 正常
201 (Secret): 已创建
202 (Secret): 已接受
401: 未授权
update 替换指定的 Secret
HTTP 请求
PUT /api/v1/namespaces/{namespace}/secrets/{name}
参数
- name (在路径中): string,必填 - Secret 的名称 
- namespace (在路径中): string,必填 
- body: Secret, 必需 
- dryRun (在查询中): string 
- fieldManager (在查询中): string 
- fieldValidation (在查询中): string 
- pretty (在查询中): string 
响应
200 (Secret): 正常
201 (Secret): 已创建
401: 未授权
patch 部分更新指定的 Secret
HTTP 请求
PATCH /api/v1/namespaces/{namespace}/secrets/{name}
参数
- name (在路径中): string,必填 - Secret 的名称 
- namespace (在路径中): string,必填 
- body: Patch,必需 
- dryRun (在查询中): string 
- fieldManager (在查询中): string 
- fieldValidation (在查询中): string 
- force (在查询中): boolean 
- pretty (在查询中): string 
响应
200 (Secret): 正常
201 (Secret): 已创建
401: 未授权
delete 删除一个 Secret
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/secrets/{name}
参数
- name (在路径中): string,必填 - Secret 的名称 
- namespace (在路径中): string,必填 
- body: DeleteOptions 
- dryRun (在查询中): string 
- gracePeriodSeconds (在查询中): integer 
- ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean 
- pretty (在查询中): string 
- propagationPolicy (在查询中): string 
响应
200 (Status): OK
202 (Status): 已接受
401: 未授权
deletecollection 删除 Secret 集合
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/secrets
参数
- namespace (在路径中): string,必填 
- body: DeleteOptions 
- continue (在查询中): string 
- dryRun (在查询中): string 
- fieldSelector (在查询中): string 
- gracePeriodSeconds (在查询中): integer 
- ignoreStoreReadErrorWithClusterBreakingPotential (在查询中): boolean 
- labelSelector (在查询中): string 
- limit (在查询中): integer 
- pretty (在查询中): string 
- propagationPolicy (在查询中): string 
- resourceVersion (在查询中): string 
- resourceVersionMatch (在查询中): string 
- sendInitialEvents (在查询中): boolean 
- timeoutSeconds (在查询中): integer 
响应
200 (Status): OK
401: 未授权
本页面是自动生成的。
如果你打算报告此页面存在的问题,请在问题描述中提及此页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。