这是本节的多页打印视图。 点击此处打印.

返回本页常规视图.

工作负载资源

1 - ControllerRevision

ControllerRevision 实现了状态数据的不可变快照。

apiVersion: apps/v1

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

ControllerRevision

ControllerRevision 实现了状态数据的不可变快照。 客户端负责序列化和反序列化对象,包含对象内部状态。 成功创建 ControllerRevision 后,将无法对其进行更新。 API 服务器将无法成功验证所有尝试改变 data 字段的请求。 但是,可以删除 ControllerRevisions。 请注意,由于 DaemonSet 和 StatefulSet 控制器都使用它来进行更新和回滚,所以这个对象是 beta 版。 但是,它可能会在未来版本中更改名称和表示形式,客户不应依赖其稳定性。 它主要供控制器内部使用。


  • apiVersion: apps/v1
  • kind: ControllerRevision
  • revision (int64),必需

    revision 表示 data 表示的状态的修订。

  • data (RawExtension)

    data 是状态的序列化表示。

    RawExtension 用于以外部版本来保存扩展数据。

    要使用它,请生成一个字段,在外部、版本化结构中以 RawExtension 作为其类型,在内部结构中以 Object 作为其类型。

    内部包:

    type MyAPIObject struct {  
    	runtime.TypeMeta `json:",inline"`   
    	MyPlugin runtime.Object `json:"myPlugin"`  
    }       
    type PluginA struct {  
    	AOption string `json:"aOption"`  
    }
    

    外部包:

    type MyAPIObject struct {  
    	runtime.TypeMeta `json:",inline"`  
    	MyPlugin runtime.RawExtension `json:"myPlugin"`    
    }   
    type PluginA struct {  
    	AOption string `json:"aOption"`  
    }
    

    在网络上,JSON 看起来像这样:

    {  
    	"kind":"MyAPIObject",  
    	"apiVersion":"v1",  
    	"myPlugin": {  
    		"kind":"PluginA",  
    		"aOption":"foo",  
    	},  
    }
    

    那么会发生什么? 解码首先使用 json 或 yaml 将序列化数据解组到你的外部 MyAPIObject 中。 这会导致原始 JSON 被存储下来,但不会被解包。 下一步是复制(使用 pkg/conversion)到内部结构中。 runtime 包的 DefaultScheme 安装了转换函数,它将解析存储在 RawExtension 中的 JSON, 将其转换为正确的对象类型,并将其存储在 Object 中。 (TODO:如果对象是未知类型,将创建并存储一个 runtime.Unknown对象。)

ControllerRevisionList

ControllerRevisionList 是一个包含 ControllerRevision 对象列表的资源。


  • apiVersion: apps/v1
  • kind: ControllerRevisionList

操作


get 读取特定的 ControllerRevision

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

  • name路径参数):string,必需

    ControllerRevision 的名称

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

    namespace

  • pretty查询参数):string

    pretty

响应

200 (ControllerRevision): OK

401: Unauthorized

list 列出或监视 ControllerRevision 类别的对象

HTTP 请求

GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions

参数

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

    namespace

  • continue查询参数):string

    continue

  • limit (查询参数)): integer

    limit

  • pretty查询参数):string

    pretty

  • watch查询参数): boolean

    watch

响应

200 (ControllerRevisionList): OK

401: Unauthorized

list 列出或监视 ControllerRevision 类别的对象

HTTP 请求

GET /apis/apps/v1/controllerrevisions

参数

  • continue查询参数):string

    continue

  • limit查询参数): integer

    limit

  • pretty查询参数):string

    pretty

  • watch查询参数): boolean

    watch

响应

200 (ControllerRevisionList): OK

401: Unauthorized

create 创建一个 ControllerRevision

HTTP 请求

POST /apis/apps/v1/namespaces/{namespace}/controllerrevisions

参数

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

    namespace

  • dryRun查询参数):string

    dryRun

  • pretty查询参数):string

    pretty

响应

200 (ControllerRevision): OK

201 (ControllerRevision): Created

202 (ControllerRevision): Accepted

401: Unauthorized

update 替换特定的 ControllerRevision

HTTP 参数

PUT /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

  • name路径参数):string,必需

    ControllerRevision 的名称

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

    namespace

  • dryRun查询参数):string

    dryRun

  • pretty查询参数):string

    pretty

响应

200 (ControllerRevision): OK

201 (ControllerRevision): Created

401: Unauthorized

patch 部分更新特定的 ControllerRevision

HTTP 请求

PATCH /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

  • name路径参数):string,必需

    ControllerRevision 的名称

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

    namespace

  • dryRun查询参数):string

    dryRun

  • force查询参数): boolean

    force

  • pretty查询参数):string

    pretty

响应

200 (ControllerRevision): OK

201 (ControllerRevision): Created

401: Unauthorized

delete 删除一个 ControllerRevision

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}

参数

  • name路径参数):string,必需

    ControllerRevision 的名称

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

    namespace

  • dryRun查询参数):string

    dryRun

  • pretty查询参数):string

    pretty

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 ControllerRevision 集合

HTTP 请求

DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions

参数

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

    namespace

  • continue查询参数):string

    continue

  • dryRun查询参数):string

    dryRun

  • limit查询参数): integer

    limit

  • pretty查询参数):string

    pretty

响应

200 (Status): OK

401: Unauthorized

2 - HorizontalPodAutoscaler

水平 Pod 自动缩放器的配置。

<-- api_metadata: apiVersion: "autoscaling/v1" import: "k8s.io/api/autoscaling/v1" kind: "HorizontalPodAutoscaler" content_type: "api_reference" description: "configuration of a horizontal pod autoscaler." title: "HorizontalPodAutoscaler" weight: 11 auto_generated: true -->

apiVersion: autoscaling/v1

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

HorizontalPodAutoscaler

水平 Pod 自动缩放器的配置。


  • apiVersion: autoscaling/v1

  • kind: HorizontalPodAutoscaler

HorizontalPodAutoscalerSpec

水平 Pod 自动缩放器的规约。


  • maxReplicas (int32),必填

    自动扩缩器可以设置的 Pod 数量上限; 不能小于 minReplicas。

  • minReplicas (int32)

    minReplicas 是自动缩放器可以缩减的副本数的下限。 它默认为 1 个 Pod。 如果启用了 alpha 特性门禁 HPAScaleToZero 并且配置了至少一个 Object 或 External 度量标准, 则 minReplicas 允许为 0。 只要至少有一个度量值可用,缩放就处于活动状态。

  • targetCPUUtilizationPercentage (int32)

    所有 Pod 的目标平均 CPU 利用率(以请求 CPU 的百分比表示); 如果未指定,将使用默认的自动缩放策略。

HorizontalPodAutoscalerStatus

水平 Pod 自动缩放器的当前状态


  • currentReplicas (int32),必填

    此自动缩放器管理的 Pod 的当前副本数。

  • desiredReplicas (int32),必填

    此自动缩放器管理的 Pod 副本的所需数量。

  • currentCPUUtilizationPercentage (int32)

    当前所有 Pod 的平均 CPU 利用率, 以请求 CPU 的百分比表示, 例如:70 表示平均 Pod 现在正在使用其请求 CPU 的 70%。

  • lastScaleTime (Time)

    上次 HorizontalPodAutoscaler 缩放 Pod 的数量; 自动缩放器用它来控制 Pod 数量的更改频率。

    Time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。

  • observedGeneration (int64)

    此自动缩放器观察到的最新一代。

HorizontalPodAutoscalerList

水平 Pod 自动缩放器对象列表。


  • apiVersion: autoscaling/v1

  • kind: HorizontalPodAutoscalerList

  • metadata (ListMeta)

    标准的列表元数据。

操作


get 读取特定的 HorizontalPodAutoscaler

HTTP 请求

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

  • name路径参数): string,必填

    HorizontalPodAutoscaler 的名称。

  • namespace路径参数): string,必填

    namespace

  • pretty查询参数): string

    pretty

响应

200 (HorizontalPodAutoscaler): OK

401: Unauthorized

get 读取特定 HorizontalPodAutoscaler 的状态

HTTP 请求

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

  • name路径参数): string,必填

    HorizontalPodAutoscaler 的名称。

  • namespace路径参数): string,必填

    namespace

  • pretty查询参数): string

    pretty

响应

200 (HorizontalPodAutoscaler): OK

401: Unauthorized

list 列出或监视 HorizontalPodAutoscaler 类别的对象

HTTP 参数

GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

参数

  • namespace路径参数): string,必填

    namespace

  • continue查询参数): string

    continue

  • limit查询参数): integer

    limit

  • pretty查询参数): string

    pretty

  • watch查询参数): boolean

    watch

响应

200 (HorizontalPodAutoscalerList): OK

401: Unauthorized

list 列出或监视 HorizontalPodAutoscaler 类别的对象

HTTP 请求

GET /apis/autoscaling/v1/horizontalpodautoscalers

参数

  • continue (查询参数*): string

    continue

  • limit查询参数): integer

    limit

  • pretty查询参数): string

    pretty

  • watch查询参数): boolean

    watch

响应

200 (HorizontalPodAutoscalerList): OK

401: Unauthorized

create 创建一个 HorizontalPodAutoscaler

HTTP 请求

POST /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

参数

  • namespace路径参数): string,必填

    namespace

  • dryRun查询参数): string

    dryRun

  • pretty查询参数): string

    pretty

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

202 (HorizontalPodAutoscaler): Accepted

401: Unauthorized

update 替换特定的 HorizontalPodAutoscaler

HTTP 请求

PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

  • name路径参数): string,必填

    HorizontalPodAutoscaler 的名称

  • namespace路径参数): string,必填

    namespace

  • dryRun查询参数): string

    dryRun

  • pretty查询参数): string

    pretty

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

update 替换特定 HorizontalPodAutoscaler 的状态

HTTP 请求

PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

  • name路径参数): string,必填

    HorizontalPodAutoscaler 的名称

  • namespace路径参数): string,必填

    namespace

  • dryRun查询参数): string

    dryRun

  • pretty查询参数): string

    pretty

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

patch 部分更新特定的 HorizontalPodAutoscaler

HTTP 请求

PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

  • name路径参数): string,必填

    HorizontalPodAutoscaler 的名称

  • namespace路径参数): string,必填

    namespace

  • dryRun查询参数): string

    dryRun

  • force查询参数): boolean

    force

  • pretty查询参数): string

    pretty

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

patch 部分更新特定 HorizontalPodAutoscaler 的状态

HTTP 请求

PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status

参数

  • name路径参数): string,必填

    HorizontalPodAutoscaler 的名称

  • namespace路径参数): string,必填

    namespace

  • dryRun查询参数): string

    dryRun

  • force查询参数): boolean

    force

  • pretty查询参数): string

    pretty

响应

200 (HorizontalPodAutoscaler): OK

201 (HorizontalPodAutoscaler): Created

401: Unauthorized

delete 删除一个 HorizontalPodAutoscaler

HTTP 请求

DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}

参数

  • name路径参数): string,必填

    HorizontalPodAutoscaler 的名称

  • namespace路径参数): string,必填

    namespace

  • dryRun查询参数): string

    dryRun

  • pretty查询参数): string

    pretty

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 HorizontalPodAutoscaler 的集合

HTTP 请求

DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers

参数

  • namespace路径参数): string,必填

    namespace

  • continue查询参数): string

    continue

  • dryRun查询参数): string

    dryRun

  • limit查询参数): integer

    limit

  • pretty查询参数): string

    pretty

响应

200 (Status): OK

401: Unauthorized

3 - PriorityClass

PriorityClass 定义了从优先级类名到优先级数值的映射。

apiVersion: scheduling.k8s.io/v1

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

PriorityClass

PriorityClass 定义了从优先级类名到优先级数值的映射。 该值可以是任何有效的整数。


  • apiVersion: scheduling.k8s.io/v1
  • kind: PriorityClass
  • value (int32),必需

    此优先级的值。这是 Pod 在其 Pod 规约中有此类名称时收到的实际优先级。

  • description (string)

    description 是一个任意字符串,通常提供有关何时应使用此优先级的指南。

  • globalDefault (boolean)

    globalDefault 指定是否应将此 PriorityClass 视为没有任何优先级类的 pod 的默认优先级。 只有一个 PriorityClass 可以标记为 globalDefault。 但是,如果存在多个 PriorityClasses 且其 globalDefault 字段设置为 true, 则将使用此类全局默认 PriorityClasses 的最小值作为默认优先级。

  • preemptionPolicy (string)

    PreemptionPolicy 是抢占优先级较低的 Pod 的策略。 可选值:Never、PreemptLowerPriority。 如果未设置,则默认为 PreemptLowerPriority。

PriorityClassList

PriorityClassList 是优先级类的集合。


  • apiVersion: scheduling.k8s.io/v1
  • kind: PriorityClassList
  • items ([]PriorityClass),必需

    items 是 PriorityClasses 的列表

操作


get 读取特定的 PriorityClass

HTTP 请求

GET /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

  • name路径参数): string,必需

    PriorityClass 名称

  • pretty查询参数):string

    pretty

响应

200 (PriorityClass): OK

401: Unauthorized

list 列出或观察 PriorityClass类的对象

HTTP 请求

GET /apis/scheduling.k8s.io/v1/priorityclasses

参数

  • continue查询参数):string

    continue

  • limit查询参数):integer

    limit

  • pretty查询参数):string

    pretty

  • watch查询参数):boolean

    watch

响应

200 (PriorityClassList): OK

401: Unauthorized

create 创建一个 PriorityClass

HTTP 请求

POST /apis/scheduling.k8s.io/v1/priorityclasses

参数

  • dryRun查询参数):string

    dryRun

  • pretty查询参数):string

    pretty

响应

200 (PriorityClass): OK

201 (PriorityClass): Created

202 (PriorityClass): Accepted

401: Unauthorized

update 替换指定的 PriorityClass

HTTP 请求

PUT /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

  • name路径参数): string,必需

    PriorityClass 名称

  • dryRun查询参数):string

    dryRun

  • pretty查询参数):string

    pretty

响应

200 (PriorityClass): OK

201 (PriorityClass): Created

401: Unauthorized

patch 部分更新特定的 PriorityClass

HTTP 请求

PATCH /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

  • name路径参数): string,必须

    PriorityClass 名称

  • dryRun查询参数):string

    dryRun

  • force查询参数):boolean

    force

  • pretty查询参数):string

    pretty

响应

200 (PriorityClass): OK

201 (PriorityClass): Created

401: Unauthorized

delete 删除一个 PriorityClass

HTTP 请求

DELETE /apis/scheduling.k8s.io/v1/priorityclasses/{name}

参数

  • name路径参数): string,必需

    PriorityClass 名称。

  • dryRun查询参数):string

    dryRun

  • pretty查询参数):string

    pretty

响应

200 (Status): OK

202 (Status): Accepted

401: Unauthorized

deletecollection 删除 PriorityClass 集合

HTTP 请求

DELETE /apis/scheduling.k8s.io/v1/priorityclasses

参数

  • continue查询参数):string

    continue

  • dryRun查询参数):string

    dryRun

  • limit查询参数):integer

    limit

  • pretty查询参数):string

    pretty

响应

200 (Status): OK

401: Unauthorized