你正在查看的文档所针对的是 Kubernetes 版本: v1.32
Kubernetes v1.32 版本的文档已不再维护。你现在看到的版本来自于一份静态的快照。如需查阅最新文档,请点击 最新版本。
PodTemplate
apiVersion: v1
import "k8s.io/api/core/v1"
PodTemplate
PodTemplate 描述一种模板,用来为预定义的 Pod 生成副本。
- apiVersion: v1 
- kind: PodTemplate 
- metadata (ObjectMeta) - 标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- template (PodTemplateSpec) - template 定义将基于此 Pod 模板所创建的 Pod。 https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 
PodTemplateSpec
PodTemplateSpec 描述基于某模板所创建的 Pod 所应具有的数据。
- metadata (ObjectMeta) - 标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 
- spec (PodSpec) - Pod 预期行为的规约。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 
PodTemplateList
PodTemplateList 是 PodTemplate 对象的列表。
- apiVersion: v1 
- kind: PodTemplateList 
- metadata (ListMeta) - 标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 
- items ([]PodTemplate),必需 - PodTemplate 对象列表。 
操作
get 读取指定的 PodTemplate
HTTP 请求
GET /api/v1/namespaces/{namespace}/podtemplates/{name}
参数
- name (路径参数):string,必需 - PodTemplate 的名称。 
- namespace (路径参数):string,必需 
- pretty (查询参数):string 
响应
200 (PodTemplate): OK
401: Unauthorized
list 列出或监视 PodTemplate 类型的对象
HTTP 请求
GET /api/v1/namespaces/{namespace}/podtemplates
参数
- namespace (路径参数):string,必需 
- allowWatchBookmarks (查询参数):boolean 
- continue (查询参数):string 
- fieldSelector (查询参数):string 
- labelSelector (查询参数):string 
- limit (查询参数):integer 
- pretty (查询参数):string 
- resourceVersion (查询参数):string 
- resourceVersion (查询参数):string 
- sendInitialEvents (查询参数): boolean 
- timeoutSeconds (查询参数):integer 
- watch (查询参数):boolean 
响应
200 (PodTemplateList): OK
401: Unauthorized
list 列出或监视 PodTemplate 类型的对象
HTTP 请求
GET /api/v1/podtemplates
参数
- allowWatchBookmarks (查询参数):boolean 
- continue (查询参数):string 
- fieldSelector (查询参数):string 
- labelSelector (查询参数):string 
- limit (查询参数):integer 
- pretty (查询参数):string 
- resourceVersion (查询参数):string 
- resourceVersionMatch (查询参数):string 
- sendInitialEvents (查询参数): boolean 
- timeoutSeconds (查询参数):integer 
- watch (查询参数):boolean 
响应
200 (PodTemplateList): OK
401: Unauthorized
create 创建一个 PodTemplate
HTTP 请求
POST /api/v1/namespaces/{namespace}/podtemplates
参数
- namespace (路径参数):string,必需 
- body: PodTemplate,必需
- dryRun (查询参数):string 
- fieldManager (查询参数):string 
- fieldValidation (查询参数):string 
- pretty (查询参数):string 
响应
200 (PodTemplate): OK
201 (PodTemplate): Created
202 (PodTemplate): Accepted
401: Unauthorized
update 替换指定的 PodTemplate
HTTP 请求
PUT /api/v1/namespaces/{namespace}/podtemplates/{name}
参数
- name (路径参数):string,必需 - PodTemplate 的名称。 
- namespace (路径参数):string,必需 
- body: PodTemplate,必需
- dryRun (查询参数):string 
- fieldManager (查询参数):string 
- fieldValidation (查询参数):string 
- pretty (查询参数):string 
响应
200 (PodTemplate): OK
201 (PodTemplate): Created
401: Unauthorized
patch 部分更新指定的 PodTemplate
HTTP 请求
PATCH /api/v1/namespaces/{namespace}/podtemplates/{name}
参数
- name (路径参数):string,必需 - PodTemplate 的名称。 
- namespace (路径参数):string,必需 
- body: Patch,必需
- dryRun (查询参数):string 
- fieldManager (查询参数):string 
- fieldValidation (查询参数):string 
- force (查询参数):boolean 
- pretty (查询参数):string 
响应
200 (PodTemplate): OK
201 (PodTemplate): Created
401: Unauthorized
delete 删除一个 PodTemplate
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/podtemplates/{name}
参数
- name (路径参数):string,必需 - PodTemplate 的名称。 
- namespace (路径参数):string,必需 
- body: DeleteOptions 
- dryRun (查询参数):string 
- gracePeriodSeconds (查询参数):integer 
- ignoreStoreReadErrorWithClusterBreakingPotential (查询参数): boolean 
- pretty (查询参数):string 
- propagationPolicy (查询参数):string 
响应
200 (PodTemplate): OK
202 (PodTemplate): Accepted
401: Unauthorized
deletecollection 删除 PodTemplate 的集合
HTTP 请求
DELETE /api/v1/namespaces/{namespace}/podtemplates
参数
- 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