ConfigMap
apiVersion: v1
import "k8s.io/api/core/v1"
ConfigMap
ConfigMap 包含供 Pod 使用的配置数据。
- 
apiVersion: v1 
- 
kind: ConfigMap 
- 
metadata (ObjectMeta) 标准的对象元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- 
binaryData (map[string][]byte) binaryData 包含二进制数据。 每个键必须由字母、数字、“-”、“_” 或 “.” 组成。 binaryData 可以包含不在 UTF-8 范围中的字节序列。 binaryData 中存储的键不得与 data 字段中的键重叠,这在验证过程中是强制要求。 使用此字段需要 apiserver 和 kubelet 的版本高于 1.10。 
- 
data (map[string]string) data 包含配置数据。 每个键必须由字母、数字、“-”、“_” 或 “.” 组成。 如果值包含非 UTF-8 字节序列,则必须使用 binaryData 字段。 data 中存储的键不得与 binaryData 字段中的键重叠,这在验证过程中是强制要求。 
- 
immutable (boolean) 如果 immutable 设为 true, 则确保不会更新 ConfigMap 中存储的数据(只能修改对象元数据)。 如果未设为 true,则可以随时修改此字段。 默认为 nil。 
ConfigMapList
ConfigMapList 是包含 ConfigMap 对象列表的资源。
- 
apiVersion: v1 
- 
kind: ConfigMapList 
- 
metadata (ListMeta) 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- 
items ([]ConfigMap),必需 items 是 ConfigMap 的列表。 
操作
get 读取指定的 ConfigMap
HTTP 请求
GET /api/v1/namespaces/{namespace}/configmaps/{name}
参数
- 
name (路径参数): string,必需 ConfigMap 的名称 
- 
namespace (路径参数): string,必需 
- 
pretty (查询参数): string 
响应
200 (ConfigMap): OK
401: Unauthorized
list 列出或观测类别为 ConfigMap 的对象
HTTP 请求
GET /api/v1/namespaces/{namespace}/configmaps
参数
- 
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 (ConfigMapList): OK
401: Unauthorized
list 列出或观测类别为 ConfigMap 的对象
HTTP 请求
GET /api/v1/configmaps
参数
- 
allowWatchBookmarks (查询参数): boolean 
- 
continue (查询参数): string 
- 
fieldSelector (查询参数): string 
- 
labelSelector (查询参数): string 
- 
limit (查询参数): integer 
- 
pretty (查询参数): string 
- 
resourceVersion (查询参数): string 
- 
resourceVersionMatch (查询参数): string 
- 
sendInitialEvents (查询参数): boolean 
- 
timeoutSeconds (查询参数): integer 
- 
watch (查询参数): boolean 
响应
200 (ConfigMapList): OK
401: Unauthorized
create 创建 ConfigMap
HTTP 请求
POST /api/v1/namespaces/{namespace}/configmaps
参数
- 
namespace (路径参数): string,必需 
- 
body: ConfigMap,必需 
- 
dryRun (查询参数): string 
- 
fieldManager (查询参数): string 
- 
fieldValidation (查询参数): string 
- 
pretty (查询参数): string 
响应
200 (ConfigMap): OK
201 (ConfigMap): Created
202 (ConfigMap): Accepted
401: Unauthorized
update 替换指定的 ConfigMap
HTTP 请求
PUT /api/v1/namespaces/{namespace}/configmaps/{name}
参数
- 
name (路径参数): string,必需 ConfigMap 的名称 
- 
namespace (路径参数): string,必需 
- 
body: ConfigMap,必需 
- 
dryRun (查询参数): string 
- 
fieldManager (查询参数): string 
- 
fieldValidation (查询参数): string 
- 
pretty (查询参数): string 
响应
200 (ConfigMap): OK
201 (ConfigMap): Created
401: Unauthorized
patch 部分更新指定的 ConfigMap
HTTP 请求
PATCH /api/v1/namespaces/{namespace}/configmaps/{name}
参数
- 
name (路径参数): string,必需 ConfigMap 的名称 
- 
namespace (路径参数): string,必需 
- 
body: Patch,必需 
- 
dryRun (查询参数): string 
- 
fieldManager (查询参数): string 
- 
fieldValidation (查询参数): string 
- 
force (查询参数): boolean 
- 
pretty (查询参数): string 
响应
200 (ConfigMap): OK
201 (ConfigMap): Created
401: Unauthorized
delete 删除 ConfigMap
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/configmaps/{name}
参数
- 
name (路径参数): string,必需 ConfigMap 的名称 
- 
namespace (路径参数): string,必需 
- 
body: DeleteOptions 
- 
dryRun (查询参数): string 
- 
gracePeriodSeconds (查询参数): integer 
- 
ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean 
- 
pretty (查询参数): string 
- 
propagationPolicy (查询参数): string 
响应
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection 删除 ConfigMap 的集合
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/configmaps
参数
- 
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: Unauthorized