Kubernetes API 是通过 RESTful 接口提供 Kubernetes 功能服务并负责集群状态存储的应用程序。
Kubernetes 资源和"意向记录"都是作为 API 对象储存的,并可以通过调用 RESTful 风格的 API 进行修改。
API 允许以声明方式管理配置。
用户可以直接和 Kubernetes API 交互,也可以通过 kubectl
这样的工具进行交互。
核心的 Kubernetes API 是很灵活的,可以扩展以支持定制资源。
Kubernetes API 是通过 RESTful 接口提供 Kubernetes 功能服务并负责集群状态存储的应用程序。
Kubernetes 资源和"意向记录"都是作为 API 对象储存的,并可以通过调用 RESTful 风格的 API 进行修改。
API 允许以声明方式管理配置。
用户可以直接和 Kubernetes API 交互,也可以通过 kubectl
这样的工具进行交互。
核心的 Kubernetes API 是很灵活的,可以扩展以支持定制资源。
apiVersion: apps/v1
import "k8s.io/api/apps/v1"
ControllerRevision 实现了状态数据的不可变快照。 客户端负责序列化和反序列化对象,包含对象内部状态。 成功创建 ControllerRevision 后,将无法对其进行更新。 API 服务器将无法成功验证所有尝试改变 data 字段的请求。 但是,可以删除 ControllerRevisions。 请注意,由于 DaemonSet 和 StatefulSet 控制器都使用它来进行更新和回滚,所以这个对象是 beta 版。 但是,它可能会在未来版本中更改名称和表示形式,客户不应依赖其稳定性。 它主要供控制器内部使用。
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
revision (int64),必需
revision 表示 data 表示的状态的修订。
data (RawExtension)
data 是状态的序列化表示。
要使用它,请生成一个字段,在外部、版本化结构中以 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 是一个包含 ControllerRevision 对象列表的资源。
metadata (ListMeta)
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]ControllerRevision),必需
items 是 ControllerRevisions 的列表
get
读取特定的 ControllerRevisionGET /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
name (路径参数):string,必需
ControllerRevision 的名称
namespace (路径参数):string,必需
pretty (查询参数):string
200 (ControllerRevision): OK
401: Unauthorized
list
列出或监视 ControllerRevision 类别的对象GET /apis/apps/v1/namespaces/{namespace}/controllerrevisions
namespace (路径参数):string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数)): integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ControllerRevisionList): OK
401: Unauthorized
list
列出或监视 ControllerRevision 类别的对象GET /apis/apps/v1/controllerrevisions
allowWatchBookmarks (查询参数): boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数): integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ControllerRevisionList): OK
401: Unauthorized
create
创建一个 ControllerRevisionPOST /apis/apps/v1/namespaces/{namespace}/controllerrevisions
namespace (路径参数):string,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (ControllerRevision): OK
201 (ControllerRevision): Created
202 (ControllerRevision): Accepted
401: Unauthorized
update
替换特定的 ControllerRevisionPUT /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
name (路径参数):string,必需
ControllerRevision 的名称
namespace (路径参数):string,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (ControllerRevision): OK
201 (ControllerRevision): Created
401: Unauthorized
patch
部分更新特定的 ControllerRevisionPATCH /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
name (路径参数):string,必需
ControllerRevision 的名称
namespace (路径参数):string,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数): boolean
pretty (查询参数):string
200 (ControllerRevision): OK
201 (ControllerRevision): Created
401: Unauthorized
delete
删除一个 ControllerRevisionDELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions/{name}
name (路径参数):string,必需
ControllerRevision 的名称
namespace (路径参数):string,必需
dryRun (查询参数):string
gracePeriodSeconds (查询参数): integer
pretty (查询参数):string
propagationPolicy (查询参数):string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 ControllerRevision 集合DELETE /apis/apps/v1/namespaces/{namespace}/controllerrevisions
namespace (路径参数):string,必需
continue (查询参数):string
dryRun (查询参数):string
fieldSelector (查询参数):string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数):string
limit (查询参数): integer
pretty (查询参数):string
propagationPolicy (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
<-- 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"
水平 Pod 自动缩放器的配置。
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata (ObjectMeta)
标准的对象元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (HorizontalPodAutoscalerSpec)
自动缩放器的规约。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status.
status (HorizontalPodAutoscalerStatus)
自动缩放器的当前信息。
水平 Pod 自动缩放器的规约。
maxReplicas (int32),必填
自动扩缩器可以设置的 Pod 数量上限; 不能小于 minReplicas。
scaleTargetRef (CrossVersionObjectReference),必填
对被扩缩资源的引用; 水平 Pod 自动缩放器将了解当前的资源消耗,并使用其 scale 子资源设置所需的 Pod 数量。
CrossVersionObjectReference 包含足够的信息来让你识别出所引用的资源。
scaleTargetRef.kind (string),必填
被引用对象的类别; 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds"
scaleTargetRef.name (string),必填
被引用对象的名称; 更多信息: http://kubernetes.io/docs/user-guide/identifiers#names
scaleTargetRef.apiVersion (string)
被引用对象的 API 版本。
minReplicas (int32)
minReplicas 是自动缩放器可以缩减的副本数的下限。 它默认为 1 个 Pod。 如果启用了 alpha 特性门禁 HPAScaleToZero 并且配置了至少一个 Object 或 External 度量标准, 则 minReplicas 允许为 0。 只要至少有一个度量值可用,缩放就处于活动状态。
targetCPUUtilizationPercentage (int32)
所有 Pod 的目标平均 CPU 利用率(以请求 CPU 的百分比表示); 如果未指定,将使用默认的自动缩放策略。
水平 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)
此自动缩放器观察到的最新一代。
水平 Pod 自动缩放器对象列表。
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscalerList
metadata (ListMeta)
标准的列表元数据。
items ([]HorizontalPodAutoscaler), required
水平 Pod 自动缩放器对象的列表。
get
读取特定的 HorizontalPodAutoscalerGET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
name (路径参数): string,必填
HorizontalPodAutoscaler 的名称。
namespace (路径参数): string,必填
pretty (查询参数): string
200 (HorizontalPodAutoscaler): OK
401: Unauthorized
get
读取特定 HorizontalPodAutoscaler 的状态GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
name (路径参数): string,必填
HorizontalPodAutoscaler 的名称。
namespace (路径参数): string,必填
pretty (查询参数): string
200 (HorizontalPodAutoscaler): OK
401: Unauthorized
list
列出或监视 HorizontalPodAutoscaler 类别的对象GET /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
namespace (路径参数): string,必填
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数*): integer
watch (查询参数): boolean
200 (HorizontalPodAutoscalerList): OK
401: Unauthorized
list
列出或监视 HorizontalPodAutoscaler 类别的对象GET /apis/autoscaling/v1/horizontalpodautoscalers
allowWatchBookmarks (查询参数): boolean
continue (查询参数*): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (HorizontalPodAutoscalerList): OK
401: Unauthorized
create
创建一个 HorizontalPodAutoscalerPOST /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
namespace (路径参数): string,必填
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
202 (HorizontalPodAutoscaler): Accepted
401: Unauthorized
update
替换特定的 HorizontalPodAutoscalerPUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
name (路径参数): string,必填
HorizontalPodAutoscaler 的名称
namespace (路径参数): string,必填
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
401: Unauthorized
update
替换特定 HorizontalPodAutoscaler 的状态PUT /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
name (路径参数): string,必填
HorizontalPodAutoscaler 的名称
namespace (路径参数): string,必填
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
401: Unauthorized
patch
部分更新特定的 HorizontalPodAutoscalerPATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
name (路径参数): string,必填
HorizontalPodAutoscaler 的名称
namespace (路径参数): string,必填
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
401: Unauthorized
patch
部分更新特定 HorizontalPodAutoscaler 的状态PATCH /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}/status
name (路径参数): string,必填
HorizontalPodAutoscaler 的名称
namespace (路径参数): string,必填
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (HorizontalPodAutoscaler): OK
201 (HorizontalPodAutoscaler): Created
401: Unauthorized
delete
删除一个 HorizontalPodAutoscalerDELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers/{name}
name (路径参数): string,必填
HorizontalPodAutoscaler 的名称
namespace (路径参数): string,必填
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 HorizontalPodAutoscaler 的集合DELETE /apis/autoscaling/v1/namespaces/{namespace}/horizontalpodautoscalers
namespace (路径参数): string,必填
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: scheduling.k8s.io/v1
import "k8s.io/api/scheduling/v1"
PriorityClass 定义了从优先级类名到优先级数值的映射。 该值可以是任何有效的整数。
metadata (ObjectMeta)
标准对象的元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
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 是优先级类的集合。
metadata (ListMeta)
标准列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]PriorityClass),必需
items 是 PriorityClasses 的列表
get
读取特定的 PriorityClassGET /apis/scheduling.k8s.io/v1/priorityclasses/{name}
name (路径参数): string,必需
PriorityClass 名称
pretty (查询参数):string
200 (PriorityClass): OK
401: Unauthorized
list
列出或观察 PriorityClass类的对象GET /apis/scheduling.k8s.io/v1/priorityclasses
allowWatchBookmarks (查询参数):boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
watch (查询参数):boolean
200 (PriorityClassList): OK
401: Unauthorized
create
创建一个 PriorityClassPOST /apis/scheduling.k8s.io/v1/priorityclasses
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (PriorityClass): OK
201 (PriorityClass): Created
202 (PriorityClass): Accepted
401: Unauthorized
update
替换指定的 PriorityClassPUT /apis/scheduling.k8s.io/v1/priorityclasses/{name}
name (路径参数): string,必需
PriorityClass 名称
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (PriorityClass): OK
201 (PriorityClass): Created
401: Unauthorized
patch
部分更新特定的 PriorityClassPATCH /apis/scheduling.k8s.io/v1/priorityclasses/{name}
name (路径参数): string,必须
PriorityClass 名称
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty (查询参数):string
200 (PriorityClass): OK
201 (PriorityClass): Created
401: Unauthorized
delete
删除一个 PriorityClassDELETE /apis/scheduling.k8s.io/v1/priorityclasses/{name}
name (路径参数): string,必需
PriorityClass 名称。
dryRun (查询参数):string
gracePeriodSeconds (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 PriorityClass 集合DELETE /apis/scheduling.k8s.io/v1/priorityclasses
continue (查询参数):string
dryRun (查询参数):string
fieldSelector (查询参数):string
gracePeriodSeconds (查询参数):integer
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1”
Service 是软件服务(例如 mysql)的命名抽象,包含代理要侦听的本地端口(例如 3306)和一个选择算符, 选择算符用来确定哪些 Pod 将响应通过代理发送的请求。
apiVersion: v1
kind: Service
metadata (ObjectMeta)
标准的对象元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (ServiceSpec)
spec 定义 Service 的行为。https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status(ServiceStatus)
最近观察到的 Service 状态。由系统填充。只读。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
ServiceSpec 描述用户在服务上创建的属性。
selector (map[string]string)
将 Service 流量路由到具有与此 selector 匹配的标签键值对的 Pod。 如果为空或不存在,则假定该服务有一个外部进程管理其端点,Kubernetes 不会修改该端点。 仅适用于 ClusterIP、NodePort 和 LoadBalancer 类型。如果类型为 ExternalName,则忽略。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/
ports ([]ServicePort)
Patch strategy:基于键 type
合并
Map:合并时将保留 type 键的唯一值
此 Service 公开的端口列表。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
ServicePort 包含有关 ServicePort 的信息。
ports.port (int32),必需
Service 将公开的端口。
在 Service 所针对的 Pod 上要访问的端口号或名称。 编号必须在 1 到 65535 的范围内。名称必须是 IANA_SVC_NAME。 如果此值是一个字符串,将在目标 Pod 的容器端口中作为命名端口进行查找。 如果未指定字段,则使用 "port” 字段的值(直接映射)。 对于 clusterIP 为 None 的服务,此字段将被忽略, 应忽略不设或设置为 "port” 字段的取值。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#defining-a-service
IntOrString 是一种可以保存 int32 或字符串的类型。 在 JSON 或 YAML 编组和解组中使用时,它会生成或使用内部类型。 例如,这允许您拥有一个可以接受名称或数字的 JSON 字段。
ports.protocol (string)
此端口的 IP 协议。支持 “TCP”、“UDP” 和 “SCTP”。默认为 TCP。
ports.name (string)
Service 中此端口的名称。这必须是 DNS_LABEL。
ServiceSpec 中的所有端口的名称都必须唯一。
在考虑 Service 的端点时,这一字段值必须与 EndpointPort 中的 name
字段相同。
如果此服务上仅定义一个 ServicePort,则为此字段为可选。
ports.nodePort (int32)
当类型为 NodePort 或 LoadBalancer 时,Service 公开在节点上的端口, 通常由系统分配。如果指定了一个在范围内且未使用的值,则将使用该值,否则操作将失败。 如果在创建的 Service 需要该端口时未指定该字段,则会分配端口。 如果在创建不需要该端口的 Service时指定了该字段,则会创建失败。 当更新 Service 时,如果不再需要此字段(例如,将类型从 NodePort 更改为 ClusterIP),这个字段将被擦除。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
ports.appProtocol (string)
此端口的应用协议,遵循标准的 Kubernetes 标签语法,无前缀名称按照 IANA 标准服务名称 (参见 RFC-6335 和 https://www.iana.org/assignments/service-names)。 非标准协议应该使用前缀名称,如 mycompany.com/my-custom-protocol。
type (string)
type 确定 Service 的公开方式。默认为 ClusterIP。 有效选项为 ExternalName、ClusterIP、NodePort 和 LoadBalancer。 “ClusterIP” 为端点分配一个集群内部 IP 地址用于负载均衡。 Endpoints 由 selector 确定,如果未设置 selector,则需要通过手动构造 Endpoints 或 EndpointSlice 的对象来确定。 如果 clusterIP 为 “None”,则不分配虚拟 IP,并且 Endpoints 作为一组端点而不是虚拟 IP 发布。 “NodePort” 建立在 ClusterIP 之上,并在每个节点上分配一个端口,该端口路由到与 clusterIP 相同的 Endpoints。 “LoadBalancer” 基于 NodePort 构建并创建一个外部负载均衡器(如果当前云支持),该负载均衡器路由到与 clusterIP 相同的 Endpoints。 “externalName” 将此 Service 别名为指定的 externalName。其他几个字段不适用于 ExternalName Service。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types
ipFamilies ([]string)
原子: 将在合并期间被替换
iPFamilies 是分配给此服务的 IP 协议(例如 IPv4、IPv6)的列表。 该字段通常根据集群配置和 ipFamilyPolicy 字段自动设置。 如果手动指定该字段,且请求的协议在集群中可用,且 ipFamilyPolicy 允许,则使用;否则服务创建将失败。 该字段修改是有条件的:它允许添加或删除辅助 IP 协议,但不允许更改服务的主要 IP 协议。 有效值为 “IPv4” 和 “IPv6”。 该字段仅适用于 ClusterIP、NodePort 和 LoadBalancer 类型的服务,并且确实可用于“无头”服务。 更新服务设置类型为 ExternalName 时,该字段将被擦除。
该字段最多可以包含两个条目(双栈系列,按任意顺序)。 如果指定,这些协议栈必须对应于 clusterIPs 字段的值。 clusterIP 和 ipFamilies 都由 ipFamilyPolicy 字段管理。
ipFamilyPolicy (string)
iPFamilyPolicy 表示此服务请求或要求的双栈特性。 如果没有提供值,则此字段将被设置为 SingleStack。 服务可以是 “SingleStack”(单个 IP 协议)、 “PreferDualStack”(双栈配置集群上的两个 IP 协议或单栈集群上的单个 IP 协议) 或 “RequireDualStack”(双栈上的两个 IP 协议配置的集群,否则失败)。 ipFamilies 和 clusterIPs 字段取决于此字段的值。 更新服务设置类型为 ExternalName 时,此字段将被擦除。
clusterIP (string)
clusterIP 是服务的 IP 地址,通常是随机分配的。 如果地址是手动指定的,在范围内(根据系统配置),且没有被使用,它将被分配给服务,否则创建服务将失败。 clusterIP 一般不会被更改,除非 type 被更改为 ExternalName (ExternalName 需要 clusterIP 为空)或 type 已经是 ExternalName 时,可以更改 clusterIP(在这种情况下,可以选择指定此字段)。 可选值 “None”、空字符串 (“”) 或有效的 IP 地址。 clusterIP 为 “None” 时会生成“无头服务”(无虚拟 IP),这在首选直接 Endpoint 连接且不需要代理时很有用。 仅适用于 ClusterIP、NodePort、和 LoadBalancer 类型的服务。 如果在创建 ExternalName 类型的 Service 时指定了 clusterIP,则创建将失败。 更新 Service type 为 ExternalName 时,clusterIP 会被移除。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
clusterIPs ([]string)
原子: 将在合并期间被替换
clusterIPs 是分配给该 Service 的 IP 地址列表,通常是随机分配的。 如果地址是手动指定的,在范围内(根据系统配置),且没有被使用,它将被分配给 Service;否则创建 Service 失败。 clusterIP 一般不会被更改,除非 type 被更改为 ExternalName (ExternalName 需要 clusterIPs 为空)或 type 已经是 ExternalName 时,可以更改 clusterIPs(在这种情况下,可以选择指定此字段)。 可选值 “None”、空字符串 (“”) 或有效的 IP 地址。 clusterIPs 为 “None” 时会生成“无头服务”(无虚拟 IP),这在首选直接 Endpoint 连接且不需要代理时很有用。 适用于 ClusterIP、NodePort、和 LoadBalancer 类型的服务。 如果在创建 ExternalName 类型的 Service 时指定了 clusterIPs,则会创建失败。 更新 Service type 为 ExternalName 时,该字段将被移除。如果未指定此字段,则将从 clusterIP 字段初始化。 如果指定 clusterIPs,客户端必须确保 clusterIPs[0] 和 clusterIP 一致。
clusterIPs 最多可包含两个条目(双栈系列,按任意顺序)。 这些 IP 必须与 ipFamilies 的值相对应。 clusterIP 和 ipFamilies 都由 ipFamilyPolicy 管理。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
externalIPs ([]string)
externalIPs 是一个 IP 列表,集群中的节点会为此 Service 接收针对这些 IP 地址的流量。 这些 IP 不被 Kubernetes 管理。用户需要确保流量可以到达具有此 IP 的节点。 一个常见的例子是不属于 Kubernetes 系统的外部负载均衡器。
sessionAffinity (string)
支持 “ClientIP” 和 “None”。用于维护会话亲和性。 启用基于客户端 IP 的会话亲和性。必须是 ClientIP 或 None。默认为 None。 更多信息: https://kubernetes.io/docs/concepts/services-networking/service/#virtual-ips-and-service-proxies
loadBalancerIP (string)
仅适用于服务类型: LoadBalancer。此功能取决于底层云提供商是否支持负载均衡器。 如果云提供商不支持该功能,该字段将被忽略。 已弃用: 该字段信息不足,且其含义因实现而异,而且不支持双栈。 从 Kubernetes v1.24 开始,鼓励用户在可用时使用特定于实现的注释。在未来的 API 版本中可能会删除此字段。
loadBalancerSourceRanges ([]string)
如果设置了此字段并且被平台支持,将限制通过云厂商的负载均衡器的流量到指定的客户端 IP。 如果云提供商不支持该功能,该字段将被忽略。 更多信息: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/
loadBalancerClass (string)
loadBalancerClass 是此 Service 所属的负载均衡器实现的类。 如果设置了此字段,则字段值必须是标签风格的标识符,带有可选前缀,例如 ”internal-vip” 或 “example.com/internal-vip”。 无前缀名称是为最终用户保留的。该字段只能在 Service 类型为 “LoadBalancer” 时设置。 如果未设置此字段,则使用默认负载均衡器实现。默认负载均衡器现在通常通过云提供商集成完成,但应适用于任何默认实现。 如果设置了此字段,则假定负载均衡器实现正在监视具有对应负载均衡器类的 Service。 任何默认负载均衡器实现(例如云提供商)都应忽略设置此字段的 Service。 只有在创建或更新的 Service 的 type 为 “LoadBalancer” 时,才可设置此字段。 一经设定,不可更改。当 Service 的 type 更新为 “LoadBalancer” 之外的其他类型时,此字段将被移除。
externalName (string)
externalName 是发现机制将返回的外部引用,作为此服务的别名(例如 DNS CNAME 记录)。
不涉及代理。必须是小写的 RFC-1123 主机名 (https://tools.ietf.org/html/rfc1123),
并且要求 type
为 “ExternalName”。
externalTrafficPolicy (string)
externalTrafficPolicy 表示此 Service 是否希望将外部流量路由到节点本地或集群范围的 Endpoint。 字段值 “Local” 保留客户端 IP 并可避免 LoadBalancer 和 Nodeport 类型 Service 的第二跳,但存在潜在流量传播不平衡的风险。 字段值 “Cluster” 则会掩盖客户端源 IP,可能会导致第二次跳转到另一个节点,但整体流量负载分布较好。
internalTrafficPolicy (string)
internalTrafficPolicy 指定是将集群内部流量路由到所有端点还是仅路由到节点本地的端点。 字段值 “Cluster” 将 Service 的内部流量路由到所有端点。 字段值 ”Local” 意味着仅将流量路由到节点本地的端点;如果节点本地端点未准备好,则丢弃流量。 默认值为 “Cluster”。
healthCheckNodePort (int32)
healthCheckNodePort 指定 Service 的健康检查节点端口。 仅适用于 type 为 LoadBalancer 且 externalTrafficPolicy 设置为 Local 的情况。 如果为此字段设定了一个值,该值在合法范围内且没有被使用,则使用所指定的值。 如果未设置此字段,则自动分配字段值。外部系统(例如负载平衡器)可以使用此端口来确定给定节点是否拥有此服务的端点。 在创建不需要 healthCheckNodePort 的 Service 时指定了此字段,则 Service 创建会失败。 要移除 healthCheckNodePort,需要更改 Service 的 type。
publishNotReadyAddresses (boolean)
publishNotReadyAddresses 表示任何处理此 Service 端点的代理都应忽略任何准备就绪/未准备就绪的指示。 设置此字段的主要场景是为 StatefulSet 的服务提供支持,使之能够为其 Pod 传播 SRV DNS 记录,以实现对等发现。 为 Service 生成 Endpoints 和 EndpointSlice 资源的 Kubernetes 控制器对字段的解读是, 即使 Pod 本身还没有准备好,所有端点都可被视为 “已就绪”。 对于代理而言,如果仅使用 Kubernetes 通过 Endpoints 或 EndpointSlice 资源所生成的端点, 则可以安全地假设这种行为。
sessionAffinityConfig (SessionAffinityConfig)
sessionAffinityConfig 包含会话亲和性的配置。
SessionAffinityConfig 表示会话亲和性的配置。
allocateLoadBalancerNodePorts (boolean)
allocateLoadBalancerNodePorts 定义了是否会自动为 LoadBalancer 类型的 Service 分配 NodePort。默认为 true。 如果集群负载均衡器不依赖 NodePort,则可以设置此字段为 false。 如果调用者(通过指定一个值)请求特定的 NodePort,则无论此字段如何,都会接受这些请求。 该字段只能设置在 type 为 LoadBalancer 的 Service 上,如果 type 更改为任何其他类型,该字段将被移除。
ServiceStatus 表示 Service 的当前状态。
conditions ([]Condition)
Patch strategy: 在 type
上合并
Map: 键类型的唯一值将在合并期间保留
服务的当前状态。
condition 包含此 API 资源某一方面当前的状态详细信息。
conditions.lastTransitionTime(时间),必需
lastTransitionTime 是状况最近一次状态转化的时间。 变化应该发生在下层状况发生变化的时候。如果不知道下层状况发生变化的时间, 那么使用 API 字段更改的时间是可以接受的。
time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。
conditions.message (string),必需
message 是人类可读的消息,有关转换的详细信息,可以是空字符串。
conditions.reason (string),必需
reason 包含一个程序标识符,指示 condition 最后一次转换的原因。 特定条件类型的生产者可以定义该字段的预期值和含义,以及这些值是否被视为有保证的 API。 该值应该是 CamelCase 字符串且不能为空。
conditions.status (string),必需
condition 的状态,True、False、Unknown 之一。
conditions.type (string),必需
CamelCase 或 foo.example.com/CamelCase 中的条件类型。
conditions.observedGeneration (int64)
observedGeneration 表示设置 condition 基于的 .metadata.generation 的过期次数。 例如,如果 .metadata.generation 当前为 12,但 .status.conditions[x].observedGeneration 为 9, 则 condition 相对于实例的当前状态已过期。
loadBalancer (LoadBalancerStatus)
loadBalancer 包含负载均衡器的当前状态(如果存在)。
LoadBalancerStatus 表示负载均衡器的状态。
loadBalancer.ingress ([]LoadBalancerIngress)
ingress 是一个包含负载均衡器 Ingress 点的列表。Service 的流量需要被发送到这些 Ingress 点。
LoadBalancerIngress 表示负载平衡器入口点的状态: 用于服务的流量是否被发送到入口点。
loadBalancer.ingress.hostname (string)
hostname 是为基于 DNS 的负载均衡器 Ingress 点(通常是 AWS 负载均衡器)设置的。
loadBalancer.ingress.ip (string)
ip 是为基于 IP 的负载均衡器 Ingress 点(通常是 GCE 或 OpenStack 负载均衡器)设置的。
loadBalancer.ingress.ports ([]PortStatus)
Atomic: 将在合并期间被替换
ports 是 Service 的端口列表。如果设置了此字段,Service 中定义的每个端口都应该在此列表中。
loadBalancer.ingress.ports.port (int32),必需
port 是所记录的服务端口状态的端口号。
loadBalancer.ingress.ports.protocol (string),必需
protocol 是所记录的服务端口状态的协议。支持的值为:“TCP”、”UDP”、“SCTP”。
loadBalancer.ingress.ports.error (string)
error 是记录 Service 端口的问题。 错误的格式应符合以下规则:
ServiceList 包含一个 Service 列表。
apiVersion: v1
kind: Service 列表
metadata (ListMeta)
标准列表元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items([]Service),必需
Service 列表
get
读取指定的 APIServiceGET /api/v1/namespaces/{namespace}/services/{name}
200(Service): OK
401: Unauthorized
get
读取指定 Service 的状态获取 /api/v1/namespaces/{namespace}/services/{name}/status
200(Service): OK
401: Unauthorized
list
列出或观察 Service 类型的对象获取 /api/v1/namespaces/{namespace}/services
namespace(路径参数):string,必需
allowWatchBookmarks(查询参数):boolean
continue(查询参数):string
fieldSelector(查询参数):string
labelSelector(查询参数):string
limit(查询参数):integer
pretty(查询参数):string
resourceVersion(查询参数):string
resourceVersionMatch(查询参数):string
timeoutSeconds(查询参数):integer
watch(查询参数):boolean
200(ServiceList): OK
401: Unauthorized
list
列出或观察 Service 类型的对象获取 /api/v1/服务
allowWatchBookmarks(查询参数):boolean
continue(查询参数):string
fieldSelector(查询参数):string
labelSelector(查询参数):string
limit(查询参数):integer
pretty(查询参数):string
resourceVersion(查询参数):string
resourceVersionMatch(查询参数):string
timeoutSeconds(查询参数):integer
watch(查询参数):boolean
200(ServiceList): OK
401: Unauthorized
create
创建一个 ServicePOST /api/v1/namespaces/{namespace}/services
namespace(路径参数):string,必需
body: Service,必需
dryRun(查询参数):string
fieldManager(查询参数):string
fieldValidation(查询参数):string
pretty(查询参数):string
200(Service): OK
201(Service): Created
202(Service): Accepted
401: Unauthorized
update
替换指定的 ServicePUT /api/v1/namespaces/{namespace}/services/{name}
name (路径参数):string,必需
Service 名称
namespace(路径参数):string,必需
body: Service,必需
dryRun(查询参数):string
fieldManager(查询参数):string
fieldValidation(查询参数):string
pretty(查询参数):string
200(Service): OK
201(Service): Created
401: Unauthorized
update
替换指定 Service 的状态PUT /api/v1/namespaces/{namespace}/services/{name}/status
name (路径参数):string,必需
Service 名称
namespace(路径参数):string,必需
body: Service,必需
dryRun(查询参数):string
fieldManager(查询参数):string
fieldValidation(查询参数):string
pretty(查询参数):string
200(Service): OK
201(Service): Created
401: Unauthorized
patch
部分更新指定的 ServicePATCH /api/v1/namespaces/{namespace}/services/{name}
name (路径参数):string,必需
Service 名称
namespace(路径参数):string,必需
body: Patch,必需
dryRun(查询参数):string
fieldManager(查询参数):string
fieldValidation(查询参数):string
force(查询参数):boolean
pretty(查询参数):string
200(Service): OK
201(Service): Created
401: Unauthorized
patch
部分更新指定 Service 的状态PATCH /api/v1/namespaces/{namespace}/services/{name}/status
name (路径参数):string,必需
Service 名称
namespace(路径参数):string,必需
body: Patch,必需
dryRun(查询参数):string
fieldManager(查询参数):string
fieldValidation(查询参数):string
force(查询参数):boolean
pretty(查询参数):string
200(Service): OK
201(Service): Created
401: Unauthorized
delete
删除 ServiceDELETE /api/v1/namespaces/{namespace}/services/{name}
name (路径参数):string,必需
Service 名称
namespace(路径参数):string,必需
正文: DeleteOptions
dryRun(查询参数):string
gracePeriodSeconds(查询参数):integer
pretty(查询参数):string
propagationPolicy(查询参数):string
200(Service): OK
202(Service): Accepted
401: Unauthorized
deletecollection
删除 Service 集合DELETE /api/v1/namespaces/{namespace}/services
namespace(路径参数):string,必需
body: DeleteOptions
continue(查询参数):string
dryRun(查询参数):string
fieldSelector(查询参数):string
gracePeriodSeconds(查询参数):integer
labelSelector(查询参数):string
limit(查询参数):integer
pretty(查询参数):string
propagationPolicy(查询参数):string
resourceVersion(查询参数):string
resourceVersionMatch(查询参数):string
timeoutSeconds(查询参数):integer
200(Status): OK
401: Unauthorized
apiVersion: discovery.k8s.io/v1
import "k8s.io/api/discovery/v1"
EndpointSlice 是实现某 Service 的端点的子集。一个 Service 可以有多个 EndpointSlice 对象与之对应, 必须将所有的 EndpointSlice 拼接起来才能形成一套完整的端点集合。Service 通过标签来选择 EndpointSlice。
apiVersion: discovery.k8s.io/v1
kind: EndpointSlice
metadata (ObjectMeta)
标准的对象元数据。
addressType (string), 必需
addressType 指定当前 EndpointSlice 携带的地址类型。一个 EndpointSlice 只能携带同一类型的地址。 EndpointSlice 对象创建完成后不可以再更改 addressType 字段。
目前支持的地址类型为:
endpoints ([]Endpoint), 必需
原子性:合并期间将被替换
endpoints 是当前 EndpointSlice 中一组唯一的端点。每个 EndpointSlice 最多可以包含 1000 个端点。
端点是实现某 Service 的一个逻辑“后端”。
endpoints.addresses ([]string), 必需
集合:不重复的值在合并期间会被保留
本端点的地址。此字段的内容会根据对应的 EndpointSlice addressType 字段的值进行解释。 消费者必须根据自身能力处理不同类型的地址。此字段必须至少包含 1 个地址,最多不超过 100 个地址。 假定这些地址都是可替换的,而且客户端也可能选择只用第一个元素。参阅: https://issue.k8s.io/106267
endpoints.conditions (EndpointConditions)
conditions 包含和本端点当前状态有关的信息。
EndpointConditions 是端点的当前状况。
endpoints.conditions.ready (boolean)
ready 说明此端点已经准备好根据相关的系统映射接收流量。nil 值表示状态未知。 在大多数情况下,消费者应将这种未知状态视为就绪(ready)。 考虑到兼容性,对于正在结束状态下的端点,永远不能将 ready 设置为“true”。
endpoints.conditions.serving (boolean)
serving 和 ready 非常相似。唯一的不同在于, 即便某端点的状态为 Terminating 也可以设置 serving。 对于处在终止过程中的就绪端点,此状况应被设置为 “true”。 如果设置为 nil,则消费者应该以 ready 值为准。 可以在 EndpointSliceTerminatingCondition 特性开关中启用此字段。
endpoints.conditions.terminating (boolean)
terminating 说明当前端点正在终止过程中。nil 值表示状态未知。 消费者应将这种未知状态视为端点并不处于终止过程中。 可以通过 EndpointSliceTerminatingCondition 特性门控启用此字段。
endpoints.deprecatedTopology (map[string]string)
deprecatedTopology 包含 v1beta1 API 的拓扑信息部分。目前已经弃用了此字段, 移除 v1beta1 API 时(不早于 Kubernetes v1.24)会一起移除此字段。 此字段目前仍然可以存储值,但是不能通过 v1 API 写入数据。 向此字段写入数据的任何尝试都会被忽略,并且不会通知用户。 移除此字段后,可以在 zone 和 nodeName 字段中查看拓扑信息。
endpoints.hints (EndpointHints)
hints 是关于应该如何使用某端点的提示信息。
EndpointHints 提供应该如何使用某端点的提示信息。
endpoints.hostname (string)
此端点的主机名称。端点的使用者可以通过此字段区分各个端点(例如,通过 DNS 域名)。 使用同一主机名称的多个端点应被视为可替换(例如,DNS 中的多个 A 记录)。 必须为小写字母,并且需要通过 DNS Label (RFC 1123) 验证。
endpoints.nodeName (string)
nodeName 是托管此端点的 Node 的名称,使用 nodeName 可以决定 Node 本地有哪些端点。 可以通过 EndpointSliceNodeName 特性门控启用此字段。
endpoints.targetRef (ObjectReference)
targetRef 是对代表此端点的 Kubernetes 对象的引用。
endpoints.zone (string)
zone 是此端点所在的可用区(Zone)的名称。
ports ([]EndpointPort)
原子性:合并期间会被替代
ports 列出了当前 EndpointSlice 中各个端点所暴露的网络端口。每个端口的名称不得重复。 当 ports 列表为空时,表示没有已经指定暴露哪些端口。如果端口值被定义为 nil,表示暴露“所有端口”。 每个 EndpointSlice 最多可以包含 100 个端口。
EndpointPort 是 EndpointSlice 使用的端口。
ports.port (int32)
端点的端口号。如果未指定,就不限制端口,且必须根据消费者的具体环境进行解释。
ports.protocol (string)
此端口的 IP 协议。必须为 UDP、TCP 或 SCTP。默认为 TCP。
ports.name (string)
此端口的名称。EndpointSlice 中所有端口的名称都不得重复。 如果 EndpointSlice 是基于 Kubernetes Service 创建的, 那么此端口的名称和 Service.ports[].name 字段的值一致。默认为空字符串。 名称必须是空字符串,或者必须通过 DNS_LABEL 验证:
ports.appProtocol (string)
此端口的应用层协议。此字段遵循标准的 Kubernetes Label 句法。 不带前缀的名称是 IANA 标准服务的保留名称(参见 RFC-6335 和 https://www.iana.org/assignments/service-names)。 非标准协议应该使用带前缀的名称,例如 mycompany.com/my-custom-protocol。
EndpointSliceList 是 EndpointSlice 的列表。
apiVersion: discovery.k8s.io/v1
kind: EndpointSliceList
metadata (ListMeta)
标准的列表元数据
items ([]EndpointSlice), 必需
EndpointSlice 列表
get
读取指定的 EndpointSliceGET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
name (路径参数): string, 必需
EndpointSlice 的名称
namespace (路径参数): string, 必需
pretty (查询参数): string
200 (EndpointSlice): OK
401: Unauthorized
list
列举或监测 EndpointSlice 类别的对象GET /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
namespace (路径参数): string, 必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (EndpointSliceList): OK
401: Unauthorized
list
列举或监测 EndpointSlice 类别的对象GET /apis/discovery.k8s.io/v1/endpointslices
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (EndpointSliceList): OK
401: Unauthorized
create
创建 EndpointSlicePOST /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
namespace (路径参数): string, 必需
body: EndpointSlice, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (EndpointSlice): OK
201 (EndpointSlice): Created
202 (EndpointSlice): Accepted
401: Unauthorized
update
替换指定的 EndpointSlicePUT /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
name (路径参数): string, 必需
EndpointSlice 的名称
namespace (路径参数): string, 必需
body: EndpointSlice,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string-
pretty (查询参数): string
200 (EndpointSlice): OK
201 (EndpointSlice): Created
401: Unauthorized
patch
部分更新指定的 EndpointSlicePATCH /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
name (路径参数): string, 必需
EndpointSlice 的名称
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (EndpointSlice): OK
201 (EndpointSlice): Created
401: Unauthorized
delete
删除 EndpointSliceDELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices/{name}
name (路径参数): string, 必需
EndpointSlice 的名称
namespace (路径参数): string, 必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 EndpointSlice 的集合DELETE /apis/discovery.k8s.io/v1/namespaces/{namespace}/endpointslices
namespace (路径参数): string, 必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: networking.k8s.io/v1
import "k8s.io/api/networking/v1"
IngressClass 代表 Ingress 的类,被 Ingress 的规约引用。
ingressclass.kubernetes.io/is-default-class
注解可以用来标明一个 IngressClass 应该被视为默认的 Ingress 类。
当某个 IngressClass 资源将此注解设置为 true 时,
没有指定类的新 Ingress 资源将被分配到此默认类。
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata (ObjectMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (IngressClassSpec)
spec 是 IngressClass 的期望状态。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
IngressClassSpec 提供有关 Ingress 类的信息。
controller (string)
controller 是指应该处理此类的控制器名称。 这允许由同一控制器控制不同“口味”。例如,对于同一个实现的控制器你可能有不同的参数。 此字段应该指定为长度不超过 250 个字符的域前缀路径,例如 “acme.io/ingress-controller”。 该字段是不可变的。
parameters (IngressClassParametersReference)
parameters 是指向控制器中包含额外配置的自定义资源的链接。 如果控制器不需要额外的属性,这是可选的。
IngressClassParametersReference 标识一个 API 对象。这可以用来指定一个集群或者命名空间范围的资源
parameters.kind (string),必需
kind 是被引用资源的类型。
parameters.name (string),必需
name 是被引用资源的名称。
parameters.apiGroup (string)
apiGroup 是被引用资源的组。 如果未指定 apiGroup,则被指定的 kind 必须在核心 API 组中。 对于任何其他第三方类型,apiGroup 是必需的。
parameters.namespace (string)
namespace 是被引用资源的命名空间。 当范围被设置为 “namespace” 时,此字段是必需的; 当范围被设置为 “Cluster” 时,此字段必须不设置。
parameters.scope (string)
scope 表示是否引用集群或者命名空间范围的资源。 这可以设置为“集群”(默认)或者“命名空间”。
IngressClassList 是 IngressClasses 的集合。
apiVersion: networking.k8s.io/v1
kind: IngressClassList
metadata (ListMeta)
标准的列表元数据。
items ([]IngressClass),必需
items 是 IngressClasses 的列表。
get
读取指定的 IngressClassGET /apis/networking.k8s.io/v1/ingressclasses/{name}
name (路径参数):string,必需
IngressClass 的名称
pretty (查询参数):string
200 (IngressClass): OK
401: Unauthorized
list
列出或监视 IngressClass 类型的对象GET /apis/networking.k8s.io/v1/ingressclasses
allowWatchBookmarks (查询参数):boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
watch (查询参数):boolean
200 (IngressClassList): OK
401: Unauthorized
create
创建一个 IngressClassPOST /apis/networking.k8s.io/v1/ingressclasses
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (IngressClass): OK
201 (IngressClass): Created
202 (IngressClass): Accepted
401: Unauthorized
update
替换指定的 IngressClassPUT /apis/networking.k8s.io/v1/ingressclasses/{name}
name (路径参数):string,必需
IngressClass 的名称
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (IngressClass): OK
201 (IngressClass): Created
401: Unauthorized
patch
部分更新指定的 IngressClassPATCH /apis/networking.k8s.io/v1/ingressclasses/{name}
name (路径参数):string,必需
IngressClass 的名称
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty (查询参数):string
200 (IngressClass): OK
201 (IngressClass): Created
401: Unauthorized
delete
删除一个 IngressClassDELETE /apis/networking.k8s.io/v1/ingressclasses/{name}
name (路径参数):string,必需
IngressClass 的名称
body: DeleteOptions
dryRun (查询参数):string
gracePeriodSeconds (查询字符串):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 IngressClass 的集合DELETE /apis/networking.k8s.io/v1/ingressclasses
continue (查询参数):string
dryRun (查询参数):string
fieldSelector (查询参数):string
gracePeriodSeconds (查询字符串):integer
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
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 是包含 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
读取指定的 ConfigMapGET /api/v1/namespaces/{namespace}/configmaps/{name}
name (路径参数): string,必需
ConfigMap 的名称
namespace (路径参数): string,必需
pretty (查询参数): string
200 (ConfigMap): OK
401: Unauthorized
list
列出或观测类别为 ConfigMap 的对象GET /api/v1/namespaces/{namespace}/configmaps
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ConfigMapList): OK
401: Unauthorized
list
列出或观测类别为 ConfigMap 的对象GET /api/v1/configmaps
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ConfigMapList): OK
401: Unauthorized
create
创建 ConfigMapPOST /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
替换指定的 ConfigMapPUT /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
部分更新指定的 ConfigMapPATCH /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
删除 ConfigMapDELETE /api/v1/namespaces/{namespace}/configmaps/{name}
name (路径参数): string,必需
ConfigMap 的名称
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 ConfigMap 的集合DELETE /api/v1/namespaces/{namespace}/configmaps
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
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)
如果 immutable 设为 true,则确保不会更新 Secret 中存储的数据(只能修改对象元数据)。 如果未设为 true,则可以随时修改此字段。 默认为 nil。
stringData (map[string]string)
stringData 允许指定字符串格式的非二进制秘密数据。 为了方便起见,它作为只写输入字段提供。 写入时将所有键和值合并到 data 字段,且覆盖任何现有的值。 从 API 读取时绝不会输出 stringData 字段。
type (string)
用于满足程序化方式处理秘密数据。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/configuration/secret/#secret-types
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 是 Secret 对象的列表。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/configuration/secret
get
读取指定的 SecretGET /api/v1/namespaces/{namespace}/secrets/{name}
name (路径参数): string,必需
Secret 的名称
namespace (路径参数): string,必需
pretty (查询参数): string
200 (Secret): OK
401: Unauthorized
list
列出或观测类别为 Secret 的对象GET /api/v1/namespaces/{namespace}/secrets
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (SecretList): OK
401: Unauthorized
list
列出或观测类别为 Secret 的对象GET /api/v1/secrets
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (SecretList): OK
401: Unauthorized
create
创建 SecretPOST /api/v1/namespaces/{namespace}/secrets
namespace (路径参数): string,必需
body: Secret,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Secret): OK
201 (Secret): Created
202 (Secret): Accepted
401: Unauthorized
update
替换指定的 SecretPUT /api/v1/namespaces/{namespace}/secrets/{name}
name (路径参数): string,必需
Secret 的名称
namespace (路径参数): string,必需
body: Secret,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Secret): OK
201 (Secret): Created
401: Unauthorized
patch
部分更新指定的 SecretPATCH /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): OK
201 (Secret): Created
401: Unauthorized
delete
删除 SecretDELETE /api/v1/namespaces/{namespace}/secrets/{name}
name (路径参数): string,必需
Secret 的名称
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 Secret 的集合DELETE /api/v1/namespaces/{namespace}/secrets
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
import "k8s.io/api/core/v1"
Volume 表示 Pod 中一个有名字的卷,可以由 Pod 中的任意容器进行访问。
name (string),必需
卷的名称。必须是 DNS_LABEL 且在 Pod 内是唯一的。更多信息: https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#names
persistentVolumeClaim (PersistentVolumeClaimVolumeSource)
persistentVolumeClaimVolumeSource 表示对同一名字空间中 PersistentVolumeClaim 的引用。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
PersistentVolumeClaimVolumeSource 引用同一名字空间中用户的 PVC。 此卷找到绑定的 PV 并为 Pod 挂载这个 PV 卷。 PersistentVolumeClaimVolumeSource 本质上是其他人(或系统)拥有的另一类卷的包装类。
claimName 是与使用此卷的 Pod 位于同一名字空间中的 PersistentVolumeClaim 的名称。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
persistentVolumeClaim.readOnly (boolean)
readOnly 将在卷挂载中强制设置 readOnly 属性。默认为 false。
configMap (ConfigMapVolumeSource)
configMap 表示应填充此卷的 configMap。
将 ConfigMap 适配到一个卷中。目标 ConfigMap 的 data 字段的内容将以文件的形式呈现在一个卷中, 使用 data 字段中的键名作为文件名,除非 items 元素中已经填充了由键名到路径的特定映射。 ConfigMap 卷支持所有权管理和 SELinux 重新打标签。
被引用资源的名称。更多信息: https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#names
configMap.optional (boolean)
optional 指定是否所引用的 ConfigMap 或其键必须已经被定义。
defaultMode 是可选的:默认情况下,模式位用于为已创建的文件设置权限。 必须是 0000 到 0777 之间的八进制值或 0 到 511 之间的十进制值。 YAML 既接受八进制值也接受十进制值,JSON 针对模式位需要十进制值。此字段默认为 0644。 路径内的目录不受此设置的影响。这可能与影响文件模式的其他选项(如 fsGroup)有冲突,且结果可以是其他模式位也被设置。
configMap.items ([]KeyToPath)
如果未指定 items,则所引用的 ConfigMap 的 data 字段中的每个键值对将作为一个文件被投射到卷中, 这个文件的名称是键名,而文件的内容是键的取值。 如果指定 items,则所列出的键将被投射到指定的路径中,且不会显示未列出的键。 如果指定的键不在 ConfigMap 中,则卷设置将出错,除非对应的键被标记为可选。 路径必须是相对路径,不能包含 “..” 路径,也不能以 “..” 开头。
secret (SecretVolumeSource)
secret 表示用来填充此卷的 Secret。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#secret
将 Secret 适配到一个卷中。 目标 Secret 的 data 字段的内容将以文件的形式呈现在一个卷中,使用 data 字段中的键名作为文件名。 Secret 卷支持所有权管理和 SELinux 重新打标签。
secretName 是要使用的、位于 Pod 的名字空间中的 Secret 名称。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#secret
secret.optional (boolean)
optional 字段指定是否 Secret 或其键必须已经定义。
defaultMode 是可选的:默认情况下,模式位用于为已创建的文件设置权限。 必须是 0000 到 0777 之间的八进制值或 0 到 511 之间的十进制值。 YAML 既接受八进制值也接受十进制值,JSON 针对模式位需要十进制值。此字段默认为 0644。 路径内的目录不受此设置的影响。 这可能与影响文件模式的其他选项(如 fsGroup)有冲突,且结果可以是其他模式位也被设置。
secret.items ([]KeyToPath)
如果未指定 items,则所引用的 Secret 的 data 字段中的每个键值对将作为一个文件被投射到卷中, 这个文件的名称是键名,而文件的内容是键的取值。 如果指定 items,则所列出的键将被投射到指定的路径中,且不会显示未列出的键。 如果指定的键不在 Secret 中,则卷设置将出错,除非对应的键被标记为可选。 路径必须是相对路径,不能包含 “..” 路径,也不能以 “..” 开头。
downwardAPI (DownwardAPIVolumeSource)
downwardAPI 表示有关 Pod 的 Downward API,用来填充此卷。
DownwardAPIVolumeSource 表示包含 Downward API 信息的一个卷。Downward API 卷支持所有权管理和 SELinux 重新打标签。
可选:默认情况下,模式位用于已创建的文件。 必须是可选的:默认情况下,模式位用于为已创建的文件设置权限。 必须是 0000 到 0777 之间的八进制值或 0 到 511 之间的十进制值。 YAML 既接受八进制值也接受十进制值,JSON 针对模式位需要十进制值。此字段默认为 0644。 路径内的目录不受此设置的影响。这可能与影响文件模式的其他选项(如 fsGroup)有冲突,且结果可以是其他模式位也被设置。
downwardAPI.items ([]DownwardAPIVolumeFile)
items 是 Downward API 卷文件的列表。
projected (ProjectedVolumeSource)
这是供 Secret、ConfigMap 和 Downward API 等所有资源使用的投射项。
projected.defaultMode (int32)
defaultMode 是默认情况下用于为已创建的文件设置权限的模式位。 必须是 0000 到 0777 之间的八进制值或 0 到 511 之间的十进制值。 YAML 既接受八进制值也接受十进制值,JSON 针对模式位需要十进制值。 路径内的目录不受此设置的影响。 这可能与影响文件模式的其他选项(如 fsGroup)有冲突,且结果可以是其他模式位也被设置。
projected.sources ([]VolumeProjection)
sources 是卷投射的列表。
projected.sources.configMap (ConfigMapProjection)
与要投射的 ConfigMap 数据有关的 ConfigMap 信息。
将 ConfigMap 适配到一个投射的卷中。 目标 ConfigMap 的 Data 字段的内容将以文件的形式呈现在一个被投射的卷中, 使用 data 字段中的键名作为文件名,除非 items 元素中已经填充了由键名到路径的特定映射。 请注意,这等同于没有默认模式的 ConfigMap 卷源。
- **projected.sources.configMap.name** (string)
被引用资源的名称。更多信息: https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#names
projected.sources.configMap.optional (boolean)
optional 指定是否所引用的 ConfigMap 或其键必须已经被定义。
- **projected.sources.configMap.items** ([]<a href="https://deploy-preview-35120--kubernetes-io-main-staging.netlify.app/zh-cn/docs/reference/kubernetes-api/config-and-storage-resources/volume/#KeyToPath">KeyToPath</a>)
如果未指定 items,则所引用的 ConfigMap 的 data 字段中的每个键值对将作为一个文件被投射到卷中, 这个文件的名称是键名,而文件的内容是键的取值。 如果指定 items,则所列出的键将被投射到指定的路径中,且不会显示未列出的键。 如果指定的键不在 ConfigMap 中,则卷设置将出错,除非对应的键被标记为可选。 路径必须是相对路径,不能包含 “..” 路径,也不能以 “..” 开头。
- **projected.sources.downwardAPI** (DownwardAPIProjection)
与要投射的 downward API 数据有关的 downward API 信息。
表示投射到投射卷的 Downward API 信息。请注意,这等同于没有默认模式的 downwardAPI 卷源。
projected.sources.downwardAPI.items ([]DownwardAPIVolumeFile)
items 是 DownwardAPIVolume 文件的列表。
- **projected.sources.secret** (SecretProjection)
与要投射的 Secret 数据有关的 Secret 信息。
将 Secret 适配到一个投射卷中。 目标 Secret 的 data 字段的内容将以文件的形式呈现在一个投射卷中,使用 data 字段中的键名作为文件名。 请注意,这等同于没有默认模式的 Secret 卷源。
projected.sources.secret.name (string)
被引用资源的名称。更多信息: https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#names
- **projected.sources.secret.optional** (boolean)
optional 字段指定是否 Secret 或其键必须已经定义。
projected.sources.secret.items ([]KeyToPath)
如果未指定 items,则所引用的 Secret 的 data 字段中的每个键值对将作为一个文件被投射到卷中, 这个文件的名称是键名,而文件的内容是键的取值。 如果指定 items,则所列出的键将被投射到指定的路径中,且不会显示未列出的键。 如果指定的键不在 Secret 中,则卷设置将出错,除非对应的键被标记为可选。 路径必须是相对路径,不能包含 “..” 路径,也不能以 “..” 开头。
- **projected.sources.serviceAccountToken** (ServiceAccountTokenProjection)
serviceAccountToken 是与要投射的服务账号令牌数据有关的信息。
ServiceAccountTokenProjection 表示一个投射的服务账号令牌卷。 这种投射可用于将服务账号令牌插入到 Pod 运行时文件系统,供访问 API(Kubernetes API Server 或其他)使用。
projected.sources.serviceAccountToken.path (string),必需
path 是相对于令牌投射目标文件的挂载点的路径。
- **projected.sources.serviceAccountToken.audience** (string)
audience 是令牌的目标受众。
令牌的接收方必须用令牌受众中指定的一个标识符来标识自己,否则应拒绝此令牌。
受众默认为 apiserver 的标识符。
projected.sources.serviceAccountToken.expirationSeconds (int64)
expirationSeconds 是所请求的服务账号令牌的有效期。 当令牌即将到期时,kubelet 卷插件将主动轮换服务账号令牌。 如果令牌超过其生存时间的 80% 或令牌超过 24 小时,kubelet 将开始尝试轮换令牌。 默认为 1 小时且必须至少为 10 分钟。
emptyDir (EmptyDirVolumeSource)
emptyDir 表示与 Pod 生命周期相同的临时目录。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#emptydir
表示供 Pod 使用的一个空目录。空目录卷支持所有权管理和 SELinux 重新打标签。
emptyDir.medium (string)
medium 表示此目录应使用哪种类别的存储介质。默认为 "",这意味着使用节点的默认介质。 必须是空字符串(默认值)或 Memory。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#emptydir
sizeLimit 是这个 EmptyDir 卷所需的本地存储总量。这个大小限制也适用于内存介质。 EmptyDir 的内存介质最大使用量将是此处指定的 sizeLimit 与 Pod 中所有容器内存限制总和这两个值之间的最小值。 默认为 nil,这意味着限制未被定义。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes/#emptydir
hostPath (HostPathVolumeSource)
hostPath 表示主机上预先存在的文件或目录,它们将被直接暴露给容器。 这种卷通常用于系统代理或允许查看主机的其他特权操作。大多数容器不需要这种卷。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#hostpath
表示映射到 Pod 中的主机路径。主机路径卷不支持所有权管理或 SELinux 重新打标签。
目录在主机上的路径。如果该路径是一个符号链接,则它将沿着链接指向真实路径。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#hostpath
hostPath.type (string)
HostPath 卷的类型。默认为 ""。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#hostpath
awsElasticBlockStore (AWSElasticBlockStoreVolumeSource)
awsElasticBlockStore 表示挂接到 kubelet 的主机随后暴露给 Pod 的一个 AWS Disk 资源。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
表示 AWS 上的 Persistent Disk 资源。挂载到一个容器之前 AWS EBS 磁盘必须存在。 该磁盘还必须与 kubelet 位于相同的 AWS 区域中。AWS EBS 磁盘只能以读/写一次进行挂载。 AWS EBS 卷支持所有权管理和 SELinux 重新打标签。
volumeID 是 AWS(Amazon EBS 卷)中持久磁盘资源的唯一 ID。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
awsElasticBlockStore.fsType (string)
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
partition 是你要挂载的卷中的分区。如果省略,则默认为按卷名称进行挂载。例如:对于卷 /dev/sda1, 将分区指定为 “1”。类似地,/dev/sda 的卷分区为 “0”(或可以将属性留空)。
awsElasticBlockStore.readOnly (boolean)
readOnly 值为 true 将使得卷挂载被强制设置为 readOnly。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
azureDisk (AzureDiskVolumeSource)
azureDisk 表示挂载到主机上并绑定挂载到 Pod 上的 Azure 数据盘。
azureDisk 表示挂载到主机上并绑定挂载到 Pod 上的 Azure 数据盘。
diskName 是 Blob 存储中数据盘的名称。
azureDisk.diskURI (string),必需
diskURI 是 Blob 存储中数据盘的 URI。
azureDisk.cachingMode (string)
cachingMode 是主机缓存(Host Caching)模式:None、Read Only、Read Write。
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
azureDisk.kind (string)
kind 预期值包括:
默认为 Shared。
azureDisk.readOnly (boolean)
readOnly 默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。
azureFile (AzureFileVolumeSource)
azureDisk 表示挂载到主机上并绑定挂载到 Pod 上的 Azure File Service。
azureFile 表示挂载到主机上并绑定挂载到 Pod 上的 Azure File Service。
secretName 是包含 Azure 存储账号名称和主键的 Secret 的名称。
azureFile.shareName (string),必需
shareName 是 Azure 共享名称。
azureFile.readOnly (boolean)
readOnly 默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。
cephfs (CephFSVolumeSource)
cephfs 表示在主机上挂载的 Ceph FS,该文件系统挂载与 Pod 的生命周期相同。
表示在 Pod 的生命周期内持续的 Ceph Filesystem 挂载。cephfs 卷不支持所有权管理或 SELinux 重新打标签。
cephfs.monitors ([]string),必需
monitors 是必需的。monitors 是 Ceph 监测的集合。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
path 是可选的。用作挂载的根,而不是挂载完整的 Ceph 树,默认为 “/”。
cephfs.readOnly (boolean)
readOnly 是可选的。默认为 false(读/写)。 此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
secretFile 是可选的。secretFile 是 User 对应的密钥环的路径,默认为 /etc/ceph/user.secret。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
cephfs.secretRef (LocalObjectReference)
secretRef 是可选的。secretRef 是针对用户的身份认证 Secret 的引用,默认为空。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
cephfs.user (string)
user 是可选的。user 是 rados 用户名,默认为 admin。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
cinder (CinderVolumeSource)
cinder 表示 kubelet 主机上挂接和挂载的 Cinder 卷。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
表示 Openstack 中的一个 Cinder 卷资源。挂载到一个容器之前 Cinder 卷必须已经存在。 该卷还必须与 kubelet 位于相同的地区中。cinder 卷支持所有权管理和 SELinux 重新打标签。
cinder.volumeID (string),必需
volumeID 用于标识 Cinder 中的卷。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。例如:“ext4”、“xfs”、“ntfs”。 如果未指定,则隐式推断为“ext4”。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
cinder.readOnly (boolean)
readOnly 默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。 更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
cinder.secretRef (LocalObjectReference)
secretRef 是可选的。指向 Secret 对象,内含的参数用于连接到 OpenStack。
csi (CSIVolumeSource)
csi 表示由某个外部容器存储接口(Container Storage Interface,CSI)驱动处理的临时存储(Beta 特性)。
csi.driver (string),必需
driver 是处理此卷的 CSI 驱动的名称。咨询你的管理员以获取在集群中注册的正确名称。
csi.fsType (string)
要挂载的 fsType。例如 “ext4”、“xfs”、“ntfs”。 如果未提供,则将空值传递给关联的 CSI 驱动,以便决定要应用的默认文件系统。
nodePublishSecretRef 是对包含敏感信息的 Secret 对象的引用, 该 Secret 对象将被传递到 CSI 驱动以完成 CSI NodePublishVolume 和 NodeUnpublishVolume 调用。 此字段是可选的,如果不需要 Secret,则此字段可以为空。 如果 Secret 对象包含多个 Secret,则所有 Secret 引用将被传递。
csi.readOnly (boolean)
readOnly 指定供卷使用的只读配置。默认为 false(读/写)。
csi.volumeAttributes (map[string]string)
volumeAttributes 存储传递给 CSI 驱动且特定于驱动的属性。查阅你的驱动文档,了解支持的值。
fc (FCVolumeSource)
fc 表示挂接到 kubelet 的主机随后暴露给 Pod 的一个 Fibre Channel 资源。
表示 Fibre Channel 卷。Fibre Channel 卷只能以读/写一次进行挂载。 Fibre Channel 卷支持所有权管理和 SELinux 重新打标签。
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
fc.lun (int32)
lun 是可选的:FC 目标 lun 编号。
readOnly 是可选的。默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。
fc.targetWWNs ([]string)
targetWWNs 是可选的。FC 目标全球名称(WWN)。
fc.wwids ([]string)
wwids 是可选的。FC 卷全球识别号(wwids)。 必须设置 wwids 或 targetWWNs 及 lun 的组合,但不能同时设置两者。
flexVolume (FlexVolumeSource)
flexVolume 表示使用基于 exec 的插件制备/挂接的通用卷资源。
flexVolume 表示使用基于 exec 的插件制备/挂接的通用卷资源。
flexVolume.driver (string),必需
driver 是供此卷使用的驱动的名称。
flexVolume.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。例如 “ext4”、“xfs”、“ntfs”。 默认的文件系统取决于 flexVolume 脚本。
options 是可选的。此字段包含额外的命令选项(如果有)。
flexVolume.readOnly (boolean)
readOnly 是可选的。默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。
flexVolume.secretRef (LocalObjectReference)
secretRef 是可选的。secretRef 是对包含敏感信息的 Secret 对象的引用,该 Secret 会被传递到插件脚本。 如果未指定 Secret 对象,则此字段可以为空。如果 Secret 对象包含多个 Secret,则所有 Secret 被传递到插件脚本。
flocker (FlockerVolumeSource)
flocker 表示挂接到一个 kubelet 主机的 Flocker 卷。Flocker 卷依赖于正在运行的 Flocker 控制服务。
表示 Flocker 代理挂载的 Flocker 卷。应设置一个且仅设置 datasetName 和 datasetUUID 中的一个。 Flocker 卷不支持所有权管理或 SELinux 重新打标签。
flocker.datasetName (string)
datasetName 是存储为元数据的数据集的名称。Flocker 数据集的名称应视为已弃用。
flocker.datasetUUID (string)
datasetUUID 是数据集的 UUID。这是 Flocker 数据集的唯一标识符。
gcePersistentDisk (GCEPersistentDiskVolumeSource)
gcePersistentDisk 表示挂接到 kubelet 的主机随后暴露给 Pod 的一个 GCE Disk 资源。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
表示 Google Compute Engine 中的 Persistent Disk 资源。 挂载到一个容器之前 GCE PD 必须已经存在。该磁盘还必须与 kubelet 位于相同的 GCE 项目和区域中。 GCE PD 只能挂载为读/写一次或只读多次。GCE PD 支持所有权管理和 SELinux 重新打标签。
pdName 是 GCE 中 PD 资源的唯一名称。用于标识 GCE 中的磁盘。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
gcePersistentDisk.fsType (string)
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为“ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
partition 是你要挂载的卷中的分区。如果省略,则默认为按卷名称进行挂载。 例如:对于卷 /dev/sda1,将分区指定为 “1”。类似地,/dev/sda 的卷分区为 “0”(或可以将属性留空)。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
gcePersistentDisk.readOnly (boolean)
此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。默认为 false。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
glusterfs (GlusterfsVolumeSource)
glusterfs 表示在与 Pod 共享生命周期的主机上挂载的 Glusterfs。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md
表示在 Pod 的生命周期内持续的 Glusterfs 挂载。glusterfs 卷不支持所有权管理或 SELinux 重新打标签。
endpoints 是详细说明 Glusterfs 拓扑的端点名称。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
glusterfs.path (string),必需
path 是 Glusterfs 卷路径。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
glusterfs.readOnly (boolean)
此处 readOnly 将强制使用只读权限挂载 Glusterfs 卷。默认为 false。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
iscsi (ISCSIVolumeSource)
iscsi 表示挂接到 kubelet 的主机随后暴露给 Pod 的一个 ISCSI Disk 资源。更多信息: https://examples.k8s.io/volumes/iscsi/README.md
表示一个 ISCSI 磁盘。ISCSI 卷只能以读/写一次进行挂载。ISCSI 卷支持所有权管理和 SELinux 重新打标签。
iqn 是目标 iSCSI 限定名称。
iscsi.lun (int32),必需
lun 表示 iSCSI 目标逻辑单元号。
iscsi.targetPortal (string),必需
targetPortal 是 iSCSI 目标门户。 如果不是默认端口(通常是 TCP 端口 860 和 3260),则 Portal 为 IP 或 ip_addr:port。
chapAuthDiscovery 定义是否支持 iSCSI Discovery CHAP 身份认证。
iscsi.chapAuthSession (boolean)
chapAuthSession 定义是否支持 iSCSI Session CHAP 身份认证。
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#iscsi
iscsi.initiatorName (string)
initiatorName 是自定义的 iSCSI 发起程序名称(iSCSI Initiator Name)。 如果同时用 iscsiInterface 指定 initiatorName,将为连接创建新的 iSCSI 接口 <目标门户>:<卷名称>。
iscsiInterface 是使用 iSCSI 传输的接口名称。默认为 “default”(tcp)。
iscsi.portals ([]string)
portals 是 iSCSI 目标门户列表(iSCSI Target Portal List)。 如果不是默认端口(通常是 TCP 端口 860 和 3260),则 Portal 为 IP 或 ip_addr:port。
此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。默认为 false。
iscsi.secretRef (LocalObjectReference)
secretRef 是 iSCSI 目标和发起程序身份认证所用的 CHAP Secret。
nfs (NFSVolumeSource)
nfs 表示在主机上挂载的 NFS,其生命周期与 Pod 相同。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
表示 Pod 的生命周期内一直存在的 NFS 挂载。NFS 卷不支持所有权管理或 SELinux 重新打标签。
nfs.path (string),必需
path 是由 NFS 服务器导出的路径。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
server 是 NFS 服务器的主机名或 IP 地址。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
nfs.readOnly (boolean)
此处 readOnly 将强制使用只读权限挂载 NFS 导出。默认为 false。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
photonPersistentDisk (PhotonPersistentDiskVolumeSource)
photonPersistentDisk 表示 kubelet 主机上挂接和挂载的 PhotonController 持久磁盘。
photonPersistentDisk.pdID (string),必需
pdID 是标识 Photon Controller 持久磁盘的 ID。
photonPersistentDisk.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
portworxVolume (PortworxVolumeSource)
portworxVolume 表示 kubelet 主机上挂接和挂载的 portworx 卷。
PortworxVolumeSource 表示 Portworx 卷资源。
portworxVolume.volumeID (string),必需
volumeID 唯一标识 Portworx 卷。
fSType 表示要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。例如 “ext4”、“xfs”。 如果未指定,则隐式推断为 “ext4”。
portworxVolume.readOnly (boolean)
readOnly 默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。
quobyte (QuobyteVolumeSource)
quobyte 表示在共享 Pod 生命周期的主机上挂载的 Quobyte。
表示在 Pod 的生命周期内持续的 Quobyte 挂载。Quobyte 卷不支持所有权管理或 SELinux 重新打标签。
registry 表示将一个或多个 Quobyte Registry 服务指定为 host:port 对的字符串形式 (多个条目用英文逗号分隔),用作卷的中央注册表。
quobyte.volume (string),必需
volume 是按名称引用已创建的 Quobyte 卷的字符串。
quobyte.group (string)
group 是将卷访问映射到的组。默认为无组。
此处 readOnly 将强制使用只读权限挂载 Quobyte 卷。默认为 false。
quobyte.tenant (string)
tenant 拥有 Backend Used 中给定的 Quobyte 卷,随动态制备的 Quobyte 卷一起使用,值由插件设置。
quobyte.user (string)
user 是将卷访问映射到的用户。默认为 serivceaccount 用户。
rbd (RBDVolumeSource)
rbd 表示在共享 Pod 生命周期的主机上挂载的 Rados Block Device。更多信息: https://examples.k8s.io/volumes/rbd/README.md
表示在 Pod 的生命周期内持续的 Rados Block Device 挂载。RBD 卷支持所有权管理和 SELinux 重新打标签。
rbd.image (string),必需
image 是 rados 镜像名称。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
monitors 是 Ceph 监测的集合。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.fsType (string)
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#rbd
keyring 是 RBDUser 密钥环的路径。默认为 /etc/ceph/keyring。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.pool (string)
pool 是 rados 池名称。默认为 rbd。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.readOnly (boolean)
此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。默认为 false。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
secretRef 是 RBDUser 的身份认证 Secret 的名称。如果提供,则重载 keyring。默认为 nil。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.user (string)
user 是 rados 用户名。默认为 admin。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
scaleIO (ScaleIOVolumeSource)
scaleIO 表示 Kubernetes 节点上挂接和挂载的 ScaleIO 持久卷。
ScaleIOVolumeSource 表示一个 ScaleIO 持久卷。
scaleIO.gateway (string),必需
gateway 是 ScaleIO API 网关的主机地址。
secretRef 引用到 ScaleIO 用户的 Secret 和其他敏感信息。如果未提供此项,则 Login 操作将失败。
scaleIO.system (string),必需
system 是存储系统的名称,与 ScaleIO 中的配置相同。
scaleIO.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。例如 “ext4”、“xfs”、“ntfs”。默认为 “xfs”。
protectionDomain 是 ScaleIO 保护域(ScaleIO Protection Domain)的名称,用于已配置的存储。
scaleIO.readOnly (boolean)
readOnly 默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。
scaleIO.sslEnabled (boolean)
sslEnabled 标志启用/禁用与网关的 SSL 通信,默认为 false。
storageMode 指示卷所用的存储应是 ThickProvisioned 或 ThinProvisioned。默认为 ThinProvisioned。
scaleIO.storagePool (string)
storagePool 是与保护域关联的 ScaleIO Storage Pool。
scaleIO.volumeName (string)
volumeName 是在与此卷源关联的 ScaleIO 系统中已创建的卷的名称。
storageos (StorageOSVolumeSource)
storageOS 表示 Kubernetes 节点上挂接和挂载的 StorageOS 卷。
storageos.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
readOnly 默认为 false(读/写)。此处的 readOnly 将强制设置卷挂载中的 readOnly 属性。
storageos.secretRef (LocalObjectReference)
secretRef 指定用于获取 StorageOS API 凭据的 Secret。如果未指定,则将尝试使用默认值。
volumeName 是 StorageOS 卷的人类可读名称。这些卷名称在一个名字空间内是唯一的。
storageos.volumeNamespace (string)
volumeNamespace 指定 StorageOS 内卷的作用域。如果未指定名字空间,则将使用 Pod 的名字空间。 这个设置使得 Kubernetes 的名字作用域可以在 StorageOS 内进行映射,实现更紧密的集成。 将 volumeName 设为任何名称以重载默认的行为。如果你未在 StorageOS 内使用名字空间,则设为“default”。 将创建 StorageOS 内预先不存在的名字空间。
vsphereVolume (VsphereVirtualDiskVolumeSource)
vsphereVolume 表示 kubelet 主机上挂接和挂载的 vSphere 卷。
vsphereVolume.volumePath (string),必需
volumePath 是标识 vSphere 卷 vmdk 的路径。
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
vsphereVolume.storagePolicyID (string)
storagePolicyID 是与 StoragePolicyName 关联的基于存储策略的管理(SPBM)配置文件 ID。
vsphereVolume.storagePolicyName (string)
storagePolicyName 是基于存储策略的管理(SPBM)配置文件名称。
ephemeral (EphemeralVolumeSource)
ephemeral 表示由一个集群存储驱动处理的卷。此卷的生命周期与定义其的 Pod 相关联。 Pod 启动前创建此卷,Pod 移除时删除此卷。
使用此字段的情形包括: a) 仅在 pod 运行时才需要此卷, b) 需要从快照恢复或容量跟踪等正常卷的功能特性, c) 通过存储类指定存储驱动,以及 d) 存储驱动支持通过 PersistentVolumeClaim 进行动态卷制备(有关此卷类型和 PersistentVolumeClaim 之间连接的更多信息,请参考 EphemeralVolumeSource)。
对于持续时间超过单个 Pod 生命周期的卷,使用 PersistentVolumeClaim 或某种特定于供应商的 API。
如果打算以这种方式使用 CSI 驱动,则将 CSI 用于轻量级本地临时卷。更多的相关信息,请参考驱动文档。
一个 Pod 可以同时使用临时卷和持久卷这两种类别的卷。
ephemeral.volumeClaimTemplate (PersistentVolumeClaimTemplate)
将用于创建独立的 PVC 以制备卷。
嵌入了 EphemeralVolumeSource 的 Pod 将是 PVC 的所有者,即 PVC 将与 Pod 一起删除。
PVC 的名称将是 <pod 名称>-<卷名称>
,其中 <卷名称>
是来自 PodSpec.Volumes
数组条目的名称。
如果串联的名称对于 PVC 无效(例如太长),则 Pod 验证将拒绝该 Pod。
如果具有此名称的 PVC 不属于 Pod,则这个 PVC 将不会用于此 Pod,以避免错误地使用不相关的卷。 如果出现这种情况,Pod 的启动操作会被阻塞直到不相关的 PVC 被移除。 如果 Pod 准备使用这样一个预先创建的 PVC ,那么一旦此 Pod 出现,就必须更新 PVC, 将其属主引用指向该 Pod。通常没有必要这样做,但这对手动重构损坏的集群时可能很有用。
此字段是只读的,PVC 被创建后 Kubernetes 不会对其进行任何更改。
必需,不能为 nil。
PersistentVolumeClaimTemplate 用于作为 EphemeralVolumeSource 的一部分生成 PersistentVolumeClaim 对象。
- **ephemeral.volumeClaimTemplate.spec** (<a href="https://deploy-preview-35120--kubernetes-io-main-staging.netlify.app/zh-cn/docs/reference/kubernetes-api/config-and-storage-resources/persistent-volume-claim-v1/#PersistentVolumeClaimSpec">PersistentVolumeClaimSpec</a>),必需
PersistentVolumeClaim 的规约。整个规约的内容将被原封不动地复制到从此模板创建的 PVC 中。 与 PersistentVolumeClaim 相同的字段在此处也有效。
ephemeral.volumeClaimTemplate.metadata (ObjectMeta)
可能包含一些标签和注解,在创建 PVC 时,这些数据会被复制到 PVC 中。在验证期间,其他字段都不允许设置进而被拒绝。
gitRepo (GitRepoVolumeSource)
gitRepo 表示特定修订版本的 git 仓库。(注意:GitRepo 已被弃用。)如果与为某容器提速 Git 仓库, 可以先将 emptyDir 挂载到 InitContainer 上,由后者使用 git 克隆仓库,然后将 emptyDir 挂载到 Pod 的容器中。
表示用 Git 仓库的内容进行填充的一个卷。Git 仓库卷不支持所有权管理。Git 仓库卷支持 SELinux 重新打标签。 (注意:GitRepo 已被弃用。)如果与为某容器提速 Git 仓库, 可以先将 emptyDir 挂载到 InitContainer 上,由后者使用 git 克隆仓库,然后将 emptyDir 挂载到 Pod 的容器中。
repository 是仓库的 URL。
gitRepo.directory (string)
directory 是目标目录的名称。不得包含 “..” 或以 “..” 开头。如果提供了 “.”,则卷目录将是 Git 仓库。 否则,如果指定,卷将用给定名称的子目录中存放 Git 仓库。
gitRepo.revision (string)
revision 是指定修订版本的提交哈希值。
DownwardAPIVolumeFile 表示创建包含 Pod 字段的文件的信息。
path (string),必需
必需。path 是要创建的文件的相对路径名称。不得使用绝对路径,也不得包含 “..” 路径。 必须用 UTF-8 进行编码。相对路径的第一项不得用 “..” 开头。
fieldRef (ObjectFieldSelector)
必需。选择 Pod 的字段:仅支持注解、标签、名称和名字空间。
mode (int32)
可选:模式位用于设置文件的权限,必须是 0000 到 0777 之间的八进制值或 0 到 511 之间的十进制值。 YAML 既接受八进制值也接受十进制值,JSON 针对模式位需要十进制值。 如果未指定,则将使用卷 defaultMode。 这可能与影响文件模式的其他选项(如 fsGroup)有冲突,且结果可以是其他模式位也被设置。
resourceFieldRef (ResourceFieldSelector)
选择容器的资源:目前仅支持资源限制与请求(limits.cpu、limits.memory、requests.cpu 和 requests.memory)。
将一个字符串键映射到卷中的一个路径。
key (string),必需
key 是要投射的键。
path (string),必需
path 是将键映射到的文件的相对路径。不能是绝对路径。不能包含路径元素 “..”。不能以字符串 “..” 开头。
mode (int32)
mode 是可选的:模式位用于为文件设置权限。必须是 0000 到 0777 之间的八进制值或 0 到 511 之间的十进制值。 YAML 既接受八进制值也接受十进制值,JSON 针对模式位需要十进制值。 如果未指定,则将使用卷 defaultMode。 这可能与影响文件模式的其他选项(如 fsGroup)有冲突,且结果可以是其他模式位也被设置。
apiVersion: v1
import "k8s.io/api/core/v1"
PersistentVolumeClaim 是用户针对一个持久卷的请求和申领。
apiVersion: v1
kind: PersistentVolumeClaim
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (PersistentVolumeClaimSpec)
spec 定义 Pod 作者所请求的卷的预期特征。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
status (PersistentVolumeClaimStatus)
status 表示一个持久卷申领的当前信息/状态。只读。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
PersistentVolumeClaimSpec 描述存储设备的常用参数,并支持通过 source 来设置特定于提供商的属性。
accessModes ([]string)
accessModes 包含卷应具备的预期访问模式。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#access-modes-1
selector (LabelSelector)
selector 是在绑定时对卷进行选择所执行的标签查询。
resources (ResourceRequirements)
resources 表示卷应拥有的最小资源。 如果启用了 RecoverVolumeExpansionFailure 功能特性,则允许用户指定这些资源要求, 此值必须低于之前的值,但必须高于申领的状态字段中记录的容量。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#resources
ResourceRequirements 描述计算资源要求。
resources.limits (map[string]Quantity)
limits 描述允许的最大计算资源量。更多信息: https://kubernetes.io/zh-cn/docs/concepts/configuration/manage-resources-containers/
resources.requests (map[string]Quantity)
requests 描述所需的最小计算资源量。 如果针对容器省略 requests,则在显式指定的情况下默认为 limits,否则为具体实现所定义的值。更多信息: https://kubernetes.io/zh-cn/docs/concepts/configuration/manage-resources-containers/
volumeName (string)
volumeName 是对此申领所对应的 PersistentVolume 的绑定引用。
storageClassName (string)
storageClassName 是此申领所要求的 StorageClass 名称。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#class-1
volumeMode (string)
volumeMode 定义申领需要哪种类别的卷。当申领规约中未包含此字段时,意味着取值为 Filesystem。
dataSource (TypedLocalObjectReference)
dataSource 字段可用于二选一:
现有的 VolumeSnapshot 对象(snapshot.storage.k8s.io/VolumeSnapshot)
现有的 PVC (PersistentVolumeClaim)
如果制备器或外部控制器可以支持指定的数据源,则它将根据指定数据源的内容创建新的卷。 如果 AnyVolumeDataSource 特性门控被启用,此字段的内容将始终与 dataSourceRef 字段内容相同。
dataSourceRef (TypedLocalObjectReference)
dataSourceRef 指定一个对象,当需要非空卷时,可以使用它来为卷填充数据。 此字段值可以是来自非空 API 组(非核心对象)的一个本地对象,或一个 PersistentVolumeClaim 对象。 如果设置了此字段,则仅当所指定对象的类型与所安装的某些卷填充器或动态制备器匹配时,卷绑定才会成功。 此字段将替换 dataSource 字段的功能,因此如果两个字段非空,其取值必须相同。 为了向后兼容,如果其中一个字段为空且另一个字段非空, 则两个字段(dataSource 和 dataSourceRef)将被自动设为相同的值。 dataSource 和 dataSourceRef 之间有两个重要的区别:
dataSource 仅允许两个特定类型的对象,而 dataSourceRef 允许设置任何非核心对象以及 PersistentVolumeClaim 对象。
dataSource 忽略不允许的值(这类值会被丢弃),dataSourceRef 保留所有值并在指定不允许的值时产生错误。
(Beta)使用此字段需要启用 AnyVolumeDataSource 特性门控。
PersistentVolumeClaimStatus 是持久卷申领的当前状态。
accessModes ([]string)
accessModes 包含支持 PVC 的卷所具有的实际访问模式。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#access-modes-1
allocatedResources (map[string]Quantity)
allocatedResources 跟踪分配给 PVC 的容量。 当出现卷扩充操作请求时,此字段可能大于实际的容量。 就存储配额而言,将使用 allocatedResources 和 PVC.spec.resources 二者中的更大值。 如果未设置 allocatedResources,则 PVC.spec.resources 单独用于配额计算。 如果减小一个卷扩充容量请求,则仅当没有正在进行的扩充操作且实际卷容量等于或小于请求的容量时, 才会减小 allocatedResources。 这是一个 Alpha 字段,需要启用 RecoverVolumeExpansionFailure 功能特性。
capacity (map[string]Quantity)
capacity 表示底层卷的实际资源。
conditions ([]PersistentVolumeClaimCondition)
补丁策略:按照键 type
合并
conditions 是持久卷声明的当前的状况。 如果正在调整底层持久卷的大小,则状况将被设为 “ResizeStarted”。
conditions.status (string),必需
conditions.type (string),必需
conditions.lastProbeTime (Time)
lastProbeTime 是我们探测 PVC 状况的时间。
Time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。
conditions.lastTransitionTime (Time)
lastTransitionTime 是状况从一个状态转换为另一个状态的时间。
Time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。
conditions.message (string)
message 是人类可读的消息,指示有关上一次转换的详细信息。
conditions.reason (string)
reason 是唯一的,它应该是一个机器可理解的简短字符串,指明上次状况转换的原因。 如果它报告 “ResizeStarted”,则意味着正在调整底层持久卷的大小。
phase (string)
phase 表示 PersistentVolumeClaim 的当前阶段。
resizeStatus (string)
resizeStatus 存储大小调整操作的状态。默认不设置 resizeStatus,但在扩充完成时, resizeStatus 将由大小调整控制器或 kubelet 设为空。 这是一个 Alpha 字段,需要启用 RecoverVolumeExpansionFailure 功能特性。
PersistentVolumeClaimList 是 PersistentVolumeClaim 各项的列表。
apiVersion: v1
kind: PersistentVolumeClaimList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]PersistentVolumeClaim),必需
items 是持久卷申领的列表。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#persistentvolumeclaims
get
读取指定的 PersistentVolumeClaimGET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
name (路径参数): string,必需
PersistentVolumeClaim 的名称
namespace (路径参数): string,必需
pretty (查询参数): string
200 (PersistentVolumeClaim): OK
401: Unauthorized
get
读取指定的 PersistentVolumeClaim 的状态GET /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status
name (路径参数): string,必需
PersistentVolumeClaim 的名称
namespace (路径参数): string,必需
pretty (查询参数): string
200 (PersistentVolumeClaim): OK
401: Unauthorized
list
列出或观测类别为 PersistentVolumeClaim 的对象GET /api/v1/namespaces/{namespace}/persistentvolumeclaims
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (PersistentVolumeClaimList): OK
401: Unauthorized
list
列出或观测类别为 PersistentVolumeClaim 的对象GET /api/v1/persistentvolumeclaims
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (PersistentVolumeClaimList): OK
401: Unauthorized
create
创建 PersistentVolumeClaimPOST /api/v1/namespaces/{namespace}/persistentvolumeclaims
namespace (路径参数): string,必需
body: PersistentVolumeClaim,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
202 (PersistentVolumeClaim): Accepted
401: Unauthorized
update
替换指定的 PersistentVolumeClaimPUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
name (路径参数): string,必需
PersistentVolumeClaim 的名称
namespace (路径参数): string,必需
body: PersistentVolumeClaim,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: Unauthorized
update
替换指定的 PersistentVolumeClaim 的状态PUT /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status
name (路径参数): string,必需
PersistentVolumeClaim 的名称
namespace (路径参数): string,必需
body: PersistentVolumeClaim,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: Unauthorized
patch
部分更新指定的 PersistentVolumeClaimPATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
name (路径参数): string,必需
PersistentVolumeClaim 的名称
namespace (路径参数): string,必需
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: Unauthorized
patch
部分更新指定的 PersistentVolumeClaim 的状态PATCH /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}/status
name (路径参数): string,必需
PersistentVolumeClaim 的名称
namespace (路径参数): string,必需
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PersistentVolumeClaim): OK
201 (PersistentVolumeClaim): Created
401: Unauthorized
delete
删除 PersistentVolumeClaimDELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims/{name}
name (路径参数): string,必需
PersistentVolumeClaim 的名称
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (PersistentVolumeClaim): OK
202 (PersistentVolumeClaim): Accepted
401: Unauthorized
deletecollection
删除 PersistentVolumeClaim 的集合DELETE /api/v1/namespaces/{namespace}/persistentvolumeclaims
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
PersistentVolume (PV) 是管理员制备的一个存储资源。它类似于一个节点。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes
apiVersion: v1
kind: PersistentVolume
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (PersistentVolumeSpec)
spec 定义了集群所拥有的持久卷的规约。由管理员进行制备。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#persistent-volumes
status (PersistentVolumeStatus)
status 表示持久卷的当前信息/状态。该值由系统填充,只读。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#persistent-volumes
PersistentVolumeSpec 是持久卷的规约。
accessModes ([]string)
accessModes 包含可以挂载卷的所有方式。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#access-modes
capacity (map[string]Quantity)
capacity 描述持久卷的资源和容量。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#capacity
claimRef (ObjectReference)
claimRef 是 PersistentVolume 和 PersistentVolumeClaim 之间双向绑定的一部分。 预期在绑定时为非空。claim.VolumeName 是在 PV 和 PVC 间绑定关系的正式确认。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#binding
mountOptions ([]string)
mountOptions 是挂载选项的列表,例如 ["ro", "soft"]。 针对此字段无合法性检查——如果某选项无效,则只是挂载会失败。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes/#mount-options
nodeAffinity (VolumeNodeAffinity)
nodeAffinity 定义可以从哪些节点访问此卷的约束限制。此字段会影响调度使用此卷的 Pod。
nodeAffinity.required (NodeSelector)
required 指定必须满足的硬性节点约束。
节点选择器表示在一组节点上一个或多个标签查询结果的并集; 也就是说,它表示由节点选择器条件表示的选择器的逻辑或计算结果。
nodeAffinity.required.nodeSelectorTerms ([]NodeSelectorTerm),必需
必需。节点选择器条件的列表。这些条件是逻辑或的计算结果。
一个 null 或空的节点选择器条件不会与任何对象匹配。这些条件会按逻辑与的关系来计算。 TopologySelectorTerm 类别实现了 NodeSelectorTerm 的子集。
nodeAffinity.required.nodeSelectorTerms.matchExpressions ([]NodeSelectorRequirement)
基于节点标签所设置的节点选择器要求的列表。
nodeAffinity.required.nodeSelectorTerms.matchFields ([]NodeSelectorRequirement)
基于节点字段所设置的节点选择器要求的列表。
persistentVolumeReclaimPolicy (string)
persistentVolumeReclaimPolicy 定义当从持久卷声明释放持久卷时会发生什么。 有效的选项为 Retain(手动创建 PersistentVolumes 所用的默认值)、 Delete(动态制备 PersistentVolumes 所用的默认值)和 Recycle(已弃用)。 Recycle 选项必须被 PersistentVolume 下层的卷插件所支持才行。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#reclaiming
storageClassName (string)
storageClassName 是这个持久卷所属于的 StorageClass 的名称。 空值意味着此卷不属于任何 StorageClass。
volumeMode (string)
volumeMode 定义一个卷是带着已格式化的文件系统来使用还是保持在原始块状态来使用。 当 spec 中未包含此字段时,意味着取值为 Filesystem。
hostPath (HostPathVolumeSource)
hostPath 表示主机上的目录,由开发或测试人员进行制备。hostPath 仅对单节点开发和测试有用! 不会以任何方式支持主机存储(On-host storage),并且不能用于多节点集群中。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#hostpath
表示映射到 Pod 中的主机路径。主机路径卷不支持所有权管理或 SELinux 重新打标签。
hostPath.path (string),必需
目录在主机上的路径。如果该路径是一个符号链接,则它将沿着链接指向真实路径。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#hostpath
hostPath.type (string)
HostPath 卷的类型。默认为 ""。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#hostpath
local (LocalVolumeSource)
local 表示具有节点亲和性的直连式存储。
local 表示具有节点亲和性的直连式存储(Beta 特性)。
local.path (string),必需
指向节点上卷的完整路径。它可以是一个目录或块设备(磁盘、分区...)。
local.fsType (string)
fsType 是要挂载的文件系统类型。它仅适用于 path 是一个块设备的情况。 必须是主机操作系统所支持的文件系统类型之一。例如 “ext4”、“xfs”、“ntfs”。 在未指定的情况下,默认值是自动选择一个文件系统。
awsElasticBlockStore (AWSElasticBlockStoreVolumeSource)
awsElasticBlockStore 表示挂接到 kubelet 的主机随后暴露给 Pod 的一个 AWS Disk 资源。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
表示 AWS 上的 Persistent Disk 资源。挂载到一个容器之前 AWS EBS 磁盘必须存在。 该磁盘还必须与 kubelet 位于相同的 AWS 区域中。AWS EBS 磁盘只能以读/写一次进行挂载。 AWS EBS 卷支持所有权管理和 SELinux 重新打标签。
awsElasticBlockStore.volumeID (string),必需
volumeID 是 AWS(Amazon EBS 卷)中持久磁盘资源的唯一 ID。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
awsElasticBlockStore.fsType (string)
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为“ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
awsElasticBlockStore.partition (int32)
partition 是你要挂载的卷中的分区。如果省略,则默认为按卷名称进行挂载。 例如:对于卷 /dev/sda1,将分区指定为 “1”。 类似地,/dev/sda 的卷分区为 “0”(或可以将属性留空)。
awsElasticBlockStore.readOnly (boolean)
readOnly 值为 true 将在 VolumeMounts 中强制设置 readOnly。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#awselasticblockstore
azureDisk (AzureDiskVolumeSource)
azureDisk 表示主机上挂载的 Azure Data Disk 并绑定挂载到 Pod 上。
azureDisk.diskName (string),必需
diskName 是 Blob 存储中数据盘的名称。
azureDisk.diskURI (string),必需
diskURI 是 Blob 存储中数据盘的 URI。
azureDisk.cachingMode (string)
cachingMode 是主机缓存(Host Caching)模式:None、Read Only、Read Write。
azureDisk.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
azureDisk.kind (string)
kind 预期值包括:
azureDisk.readOnly (boolean)
readOnly 默认为 false(读/写)。此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。
azureFile (AzureFilePersistentVolumeSource)
azureDisk 表示主机上挂载的 Azure File Service 并绑定挂载到 Pod 上。
azureFile 表示主机上挂载的 Azure File Service 并绑定挂载到 Pod 上。
azureFile.secretName (string),必需
secretName 是包含 Azure 存储账号名称和主键的 Secret 的名称。
azureFile.shareName (string),必需
shareName 是 azure Share Name。
azureFile.readOnly (boolean)
readOnly 默认为 false(读/写)。此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。
azureFile.secretNamespace (string)
secretNamespace 是包含 Azure 存储账号名称和主键的 Secret 的名字空间,默认与 Pod 相同。
cephfs (CephFSPersistentVolumeSource)
cephfs 表示在主机上挂载的 Ceph FS,该文件系统挂载与 Pod 的生命周期相同。
表示在 Pod 的生命周期内持续的 Ceph Filesystem 挂载。cephfs 卷不支持所有权管理或 SELinux 重新打标签。
cephfs.monitors ([]string),必需
monitors 是必需的。monitors 是 Ceph 监测的集合。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
cephfs.path (string)
path 是可选的。用作挂载的根,而不是完整的 Ceph 树,默认为 /。
cephfs.readOnly (boolean)
readOnly 是可选的。默认为 false(读/写)。此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。 更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
cephfs.secretFile (string)
secretFile 是可选的。secretFile 是 user 对应的密钥环的路径,默认为 /etc/ceph/user.secret。 更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
cephfs.secretRef (SecretReference)
secretRef 是可选的。secretRef 是针对用户到身份认证 Secret 的引用,默认为空。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
cephfs.secretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
cephfs.secretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
cephfs.user (string)
user 是可选的。user 是 rados 用户名,默认为 admin。更多信息: https://examples.k8s.io/volumes/cephfs/README.md#how-to-use-it
cinder (CinderPersistentVolumeSource)
cinder 表示 kubelet 主机上挂接和挂载的 Cinder 卷。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
表示 OpenStack 中的一个 Cinder 卷资源。挂载到一个容器之前 Cinder 卷必须已经存在。 该卷还必须与 kubelet 位于相同的地区中。cinder 卷支持所有权管理和 SELinux 重新打标签。
cinder.volumeID (string),必需
volumeID 用于标识 Cinder 中的卷。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
cinder.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统支持的文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
cinder.readOnly (boolean)
readOnly 是可选的。默认为 false(读/写)。 此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。更多信息: https://examples.k8s.io/mysql-cinder-pd/README.md
cinder.secretRef (SecretReference)
secretRef 是可选的。指向 Secret 对象,内含的参数用于连接到 OpenStack。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
cinder.secretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
cinder.secretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
csi (CSIPersistentVolumeSource)
csi 表示由一个外部 CSI 驱动处理的存储(Beta 特性)。
表示由一个外部 CSI 卷驱动管理的存储(Beta 特性)。
csi.driver (string),必需
driver 是此卷所使用的驱动的名称。必需。
csi.volumeHandle (string),必需
volumeHandle 是 CSI 卷插件的 CreateVolume 所返回的唯一卷名称,用于在所有后续调用中引用此卷。必需。
csi.controllerExpandSecretRef (SecretReference)
controllerExpandSecretRef 是对包含敏感信息的 Secret 对象的引用, 该 Secret 会被传递到 CSI 驱动以完成 CSI ControllerExpandVolume 调用。 这是一个 Alpha 字段,需要启用 ExpandCSIVolumes 特性门控。 此字段是可选的,且如果不需要 Secret,则此字段可以为空。 如果 Secret 对象包含多个 Secret,则所有 Secret 被传递。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
csi.controllerExpandSecretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
csi.controllerExpandSecretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
csi.controllerPublishSecretRef (SecretReference)
controllerPublishSecretRef 是对包含敏感信息的 Secret 对象的引用, 该 Secret 会被传递到 CSI 驱动以完成 CSI ControllerPublishVolume 和 ControllerUnpublishVolume 调用。 此字段是可选的,且如果不需要 Secret,则此字段可以为空。 如果 Secret 对象包含多个 Secret,则所有 Secret 被传递。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
csi.controllerPublishSecretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
csi.controllerPublishSecretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
csi.fsType (string)
要挂载的 fsType。必须是主机操作系统所支持的文件系统类型之一。例如 “ext4”、“xfs”、“ntfs”。
csi.nodePublishSecretRef (SecretReference)
nodePublishSecretRef 是对包含敏感信息的 Secret 对象的引用, 从而传递到 CSI 驱动以完成 CSI NodePublishVolume 和 NodeUnpublishVolume 调用。 此字段是可选的,且如果不需要 Secret,则此字段可以为空。 如果 Secret 对象包含多个 Secret,则所有 Secret 被传递。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
csi.nodePublishSecretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
csi.nodePublishSecretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
csi.nodeStageSecretRef (SecretReference)
nodeStageSecretRef 是对包含敏感信息的 Secret 对象的引用, 从而传递到 CSI 驱动以完成 CSI NodeStageVolume、NodeStageVolume 和 NodeUnstageVolume 调用。 此字段是可选的,且如果不需要 Secret,则此字段可以为空。 如果 Secret 对象包含多个 Secret,则所有 Secret 被传递。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
csi.nodeStageSecretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
csi.nodeStageSecretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
csi.readOnly (boolean)
传递到 ControllerPublishVolumeRequest 的 readOnly 值。默认为 false(读/写)。
csi.volumeAttributes (map[string]string)
要发布的卷的 volumeAttributes。
fc (FCVolumeSource)
fc 表示挂接到 kubelet 的主机并随后暴露给 Pod 的一个光纤通道(FC)资源。
fc.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
fc.lun (int32)
lun 是可选的。FC 目标 lun 编号。
fc.readOnly (boolean)
readOnly 是可选的。默认为 false(读/写)。 此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。
fc.targetWWNs ([]string)
targetWWNs 是可选的。FC 目标全球名称(WWN)。
fc.wwids ([]string)
wwids 是可选的。FC 卷全球识别号(wwids)。 必须设置 wwids 或 targetWWNs 及 lun 的组合,但不能同时设置两者。
flexVolume (FlexPersistentVolumeSource)
flexVolume 表示使用基于 exec 的插件制备/挂接的通用卷资源。
flexVolume.driver (string),必需
driver 是此卷所使用的驱动的名称。
flexVolume.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。默认的文件系统取决于 flexVolume 脚本。
flexVolume.options (map[string]string)
options 是可选的。此字段包含额外的命令选项(如果有)。
flexVolume.readOnly (boolean)
readOnly 是可选的。默认为 false(读/写)。 此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。
flexVolume.secretRef (SecretReference)
secretRef 是可选的。secretRef 是对包含敏感信息的 Secret 对象的引用,从而传递到插件脚本。 如果未指定 Secret 对象,则此字段可以为空。如果 Secret 对象包含多个 Secret,则所有 Secret 被传递到插件脚本。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
flexVolume.secretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
flexVolume.secretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
flocker (FlockerVolumeSource)
flocker 表示挂接到 kubelet 的主机并暴露给 Pod 供其使用的 Flocker 卷。 这取决于所运行的 Flocker 控制服务。
表示 Flocker 代理挂载的 Flocker 卷。应设置且仅设置 datasetName 和 datasetUUID 中的一个。 Flocker 卷不支持所有权管理或 SELinux 重新打标签。
flocker.datasetName (string)
datasetName 是存储为元数据的数据集的名称。针对 Flocker 有关数据集的名称应视为已弃用。
flocker.datasetUUID (string)
datasetUUID 是数据集的 UUID。这是 Flocker 数据集的唯一标识符。
gcePersistentDisk (GCEPersistentDiskVolumeSource)
gcePersistentDisk 表示挂接到 kubelet 的主机随后暴露给 Pod 的一个 GCE Disk 资源。 由管理员进行制备。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
表示 Google 计算引擎中的 Persistent Disk 资源。挂载到一个容器之前 GCE PD 必须存在。 该磁盘还必须与 kubelet 位于相同的 GCE 项目和区域中。GCE PD 只能挂载为读/写一次或只读多次。 GCE PD 支持所有权管理和 SELinux 重新打标签。
gcePersistentDisk.pdName (string),必需
pdName 是 GCE 中 PD 资源的唯一名称。用于标识 GCE 中的磁盘。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
gcePersistentDisk.fsType (string)
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
gcePersistentDisk.partition (int32)
partition 是你要挂载的卷中的分区。如果省略,则默认为按卷名称进行挂载。 例如:对于卷 /dev/sda1,将分区指定为 “1”。类似地,/dev/sda 的卷分区为 “0”(或可以将属性留空)。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
gcePersistentDisk.readOnly (boolean)
此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。默认为 false。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#gcepersistentdisk
glusterfs (GlusterfsPersistentVolumeSource)
glusterfs 表示挂接到主机并暴露给 Pod 的 Glusterfs 卷。由管理员进行制备。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md
表示与 Pod 生命周期相同的 Glusterfs 挂载。Glusterfs 卷不支持所有权管理或 SELinux 重新打标签。
glusterfs.endpoints (string),必需
endpoints 是详细说明 Glusterfs 拓扑的端点名称。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
glusterfs.path (string),必需
path 是 Glusterfs 卷路径。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
glusterfs.endpointsNamespace (string)
endpointsNamespace 是包含 Glusterfs 端点的名字空间。 如果此字段为空,则 EndpointNamespace 默认为与绑定的 PVC 相同的名字空间。 更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
glusterfs.readOnly (boolean)
此处 readOnly 将强制使用只读权限挂载 Glusterfs 卷。默认为 false。更多信息: https://examples.k8s.io/volumes/glusterfs/README.md#create-a-pod
iscsi (ISCSIPersistentVolumeSource)
iscsi 表示挂接到 kubelet 的主机随后暴露给 Pod 的一个 ISCSI Disk 资源。由管理员进行制备。
ISCSIPersistentVolumeSource 表示一个 ISCSI 磁盘。ISCSI 卷只能以读/写一次进行挂载。ISCSI 卷支持所有权管理和 SELinux 重新打标签。
iscsi.iqn (string),必需
iqn 是目标 iSCSI 限定名称(Target iSCSI Qualified Name)。
iscsi.lun (int32),必需
lun 是 iSCSI 目标逻辑单元号(iSCSI Target Lun)。
iscsi.targetPortal (string),必需
targetPortal 是 iSCSI 目标门户(iSCSI Target Portal)。 如果不是默认端口(通常是 TCP 端口 860 和 3260),则 Portal 为 IP 或 ip_addr:port。
iscsi.chapAuthDiscovery (boolean)
chapAuthDiscovery 定义是否支持 iSCSI Discovery CHAP 身份认证。
iscsi.chapAuthSession (boolean)
chapAuthSession 定义是否支持 iSCSI Session CHAP 身份认证。
iscsi.fsType (string)
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#iscsi
iscsi.initiatorName (string)
initiatorName 是自定义的 iSCSI 发起程序名称(iSCSI Initiator Name)。 如果同时用 iscsiInterface 指定 initiatorName,将为连接创建新的 iSCSI 接口 <目标门户>:<卷名称>。
iscsi.iscsiInterface (string)
iscsiInterface 是使用 iSCSI 传输的接口名称。默认为 “default”(tcp)。
iscsi.portals ([]string)
portals 是 iSCSI 目标门户列表(iSCSI Target Portal List)。 如果不是默认端口(通常是 TCP 端口 860 和 3260),则 Portal 为 IP 或 ip_addr:port。
iscsi.readOnly (boolean)
此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。默认为 false。
iscsi.secretRef (SecretReference)
secretRef 是 iSCSI 目标和发起程序身份认证所用的 CHAP Secret。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
iscsi.secretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
iscsi.secretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
nfs (NFSVolumeSource)
nfs 表示主机上挂载的 NFS。由管理员进行制备。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
表示 Pod 的生命周期内持续的 NFS 挂载。NFS 卷不支持所有权管理或 SELinux 重新打标签。
nfs.path (string),必需
path 是由 NFS 服务器导出的路径。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
nfs.server (string),必需
server 是 NFS 服务器的主机名或 IP 地址。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
nfs.readOnly (boolean)
此处 readOnly 将强制使用只读权限挂载 NFS 导出。默认为 false。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#nfs
photonPersistentDisk (PhotonPersistentDiskVolumeSource)
photonPersistentDisk 表示 kubelet 主机上挂接和挂载的 PhotonController 持久磁盘。
photonPersistentDisk.pdID (string),必需
pdID 是标识 Photon Controller 持久磁盘的 ID。
photonPersistentDisk.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
portworxVolume (PortworxVolumeSource)
portworxVolume 表示 kubelet 主机上挂接和挂载的 portworx 卷。
PortworxVolumeSource 表示 Portworx 卷资源。
portworxVolume.volumeID (string),必需
volumeID 唯一标识 Portworx 卷。
portworxVolume.fsType (string)
fSType 表示要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”。如果未指定,则隐式推断为 “ext4”。
portworxVolume.readOnly (boolean)
readOnly 默认为 false(读/写)。此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。
quobyte (QuobyteVolumeSource)
quobyte 表示在共享 Pod 生命周期的主机上挂载的 Quobyte。
表示在 Pod 的生命周期内持续的 Quobyte 挂载。Quobyte 卷不支持所有权管理或 SELinux 重新打标签。
quobyte.registry (string),必需
registry 表示将一个或多个 Quobyte Registry 服务指定为 host:port 对的字符串形式(多个条目用英文逗号分隔),用作卷的中央注册表。
quobyte.volume (string),必需
volume 是一个字符串,通过名称引用已创建的 Quobyte 卷。
quobyte.group (string)
group 是将卷访问映射到的组。默认为无组。
quobyte.readOnly (boolean)
此处 readOnly 将强制使用只读权限挂载 Quobyte 卷。默认为 false。
quobyte.tenant (string)
后台中拥有给定 Quobyte 卷的租户。用于动态制备的 Quobyte 卷,其值由插件设置。
quobyte.user (string)
user 是将卷访问映射到的用户。默认为 serivceaccount 用户。
rbd (RBDPersistentVolumeSource)
rbd 表示主机上挂载的 Rados 块设备,其生命周期与 Pod 生命周期相同。更多信息: https://examples.k8s.io/volumes/rbd/README.md
表示在 Pod 的生命周期内一直存在的 Rados 块设备挂载。RBD 卷支持所有权管理和 SELinux 重新打标签。
rbd.image (string),必需
image 是 rados 镜像名称。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.monitors ([]string),必需
monitors 是 Ceph 监测的集合。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.fsType (string)
fsType 是你要挂载的卷的文件系统类型。提示:确保主机操作系统支持此文件系统类型。 例如:“ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/volumes#rbd
rbd.keyring (string)
keyring 是给定用户的密钥环的路径。默认为 /etc/ceph/keyring。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.pool (string)
pool 是 rados 池名称。默认为 rbd。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.readOnly (boolean)
此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。默认为 false。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
rbd.secretRef (SecretReference)
secretRef 是针对 RBDUser 的身份认证 Secret 的名称。如果提供,则重载 keyring。默认为 nil。 更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
rbd.secretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
rbd.secretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
rbd.user (string)
user 是 rados 用户名。默认为 admin。更多信息: https://examples.k8s.io/volumes/rbd/README.md#how-to-use-it
scaleIO (ScaleIOPersistentVolumeSource)
scaleIO 表示 Kubernetes 节点上挂接和挂载的 ScaleIO 持久卷。
ScaleIOPersistentVolumeSource 表示一个 ScaleIO 持久卷。
scaleIO.gateway (string),必需
gateway 是 ScaleIO API 网关的主机地址。
scaleIO.secretRef (SecretReference),必需
secretRef 引用包含 ScaleIO 用户和其他敏感信息的 Secret。如果未提供此项,则 Login 操作将失败。
SecretReference 表示对某 Secret 的引用,其中包含足够的信息来访问任何名字空间中的 Secret。
scaleIO.secretRef.name (string)
name 在名字空间内是唯一的,以引用一个 Secret 资源。
scaleIO.secretRef.namespace (string)
namespace 指定一个名字空间,Secret 名称在该名字空间中必须唯一。
scaleIO.system (string),必需
system 是 ScaleIO 中所配置的存储系统的名称。
scaleIO.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。默认为 “xfs”。
scaleIO.protectionDomain (string)
protectionDomain 是 ScaleIO 保护域(ScaleIO Protection Domain)的名称,用于已配置的存储。
scaleIO.readOnly (boolean)
readOnly 默认为 false(读/写)。此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。
scaleIO.sslEnabled (boolean)
sslEnabled 是启用/禁用与网关(Gateway)进行 SSL 通信的标志,默认为 false。
scaleIO.storageMode (string)
storageMode 指示卷所用的存储应是 ThickProvisioned 或 ThinProvisioned。 默认为 ThinProvisioned。
scaleIO.storagePool (string)
storagePool 是与保护域关联的 ScaleIO Storage Pool。
scaleIO.volumeName (string)
volumeName 是在与此卷源关联的 ScaleIO 系统中已创建的卷的名称。
storageos (StorageOSPersistentVolumeSource)
storageOS 表示一个 StorageOS 卷,该卷被挂接到 kubelet 的主机并挂载到 Pod 中。更多信息: https://examples.k8s.io/volumes/storageos/README.md
storageos.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
storageos.readOnly (boolean)
readOnly 默认为 false(读/写)。此处 readOnly 将在 VolumeMounts 中强制设置 readOnly。
storageos.secretRef (ObjectReference)
secretRef 指定用于获取 StorageOS API 凭据的 Secret。如果未指定,则将尝试使用默认值。
storageos.volumeName (string)
volumeName 是 StorageOS 卷的人类可读名称。这些卷名称在一个名字空间内是唯一的。
storageos.volumeNamespace (string)
volumeNamespace 指定 StorageOS 内卷的作用域。如果未指定名字空间,则将使用 Pod 的名字空间。 这一字段的存在允许 Kubernetes 中名称作用域与 StorageOS 进行映射,实现更紧密的集成。 将 volumeName 设为任何名称均可以重载默认的行为。 如果你未在 StorageOS 内使用名字空间,则设为 “default”。 StorageOS 内预先不存在的名字空间会被创建。
vsphereVolume (VsphereVirtualDiskVolumeSource)
vsphereVolume 表示 kubelet 主机上挂接和挂载的 vSphere 卷。
vsphereVolume.volumePath (string),必需
volumePath 是标识 vSphere 卷 vmdk 的路径。
vsphereVolume.fsType (string)
fsType 是要挂载的文件系统类型。必须是主机操作系统所支持的文件系统类型之一。 例如 “ext4”、“xfs”、“ntfs”。如果未指定,则隐式推断为 “ext4”。
vsphereVolume.storagePolicyID (string)
storagePolicyID 是与 StoragePolicyName 关联的基于存储策略的管理(SPBM)配置文件 ID。
vsphereVolume.storagePolicyName (string)
storagePolicyName 是基于存储策略的管理(SPBM)配置文件名称。
PersistentVolumeStatus 是持久卷的当前状态。
message (string)
message 是一条人类可读的消息,指明有关卷为何处于此状态的详细信息。
phase (string)
phase 表示一个卷是否可用,是否绑定到一个 PVC 或是否由某个 PVC 释放。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes#phase
reason (string)
reason 是一个描述任何故障的简短 CamelCase 字符串,用于机器解析并在 CLI 中整齐地显示。
PersistentVolumeList 是 PersistentVolume 各项的列表。
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]PersistentVolume),必需
items 是持久卷的列表。更多信息: https://kubernetes.io/zh-cn/docs/concepts/storage/persistent-volumes
get
读取指定的 PersistentVolumeGET /api/v1/persistentvolumes/{name}
name (路径参数): string,必需
PersistentVolume 的名称
pretty (查询参数): string
200 (PersistentVolume): OK
401: Unauthorized
get
读取指定的 PersistentVolume 的状态GET /api/v1/persistentvolumes/{name}/status
name (路径参数): string,必需
PersistentVolume 的名称
pretty (查询参数): string
200 (PersistentVolume): OK
401: Unauthorized
list
列出或观测类别为 PersistentVolume 的对象GET /api/v1/persistentvolumes
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (PersistentVolumeList): OK
401: Unauthorized
create
创建 PersistentVolumePOST /api/v1/persistentvolumes
body: PersistentVolume,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PersistentVolume): OK
201 (PersistentVolume): Created
202 (PersistentVolume): Accepted
401: Unauthorized
update
替换指定的 PersistentVolumePUT /api/v1/persistentvolumes/{name}
name (路径参数): string,必需
PersistentVolume 的名称
body: PersistentVolume,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PersistentVolume): OK
201 (PersistentVolume): Created
401: Unauthorized
update
替换指定的 PersistentVolume 的状态PUT /api/v1/persistentvolumes/{name}/status
name (路径参数): string,必需
PersistentVolume 的名称
body: PersistentVolume,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PersistentVolume): OK
201 (PersistentVolume): Created
401: Unauthorized
patch
部分更新指定的 PersistentVolumePATCH /api/v1/persistentvolumes/{name}
name (路径参数): string,必需
PersistentVolume 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PersistentVolume): OK
201 (PersistentVolume): Created
401: Unauthorized
patch
部分更新指定的 PersistentVolume 的状态PATCH /api/v1/persistentvolumes/{name}/status
name (路径参数): string,必需
PersistentVolume 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PersistentVolume): OK
201 (PersistentVolume): Created
401: Unauthorized
delete
删除 PersistentVolumeDELETE /api/v1/persistentvolumes/{name}
name (路径参数): string,必需
PersistentVolume 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (PersistentVolume): OK
202 (PersistentVolume): Accepted
401: Unauthorized
deletecollection
删除 PersistentVolume 的集合DELETE /api/v1/persistentvolumes
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
StorageClass 为可以动态制备 PersistentVolume 的存储类描述参数。
StorageClass 是不受名字空间作用域限制的;按照 etcd 设定的存储类的名称位于 ObjectMeta.Name 中。
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
provisioner (string),必需
provisioner 表示制备器的类别。
allowVolumeExpansion (boolean)
allowVolumeExpansion 显示存储类是否允许卷扩充。
allowedTopologies ([]TopologySelectorTerm)
原子性:将在合并期间被替换
限制可以动态制备卷的节点拓扑。每个卷插件定义其自己支持的拓扑规约。 空的 TopologySelectorTerm 列表意味着没有拓扑限制。 只有启用 VolumeScheduling 功能特性的服务器才能使用此字段。
拓扑选择器条件表示标签查询的结果。 一个 null 或空的拓扑选择器条件不会匹配任何对象。各个条件的要求按逻辑与的关系来计算。 此选择器作为 NodeSelectorTerm 所提供功能的子集。此功能为 Alpha 特性,将来可能会变更。
allowedTopologies.matchLabelExpressions ([]TopologySelectorLabelRequirement)
按标签设置的拓扑选择器要求的列表。
拓扑选择器要求是与给定标签匹配的一个选择器。此功能为 Alpha 特性,将来可能会变更。
allowedTopologies.matchLabelExpressions.key (string),必需
选择器所针对的标签键。
allowedTopologies.matchLabelExpressions.values ([]string),必需
字符串数组。一个值必须与要选择的标签匹配。values 中的每个条目按逻辑或的关系来计算。
mountOptions ([]string)
此存储类动态制备的 PersistentVolume 用这些 mountOptions(例如 ["ro", "soft"])进行创建。 系统对选项作检查——如果有一个选项无效,则这些 PV 的挂载将失败。
parameters (map[string]string)
parameters 包含应创建此存储类卷的制备器的参数。
reclaimPolicy (string)
此存储类动态制备的 PersistentVolume 用这个 reclaimPolicy 进行创建。默认为 Delete。
volumeBindingMode (string)
volumeBindingMode 指示应该如何制备和绑定 PersistentVolumeClaim。 未设置时,将使用 VolumeBindingImmediate。 只有启用 VolumeScheduling 功能特性的服务器才能使用此字段。
StorageClassList 是存储类的集合。
apiVersion: storage.k8s.io/v1
kind: StorageClassList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]StorageClass),必需
items 是 StorageClass 的列表。
get
读取指定的 StorageClassGET /apis/storage.k8s.io/v1/storageclasses/{name}
name (路径参数): string,必需
StorageClass 的名称
pretty (查询参数): string
200 (StorageClass): OK
401: Unauthorized
list
列出或观测类别为 StorageClass 的对象GET /apis/storage.k8s.io/v1/storageclasses
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (StorageClassList): OK
401: Unauthorized
create
创建 StorageClassPOST /apis/storage.k8s.io/v1/storageclasses
body: StorageClass,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (StorageClass): OK
201 (StorageClass): Created
202 (StorageClass): Accepted
401: Unauthorized
update
替换指定的 StorageClassPUT /apis/storage.k8s.io/v1/storageclasses/{name}
name (路径参数): string,必需
StorageClass 的名称
body: StorageClass,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (StorageClass): OK
201 (StorageClass): Created
401: Unauthorized
patch
部分更新指定的 StorageClassPATCH /apis/storage.k8s.io/v1/storageclasses/{name}
name (路径参数): string,必需
StorageClass 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (StorageClass): OK
201 (StorageClass): Created
401: Unauthorized
delete
删除 StorageClassDELETE /apis/storage.k8s.io/v1/storageclasses/{name}
name (路径参数): string,必需
StorageClass 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (StorageClass): OK
202 (StorageClass): Accepted
401: Unauthorized
deletecollection
删除 StorageClass 的集合DELETE /apis/storage.k8s.io/v1/storageclasses
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
VolumeAttachment 抓取将指定卷挂接到指定节点或从指定节点解除挂接指定卷的意图。
VolumeAttachment 对象未划分命名空间。
metadata (ObjectMeta) 标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (VolumeAttachmentSpec),必需 期望的挂接/解除挂接卷行为的规约。由 Kubernetes 系统填充。
VolumeAttachmentSpec 是 VolumeAttachment 请求的规约。
attacher (string),必需 attacher 表示必须处理此请求的卷驱动的名称。这是由 GetPluginName() 返回的名称。
nodeName (string),必需 卷应挂接到的节点。
source (VolumeAttachmentSource),必需 source 表示应挂接的卷。
VolumeAttachmentSource 表示应挂接的卷。现在只能通过外部挂接器挂接 PersistenVolume, 将来我们可能还允许 Pod 中的内联卷。只能设置一个成员。
source.inlineVolumeSpec (PersistentVolumeSpec)
inlineVolumeSpec 包含挂接由 Pod 的内联 VolumeSource 定义的持久卷时所有必需的信息。 仅为 CSIMigation 功能填充此字段。 它包含从 Pod 的内联 VolumeSource 转换为 PersistentVolumeSpec 的字段。 此字段处于 beta 阶段,且只有启用 CSIMigration 功能的服务器才能使用此字段。
source.persistentVolumeName (string) 要挂接的持久卷的名称。
VolumeAttachmentStatus 是 VolumeAttachment 请求的状态。
attachError (VolumeError) 挂接操作期间遇到的最后一个错误,如果有。 此字段只能由完成挂接操作的实体(例如外部挂接器)进行设置。
detachError (VolumeError) 解除挂接操作期间遇到的最后一个错误,如果有。 此字段只能由完成解除挂接操作的实体(例如外部挂接器)进行设置。
VolumeAttachmentList 是 VolumeAttachment 对象的集合。
metadata (ListMeta) 标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]VolumeAttachment),必需 items 是 VolumeAttachment 的列表。
get
读取指定的 VolumeAttachmentGET /apis/storage.k8s.io/v1/volumeattachments/{name}
name (路径参数): string,必需 VolumeAttachment 的名称
pretty (查询参数): string pretty
200 (VolumeAttachment): OK
401: Unauthorized
get
读取指定的 VolumeAttachment 的状态GET /apis/storage.k8s.io/v1/volumeattachments/{name}/status
name (路径参数): string,必需 VolumeAttachment 的名称
pretty (查询参数): string pretty
200 (VolumeAttachment): OK
401: Unauthorized
list
列出或观测类别为 VolumeAttachment 的对象GET /apis/storage.k8s.io/v1/volumeattachments
allowWatchBookmarks (查询参数): boolean allowWatchBookmarks
continue (查询参数): string continue
fieldSelector (查询参数): string fieldSelector
labelSelector (查询参数): string labelSelector
limit (查询参数): integer limit
pretty (查询参数): string pretty
resourceVersion (查询参数): string resourceVersion
resourceVersionMatch (查询参数): string resourceVersionMatch
timeoutSeconds (查询参数): integer timeoutSeconds
watch (查询参数): boolean watch
200 (VolumeAttachmentList): OK
401: Unauthorized
create
创建 VolumeAttachmentPOST /apis/storage.k8s.io/v1/volumeattachments
body: VolumeAttachment,必需
dryRun (查询参数): string dryRun
fieldManager (查询参数): string fieldManager
fieldValidation (查询参数): string fieldValidation
pretty (查询参数): string pretty
200 (VolumeAttachment): OK
201 (VolumeAttachment): Created
202 (VolumeAttachment): Accepted
401: Unauthorized
update
替换指定的 VolumeAttachmentPUT /apis/storage.k8s.io/v1/volumeattachments/{name}
name (路径参数): string,必需 VolumeAttachment 的名称
body: VolumeAttachment,必需
dryRun (查询参数): string dryRun
fieldManager (查询参数): string fieldManager
fieldValidation (查询参数): string fieldValidation
pretty (查询参数): string pretty
200 (VolumeAttachment): OK
201 (VolumeAttachment): Created
401: Unauthorized
update
替换指定的 VolumeAttachment 的状态PUT /apis/storage.k8s.io/v1/volumeattachments/{name}/status
name (路径参数): string,必需 VolumeAttachment 的名称
body: VolumeAttachment,必需
dryRun (查询参数): string dryRun
fieldManager (查询参数): string fieldManager
fieldValidation (查询参数): string fieldValidation
pretty (查询参数): string pretty
200 (VolumeAttachment): OK
201 (VolumeAttachment): Created
401: Unauthorized
patch
部分更新指定的 VolumeAttachmentPATCH /apis/storage.k8s.io/v1/volumeattachments/{name}
name (路径参数): string,必需 VolumeAttachment 的名称
body: Patch,必需
dryRun (查询参数): string dryRun
fieldManager (查询参数): string fieldManager
fieldValidation (查询参数): string fieldValidation
force (查询参数): boolean force
pretty (查询参数): string pretty
200 (VolumeAttachment): OK
201 (VolumeAttachment): Created
401: Unauthorized
patch
部分更新指定的 VolumeAttachment 的状态PATCH /apis/storage.k8s.io/v1/volumeattachments/{name}/status
name (路径参数): string,必需 VolumeAttachment 的名称
body: Patch,必需
dryRun (查询参数): string dryRun
fieldManager (查询参数): string fieldManager
fieldValidation (查询参数): string fieldValidation
force (查询参数): boolean force
pretty (查询参数): string pretty
200 (VolumeAttachment): OK
201 (VolumeAttachment): Created
401: Unauthorized
delete
删除 VolumeAttachmentDELETE /apis/storage.k8s.io/v1/volumeattachments/{name}
name (路径参数): string,必需 VolumeAttachment 的名称
body: DeleteOptions
dryRun (查询参数): string dryRun
gracePeriodSeconds (查询参数): integer gracePeriodSeconds
pretty (查询参数): string pretty
propagationPolicy (查询参数): string propagationPolicy
200 (VolumeAttachment): OK
202 (VolumeAttachment): Accepted
401: Unauthorized
deletecollection
删除 VolumeAttachment 的集合DELETE /apis/storage.k8s.io/v1/volumeattachments
body: DeleteOptions
continue (查询参数): string continue
dryRun (查询参数): string dryRun
fieldSelector (查询参数): string fieldSelector
gracePeriodSeconds (查询参数): integer gracePeriodSeconds
labelSelector (查询参数): string labelSelector
limit (查询参数): integer limit
pretty (查询参数): string pretty
propagationPolicy (查询参数): string propagationPolicy
resourceVersion (查询参数): string resourceVersion
resourceVersionMatch (查询参数): string resourceVersionMatch
timeoutSeconds (查询参数): integer timeoutSeconds
200 (Status): OK
401: Unauthorized
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
CSIDriver 抓取集群上部署的容器存储接口(CSI)卷驱动有关的信息。 Kubernetes 挂接/解除挂接控制器使用此对象来决定是否需要挂接。 Kubelet 使用此对象决定挂载时是否需要传递 Pod 信息。 CSIDriver 对象未划分命名空间。
apiVersion: storage.k8s.io/v1
kind: CSIDriver
metadata (ObjectMeta)
标准的对象元数据。
metadata.name
表示此对象引用的 CSI 驱动的名称;
它必须与该驱动的 CSI GetPluginName() 调用返回的名称相同。
驱动名称不得超过 63 个字符,以字母、数字([a-z0-9A-Z])开头和结尾,
中间可包含短划线(-)、英文句点(.)、字母和数字。
更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (CSIDriverSpec),必需
CSI 驱动的规约。
CSIDriverSpec 是 CSIDriver 的规约。
attachRequired (boolean)
attachRequired 表示这个 CSI 卷驱动需要挂接操作 (因为它实现了 CSI ControllerPublishVolume() 方法), Kubernetes 挂接/解除挂接控制器应调用挂接卷接口, 以检查卷挂接(volumeattachment)状态并在继续挂载之前等待卷被挂接。 CSI 外部挂接器与 CSI 卷驱动配合使用,并在挂接操作完成时更新 volumeattachment 状态。 如果 CSIDriverRegistry 特性门控被启用且此值指定为 false,将跳过挂接操作。 否则将调用挂接操作。
此字段不可变更。
fsGroupPolicy (string)
定义底层卷是否支持在挂载之前更改卷的所有权和权限。 有关更多详细信息,请参考特定的 FSGroupPolicy 值。
此字段不可变更。
默认为 ReadWriteOnceWithFSType,这会检查每个卷,以决定 Kubernetes 是否应修改卷的所有权和权限。 采用默认策略时,如果定义了 fstype 且卷的访问模式包含 ReadWriteOnce,将仅应用定义的 fsGroup。
podInfoOnMount (boolean)
如果设为 true,则 podInfoOnMount 表示在挂载操作期间这个 CSI 卷需要更多的 Pod 信息(例如 podName 和 podUID 等)。 如果设为 false,则挂载时将不传递 Pod 信息。 默认为 false。 CSI 驱动将 podInfoOnMount 指定为驱动部署的一部分。 如果为 true,Kubelet 将在 CSI NodePublishVolume() 调用中作为 VolumeContext 传递 Pod 信息。 CSI 驱动负责解析和校验作为 VolumeContext 传递进来的信息。 如果 podInfoOnMount 设为 true,将传递以下 VolumeConext。 此列表可能变大,但将使用前缀。
“csi.storage.k8s.io/ephemeral” 是 Kubernetes 1.16 中一个新的功能特性。 只有同时支持 “Persistent” 和 “Ephemeral” VolumeLifecycleMode 的驱动,此字段才是必需的。 其他驱动可以保持禁用 Pod 信息或忽略此字段。 由于 Kubernetes 1.15 不支持此字段,所以在这类集群上部署驱动时,只能支持一种模式。 该部署就决定了是哪种模式,例如通过驱动的命令行参数。
此字段不可变更。
requiresRepublish (boolean)
requiresRepublish 表示 CSI 驱动想要 NodePublishVolume
被周期性地调用,
以反映已挂载卷中的任何可能的变化。
此字段默认为 false。
注:成功完成对 NodePublishVolume 的初始调用后,对 NodePublishVolume 的后续调用只应更新卷的内容。 新的挂载点将不会被运行的容器察觉。
storageCapacity (boolean)
如果设为 true,则 storageCapacity 表示 CSI 卷驱动希望 Pod 调度时考虑存储容量, 驱动部署将通过创建包含容量信息的 CSIStorageCapacity 对象来报告该存储容量。
部署驱动时可以立即启用这个检查。 这种情况下,只有此驱动部署已发布某些合适的 CSIStorageCapacity 对象, 才会继续制备新的卷,然后进行绑定。
换言之,可以在未设置此字段或此字段为 false 的情况下部署驱动, 并且可以在发布存储容量信息后再修改此字段。
此字段在 Kubernetes 1.22 及更早版本中不可变更,但现在可以变更。
tokenRequests ([]TokenRequest)
原子性:将在合并期间被替换
tokenRequests 表示 CSI 驱动需要供挂载卷所用的 Pod 的服务帐户令牌,进行必要的鉴权。 Kubelet 将在 CSI NodePublishVolume 调用中传递 VolumeContext 中的令牌。 CSI 驱动应解析和校验以下 VolumeContext:
"csi.storage.k8s.io/serviceAccount.tokens": {
"<audience>": {
"token": <token>,
"expirationTimestamp": <expiration timestamp in RFC3339>,
},
...
}
注:每个 tokenRequest 中的受众应该不同,且最多有一个令牌是空字符串。 要在令牌过期后接收一个新的令牌,requiresRepublish 可用于周期性地触发 NodePublishVolume。
tokenRequests.audience (string),必需
audience 是 “TokenRequestSpec” 中令牌的目标受众。 它默认为 kube apiserver 的受众。
tokenRequests.expirationSeconds (int64)
expirationSeconds 是 “TokenRequestSpec” 中令牌的有效期。 它具有与 “TokenRequestSpec” 中 “expirationSeconds” 相同的默认值。
volumeLifecycleModes ([]string)
集合:唯一值将在合并期间被保留
volumeLifecycleModes 定义这个 CSI 卷驱动支持哪种类别的卷。 如果列表为空,则默认值为 “Persistent”,这是 CSI 规范定义的用法, 并通过常用的 PV/PVC 机制在 Kubernetes 中实现。 另一种模式是 “Ephemeral”。 在这种模式下,在 Pod 规约中用 CSIVolumeSource 以内联方式定义卷,其生命周期与该 Pod 的生命周期相关联。 驱动必须感知到这一点,因为只有针对这种卷才会接收到 NodePublishVolume 调用。 有关实现此模式的更多信息,请参阅 https://kubernetes-csi.github.io/docs/ephemeral-local-volumes.html。 驱动可以支持其中一种或多种模式,将来可能会添加更多模式。 此字段处于 beta 阶段。
此字段不可变更。
CSIDriverList 是 CSIDriver 对象的集合。
apiVersion: storage.k8s.io/v1
kind: CSIDriverList
metadata (ListMeta)
标准的列表元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]CSIDriver),必需
items 是 CSIDriver 的列表。
get
读取指定的 CSIDriverGET /apis/storage.k8s.io/v1/csidrivers/{name}
name (路径参数): string,必需
CSIDriver 的名称
pretty (查询参数): string
200 (CSIDriver): OK
401: Unauthorized
list
列出或观测类别为 CSIDriver 的对象GET /apis/storage.k8s.io/v1/csidrivers
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (CSIDriverList): OK
401: Unauthorized
create
创建 CSIDriverPOST /apis/storage.k8s.io/v1/csidrivers
body: CSIDriver,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CSIDriver): OK
201 (CSIDriver): Created
202 (CSIDriver): Accepted
401: Unauthorized
update
替换指定的 CSIDriverPUT /apis/storage.k8s.io/v1/csidrivers/{name}
name (路径参数): string,必需
CSIDriver 的名称
body: CSIDriver,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CSIDriver): OK
201 (CSIDriver): Created
401: Unauthorized
patch
部分更新指定的 CSIDriverPATCH /apis/storage.k8s.io/v1/csidrivers/{name}
name (路径参数): string,必需
CSIDriver 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (CSIDriver): OK
201 (CSIDriver): Created
401: Unauthorized
delete
删除 CSIDriverDELETE /apis/storage.k8s.io/v1/csidrivers/{name}
name (路径参数): string,必需
CSIDriver 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (CSIDriver): OK
202 (CSIDriver): Accepted
401: Unauthorized
deletecollection
删除 CSIDriver 的集合DELETE /apis/storage.k8s.io/v1/csidrivers
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
CSINode 包含节点上安装的所有 CSI 驱动有关的信息。CSI 驱动不需要直接创建 CSINode 对象。 只要这些驱动使用 node-driver-registrar 边车容器,kubelet 就会自动为 CSI 驱动填充 CSINode 对象, 作为 kubelet 插件注册操作的一部分。CSINode 的名称与节点名称相同。 如果不存在此对象,则说明该节点上没有可用的 CSI 驱动或 Kubelet 版本太低无法创建该对象。 CSINode 包含指向相应节点对象的 OwnerReference。
apiVersion: storage.k8s.io/v1
kind: CSINode
metadata (ObjectMeta)
metadata.name 必须是 Kubernetes 节点的名称。
spec (CSINodeSpec),必需
spec 是 CSINode 的规约。
CSINodeSpec 包含一个节点上安装的所有 CSI 驱动规约有关的信息。
drivers ([]CSINodeDriver),必需
补丁策略:按照键 name
合并
drivers 是节点上存在的所有 CSI 驱动的信息列表。如果列表中的所有驱动均被卸载,则此字段可以为空。
CSINodeDriver 包含一个节点上安装的一个 CSI 驱动规约有关的信息。
drivers.name (string),必需
这是该对象引用的 CSI 驱动的名称。此字段值必须是针对该驱动由 CSI GetPluginName() 调用返回的相同名称。
drivers.nodeID (string),必需
从驱动角度来看,这是节点的 nodeID。 对于未与节点共享相同命名法的存储系统,此字段使得 Kubernetes 能够与之进行通信。 例如,Kubernetes 可能将给定节点视为 "node1",但存储系统可以将同一节点视为 "nodeA"。 当 Kubernetes 向存储系统发出一条命令将一个卷挂接到特定的节点时, 它可以藉此字段使用存储系统所理解的 ID 引用节点名称,例如使用 “nodeA” 而不是 “node1”。 此字段是必需的。
drivers.allocatable (VolumeNodeResources)
allocatable 表示一个节点上可供调度的卷资源。此字段处于 beta 阶段。
VolumeNodeResources 是调度卷时所用的一组资源限制。
drivers.allocatable.count (int32)
这是一个节点上可使用的、由 CSI 驱动管理的独立卷个数的上限。 挂接并挂载到一个节点上的卷被视为被使用一次,不是两次。 相同的规则适用于同一个节点上多个 Pod 之间共享的同一个卷。 如果未指定此字段,则该节点上支持的卷数量是无限的。
drivers.topologyKeys ([]string)
topologyKeys 是驱动支持的键的列表。 在集群上初始化一个驱动时,该驱动将提供一组自己理解的拓扑键 (例如 “company.com/zone”、“company.com/region”)。 在一个节点上初始化一个驱动时,该驱动将提供相同的拓扑键和值。 Kubelet 将在其自己的节点对象上将这些拓扑键暴露为标签。 当 Kubernetes 进行拓扑感知的制备时,可以使用此列表决定应从节点对象中检索哪些标签并传回驱动。 不同的节点可以使用不同的拓扑键。 如果驱动不支持拓扑,则此字段可以为空。
CSINodeList 是 CSINode 对象的集合。
apiVersion: storage.k8s.io/v1
kind: CSINodeList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]CSINode),必需
items 是 CSINode 的列表。
get
读取指定的 CSINodeGET /apis/storage.k8s.io/v1/csinodes/{name}
name (路径参数): string,必需
CSINode 的名称
pretty (查询参数): string
200 (CSINode): OK
401: Unauthorized
list
列出或观测类别为 CSINode 的对象GET /apis/storage.k8s.io/v1/csinodes
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (CSINodeList): OK
401: Unauthorized
create
创建 CSINodePOST /apis/storage.k8s.io/v1/csinodes
body: CSINode,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CSINode): OK
201 (CSINode): Created
202 (CSINode): Accepted
401: Unauthorized
update
替换指定的 CSINodePUT /apis/storage.k8s.io/v1/csinodes/{name}
name (路径参数): string,必需
CSINode 的名称
body: CSINode,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CSINode): OK
201 (CSINode): Created
401: Unauthorized
patch
部分更新指定的 CSINodePATCH /apis/storage.k8s.io/v1/csinodes/{name}
name (路径参数): string,必需
CSINode 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (CSINode): OK
201 (CSINode): Created
401: Unauthorized
delete
删除 CSINodeDELETE /apis/storage.k8s.io/v1/csinodes/{name}
name (路径参数): string,必需
CSINode 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (CSINode): OK
202 (CSINode): Accepted
401: Unauthorized
deletecollection
删除 CSINode 的集合DELETE /apis/storage.k8s.io/v1/csinodes
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: storage.k8s.io/v1
import "k8s.io/api/storage/v1"
CSIStorageCapacity 存储一个 CSI GetCapacity 调用的结果。 对于给定的 StorageClass,此结构描述了特定拓扑段中可用的容量。 当考虑在哪里实例化新的 PersistentVolume 时可以使用此项。
例如,此结构可以描述如下内容:
以下三种情况均暗示了某些组合没有可用的容量:
这些对象的制作方可以决定哪种方法更合适。
当 CSI 驱动选择使用 CSIDriverSpec.StorageCapacity 进行容量感知调度时,kube-scheduler 会使用这些对象。 该调度器将 MaximumVolumeSize 与 pending 卷的请求大小进行比较,以过滤掉不合适的节点。 如果未设置 MaximumVolumeSize,则回退为与不太精确的容量(Capacity)进行比较。 如果还是未设置,则该调度器假定容量不足并尝试某些其他节点。
apiVersion: storage.k8s.io/v1
kind: CSIStorageCapacity
metadata (ObjectMeta)
标准的对象元数据。 此名称没有特定的含义。 它必须是 DNS 子域名(允许英文句点,最多 253 个字符)。 为了确保与集群上的其他 CSI 驱动没有冲突,建议使用一个生成的名称 csisc-<uuid>, 或使用以唯一 CSI 驱动名称结尾的反向域名。
这些对象是有命名空间的。
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
storageClassName (string),必需
这是已报告容量所应用到的 StorageClass 的名称。 它必须满足与 StorageClass 对象名称相同的要求(非空,DNS 子域名)。 如果该对象不再存在,则 CSIStorageCapacity 对象将被废弃且应由创建者移除。 此字段不可变更。
capacity (Quantity)
capacity 是 CSI 驱动在其 GetCapacityResponse 中为 GetCapacityRequest 报告的值,其拓扑和参数与之前的字段匹配。
该语义目前(CSI 规范 1.2)定义为:可用于制备卷的可用存储容量(单位为字节)。 如果未设置,则该信息目前不可用。
maximumVolumeSize (Quantity)
maximumVolumeSize 是 CSI 驱动在其 GetCapacityResponse 中为 GetCapacityRequest 报告的值,其拓扑和参数与之前的字段匹配。
自从 CSI 规范 1.4.0 起,这定义为 CreateVolumeRequest.capacity_range.required_bytes
字段中可以使用的最大值,
以便用 GetCapacityRequest 中相同的参数创建一个卷。
Kubernetes API 中的相应值是卷声明中的 ResourceRequirements.Requests。
nodeTopology (LabelSelector)
nodeTopology 定义了哪些节点有权访问已报告容量的存储。 如果未设置,则不能从集群中的任意节点访问此存储。 如果留空,则可以从所有节点访问此存储。此字段不可变更。
CSIStorageCapacityList 是 CSIStorageCapacity 对象的集合。
apiVersion: storage.k8s.io/v1
kind: CSIStorageCapacityList
metadata (ListMeta)
标准的列表元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]CSIStorageCapacity),必需
映射:有关键名称的唯一值将在合并期间被保留
items 是 CSIStorageCapacity 对象的列表。
get
读取指定的 CSIStorageCapacityGET /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
name (路径参数): string,必需
CSIStorageCapacity 的名称
namespace (路径参数): string,必需
pretty (查询参数): string
200 (CSIStorageCapacity): OK
401: Unauthorized
list
列出或观测类别为 CSIStorageCapacity 的对象GET /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (CSIStorageCapacityList): OK
401: Unauthorized
list
列出或观测类别为 CSIStorageCapacity 的对象GET /apis/storage.k8s.io/v1/csistoragecapacities
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (CSIStorageCapacityList): OK
401: Unauthorized
create
创建 CSIStorageCapacityPOST /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
namespace (路径参数): string,必需
body: CSIStorageCapacity,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CSIStorageCapacity): OK
201 (CSIStorageCapacity): Created
202 (CSIStorageCapacity): Accepted
401: Unauthorized
update
替换指定的 CSIStorageCapacityPUT /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
name (路径参数): string,必需
CSIStorageCapacity 的名称
namespace (路径参数): string,必需
body: CSIStorageCapacity,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CSIStorageCapacity): OK
201 (CSIStorageCapacity): Created
401: Unauthorized
patch
部分更新指定的 CSIStorageCapacityPATCH /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
name (路径参数): string,必需
CSIStorageCapacity 的名称
namespace (路径参数): string,必需
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (CSIStorageCapacity): OK
201 (CSIStorageCapacity): Created
401: Unauthorized
delete
删除 CSIStorageCapacityDELETE /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities/{name}
name (路径参数): string,必需
CSIStorageCapacity 的名称
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 CSIStorageCapacity 的集合DELETE /apis/storage.k8s.io/v1/namespaces/{namespace}/csistoragecapacities
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
ServiceAccount 将以下内容绑定在一起:
apiVersion: v1
kind: ServiceAccount
metadata (ObjectMeta)
标准对象的元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
automountServiceAccountToken (boolean)
AutomountServiceAccountToken 指示作为此服务帐户运行的 pod 是否应自动挂载 API 令牌, 可以在 pod 级别覆盖。
imagePullSecrets ([]LocalObjectReference)
imagePullSecrets 是对同一命名空间中 Secret 的引用列表,用于拉取引用此 ServiceAccount 的 Pod 中的任何镜像。 imagePullSecrets 与 Secrets 不同,因为 Secrets 可以挂载在 Pod 中,但 imagePullSecrets 只能由 kubelet 访问。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/containers/images/#specifying-imagepullsecrets-on-a-pod
secrets ([]ObjectReference)
补丁策略:基于键 name
合并
Secrets 是允许使用此 ServiceAccount 运行的 pod 使用的同一命名空间中的秘密列表。 仅当此服务帐户的 “kubernetes.io/enforce-mountable-secrets” 注释设置为 “true” 时,Pod 才限于此列表。 此字段不应用于查找自动生成的服务帐户令牌机密以在 pod 之外使用。 相反,可以使用 TokenRequest API 直接请求令牌,或者可以手动创建服务帐户令牌 secret。 更多信息: https://kubernetes.io/docs/concepts/configuration/secret
ServiceAccountList 是 ServiceAccount 对象的列表
apiVersion: v1
kind: ServiceAccountList
metadata (ListMeta)
标准列表元数据, 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]ServiceAccount), 必需
ServiceAccount 列表,更多信息: https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/configure-service-account/
get
读取指定的 ServiceAccountGET /api/v1/namespaces/{namespace}/serviceaccounts/{name}
name (路径参数): string, 必需
ServiceAccount 的名称
namespace (路径参数): string, 必需
pretty (查询参数): string
200 (ServiceAccount): OK
401: Unauthorized
list
列出或监控 ServiceAccount 类型的对象GET /api/v1/namespaces/{namespace}/serviceaccounts
namespace (路径参数): string, 必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ServiceAccountList): OK
401: Unauthorized
list
列出或监控 ServiceAccount 类型的对象GET /api/v1/serviceaccounts
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ServiceAccountList): OK
401: Unauthorized
create
创建一个 ServiceAccountPOST /api/v1/namespaces/{namespace}/serviceaccounts
namespace (路径参数): string, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ServiceAccount): OK
201 (ServiceAccount): Created
202 (ServiceAccount): Accepted
401: Unauthorized
update
替换指定的ServiceAccount
PUT /api/v1/namespaces/{namespace}/serviceaccounts/{name}
name (路径参数): string, required
name of the ServiceAccount
namespace (路径参数): string, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ServiceAccount): OK
201 (ServiceAccount): Created
401: Unauthorized
patch
部分更新指定的 ServiceAccount
PATCH /api/v1/namespaces/{namespace}/serviceaccounts/{name}
name (路径参数): string, 必需
ServiceAccount 的名称
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (ServiceAccount): OK
201 (ServiceAccount): Created
401: Unauthorized
delete
删除一个 ServiceAccountDELETE /api/v1/namespaces/{namespace}/serviceaccounts/{name}
name (路径参数): string, 必需
ServiceAccount 的名称
namespace (路径参数): string, 必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (in query): string
200 (ServiceAccount): OK
202 (ServiceAccount): Accepted
401: Unauthorized
deletecollection
删除 ServiceAccount 的集合DELETE /api/v1/namespaces/{namespace}/serviceaccounts
namespace (路径参数): string, 必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: authentication.k8s.io/v1
import "k8s.io/api/authentication/v1"
TokenRequest 为给定的服务账号请求一个令牌。
apiVersion: authentication.k8s.io/v1
kind: TokenRequest
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (TokenRequestSpec),必需
spec 包含与正被评估的请求相关的信息。
status (TokenRequestStatus)
status 由服务器填充,表示该令牌是否可用于身份认证。
TokenRequestSpec 包含客户端提供的令牌请求参数。
audiences ([]string),必需
audiences 是令牌预期的受众。 令牌的接收方必须在令牌的受众列表中用一个标识符来标识自己,否则应拒绝该令牌。 为多个受众签发的令牌可用于认证所列举的任意受众的身份,但这意味着目标受众彼此之间的信任程度较高。
boundObjectRef (BoundObjectReference)
boundObjectRef 是对令牌所绑定的一个对象的引用。该令牌只有在绑定对象存在时才有效。 注:API 服务器的 TokenReview 端点将校验 boundObjectRef,但其他受众可能不用这样。 如果你想要快速撤销,请为 expirationSeconds 设一个较小的值。
BoundObjectReference 是对令牌所绑定的一个对象的引用。
引用对象的 API 版本。
boundObjectRef.kind (string)
引用对象的类别。有效的类别为 “Pod” 和 “Secret”。
boundObjectRef.name (string)
引用对象的名称。
boundObjectRef.uid (string) 引用对象的 UID。
expirationSeconds (int64)
expirationSeconds 是请求生效的持续时间。 令牌签发方可能返回一个生效期不同的令牌,因此客户端需要检查响应中的 “expiration” 字段。
TokenRequestStatus 是一个令牌请求的结果。
expirationTimestamp (Time),必需
expirationTimestamp 是已返回令牌的到期时间。
Time 是 time.Time 的包装器,支持正确编组为 YAML 和 JSON。为 time 包提供的许多工厂方法提供了包装器。
token (string),必需
token 是不透明的持有者令牌(Bearer Token)。
create
创建 ServiceAccount 的令牌POST /api/v1/namespaces/{namespace}/serviceaccounts/{name}/token
name (路径参数): string,必需
TokenRequest 的名称
namespace (路径参数): string,必需
body: TokenRequest,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (TokenRequest): OK
201 (TokenRequest): Created
202 (TokenRequest): Accepted
401: Unauthorized
apiVersion: authentication.k8s.io/v1
import "k8s.io/api/authentication/v1"
TokenReview 尝试通过验证令牌来确认已知用户。 注意:TokenReview 请求可能会被 kube-apiserver 中的 webhook 令牌验证器插件缓存。
apiVersion: authentication.k8s.io/v1
kind: TokenReview
metadata (ObjectMeta)
标准对象的元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (TokenReviewSpec), required
spec 保存有关正在评估的请求的信息
status (TokenReviewStatus)
status 由服务器填写,指示请求是否可以通过身份验证。
TokenReviewPec 是对令牌身份验证请求的描述。
audiences ([]string)
audiences 是带有令牌的资源服务器标识为受众的标识符列表。 受众感知令牌身份验证器将验证令牌是否适用于此列表中的至少一个受众。 如果未提供受众,受众将默认为 Kubernetes API 服务器的受众。
token (string)
token 是不透明的持有者令牌(Bearer Token)。
TokenReviewStatus 是令牌认证请求的结果。
audiences ([]string)
audiences 是身份验证者选择的与 TokenReview 和令牌兼容的受众标识符。标识符是 TokenReviewSpec 受众和令牌受众的交集中的任何标识符。设置 spec.audiences 字段的 TokenReview API 的客户端应验证在 status.audiences 字段中返回了兼容的受众标识符, 以确保 TokenReview 服务器能够识别受众。如果 TokenReview 返回一个空的 status.audience 字段,其中 status.authenticated 为 “true”, 则该令牌对 Kubernetes API 服务器的受众有效。
authenticated (boolean)
authenticated 表示令牌与已知用户相关联。
error (string)
error 表示无法检查令牌
user (UserInfo)
user 是与提供的令牌关联的 UserInfo。
<-- UserInfo holds the information about the user needed to implement the user.Info interface. --> UserInfo 保存实现 user.Info 接口所需的用户信息
user.extra (map[string][]string)
验证者提供的任何附加信息。
user.groups ([]string)
此用户所属的组的名称。
user.uid (string)
跨时间标识此用户的唯一值。如果删除此用户并添加另一个同名用户,他们将拥有不同的 UID。
user.username (string)
在所有活动用户中唯一标识此用户的名称。
create
创建一个TokenReviewPOST /apis/authentication.k8s.io/v1/tokenreviews
body: TokenReview, 必需
dryRun (in query): string
fieldManager (in query): string
fieldValidation (in query): string
pretty (in query): string
200 (TokenReview): OK
201 (TokenReview): Created
202 (TokenReview): Accepted
401: Unauthorized
apiVersion: certificates.k8s.io/v1
import "k8s.io/api/certificates/v1"
CertificateSigningRequest 对象提供了一种通过提交证书签名请求并异步批准和颁发 x509 证书的机制。
Kubelets 使用 CertificateSigningRequest API 来获取:
此 API 可用于请求客户端证书以向 kube-apiserver 进行身份验证(使用 “kubernetes.io/kube-apiserver-client” 签名者名称), 或从自定义非 Kubernetes 签名者那里获取证书。
apiVersion: certificates.k8s.io/v1
kind: CertificateSigningRequest
metadata (ObjectMeta)
spec ( CertificateSigningRequestSpec),必需
spec 包含证书请求,并且在创建后是不可变的。 只有 request、signerName、expirationSeconds 和 usages 字段可以在创建时设置。 其他字段由 Kubernetes 派生,用户无法修改。
status ( CertificateSigningRequestStatus)
status 包含有关请求是被批准还是拒绝的信息,以及签名者颁发的证书或指示签名者失败的状况。
CertificateSigningRequestSpec 包含证书请求。
signerName (string),必需
signerName 表示请求的签名者,是一个限定名。
CertificateSigningRequests 的 list/watch 请求可以使用 “spec.signerName=NAME” 字段选择器进行过滤。
众所周知的 Kubernetes 签名者有:
也可以指定自定义 signerName。签名者定义如下:
expirationSeconds (int32)
expirationSeconds 是所颁发证书的所请求的有效期。 证书签署者可以颁发具有不同有效期的证书, 因此客户端必须检查颁发证书中 notBefore 和 notAfter 字段之间的增量以确定实际持续时间。
众所周知的 Kubernetes 签名者在 v1.22+ 版本内实现将遵守此字段, 只要请求的持续时间不大于最大持续时间,它们将遵守 Kubernetes 控制管理器的 --cluster-signing-duration CLI 标志。
由于各种原因,证书签名者可能忽略此字段:
expirationSeconds 的最小有效值为 600,即 10 分钟。
extra (map[string][]string)
extra 包含创建 CertificateSigningRequest 的用户的额外属性。 在创建时由 API 服务器填充,且不可变。
groups ([]string)
Atomic:将在合并过程中被替换
groups 包含创建 CertificateSigningRequest 的用户的组成员关系。 在创建时由 API 服务器填充,且不可变。
uid (string)
uid 包含创建 CertificateSigningRequest 的用户的 uid 。 在创建时由 API 服务器填充,且不可变。
usages ([]string)
Atomic:将在合并期间被替换
usages 指定颁发证书中请求的一组密钥用途。
TLS 客户端证书的请求通常要求:"digital signature"、"key encipherment"、"client auth"。
TLS 服务证书的请求通常要求:"key encipherment"、"digital signature"、"server auth"。
有效值: "signing"、"digital signature"、"content commitment"、 "key encipherment"、"key agreement"、"data encipherment"、 "cert sign"、"crl sign"、"encipher only"、"decipher only"、"any"、 "server auth"、"client auth"、 "code signing"、"email protection"、"s/mime"、 "ipsec end system"、"ipsec tunnel"、"ipsec user"、 "timestamping"、"ocsp signing"、"microsoft sgc"、"netscape sgc"。
username (string)
username 包含创建 CertificateSigningRequest 的用户名。 在创建时由 API 服务器填充,且不可变。
CertificateSigningRequestStatus 包含用于指示请求的批准/拒绝/失败状态和颁发证书的状况。
certificate ([]byte)
Atomic:将在合并期间被替换
certificate 在出现 Approved 状况后,由签名者使用已颁发的证书填充。 这个字段通过 /status 子资源设置。填充后,该字段将不可变。
如果证书签名请求被拒绝,则添加类型为 “Denied” 的状况,并且保持该字段为空。 如果签名者不能颁发证书,则添加类型为 “Failed” 的状况,并且保持该字段为空。
验证要求:
如果存在多个 PEM 块,并且所请求的 spec.signerName 的定义没有另外说明, 那么第一个块是颁发的证书,后续的块应该被视为中间证书并在 TLS 握手中呈现。
证书编码为 PEM 格式。
当序列化为 JSON 或 YAML 时,数据额外采用 base64 编码,它包括:
base64(
-----BEGIN CERTIFICATE-----
...
-----END CERTIFICATE-----
)
conditions ([]CertificateSigningRequestCondition)
Map:键类型的唯一值将在合并期间保留
应用于请求的状况。已知的状况有 "Approved"、"Denied" 与 "Failed"。
CertificateSigningRequestCondition 描述 CertificateSigningRequest 对象的状况。
状况的状态,True、False、Unknown 之一。Approved、Denied 与 Failed 的状况不可以是 "False" 或 "Unknown"。
状况的类型。已知的状况是 "Approved"、"Denied" 与 "Failed"。
通过 /approval 子资源添加 “Approved” 状况,表示请求已被批准并且应由签名者颁发。
通过 /approval 子资源添加 “Denied” 状况,指示请求被拒绝并且不应由签名者颁发。
通过 /status 子资源添加 “Failed” 状况,表示签名者未能颁发证书。
Approved 和 Denied 状况是相互排斥的。Approved、Denied 和 Failed 状况一旦添加就无法删除。
给定类型只允许设置一种状况。
conditions.lastTransitionTime (Time)
lastTransitionTime 是状况上一次从一种状态转换到另一种状态的时间。 如果未设置,当添加新状况类型或更改现有状况的状态时,服务器默认为当前时间。
Time 是 time.Time 的包装器,支持正确编码为 YAML 和 JSON。为 time 包提供的许多工厂方法提供了包装器。
lastUpdateTime 是该状况最后一次更新的时间。
Time 是 time.Time 的包装器,支持正确编组为 YAML 和 JSON。为 time 包提供的许多工厂方法提供了包装器。
message 包含一个人类可读的消息,包含关于请求状态的详细信息。
reason 表示请求状态的简短原因。
CertificateSigningRequestList 是 CertificateSigningRequest 对象的集合。
apiVersion: certificates.k8s.io/v1
kind: CertificateSigningRequestList
metadata (ListMeta)
items ([]CertificateSigningRequest),必需
items 是 CertificateSigningRequest 对象的集合。
get
读取指定的 CertificateSigningRequestGET /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}
name (路径参数): string,必需
CertificateSigningRequest 的名称。
pretty (查询参数): string
200 (CertificateSigningRequest): OK
401: Unauthorized
get
读取指定 CertificateSigningRequest 的批准信息GET /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval
name (路径参数): string,必需
CertificateSigningRequest 的名称。
pretty (查询参数): string
200 (CertificateSigningRequest): OK
401: Unauthorized
get
读取指定 CertificateSigningRequest 的状态GET /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status
name (路径参数): string,必需
CertificateSigningRequest 的名称。
pretty (查询参数): string
200 (CertificateSigningRequest): OK
401: Unauthorized
list
list 或 watch CertificateSigningRequest 类型的对象GET /apis/certificates.k8s.io/v1/certificatesigningrequests
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (CertificateSigningRequestList): OK
401: Unauthorized
create
创建一个 CertificateSigningRequestPOST /apis/certificates.k8s.io/v1/certificatesigningrequests
body: CertificateSigningRequest,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CertificateSigningRequest): OK
201 (CertificateSigningRequest): Created
202 (CertificateSigningRequest): Accepted
401: Unauthorized
update
替换指定的 CertificateSigningRequestPUT /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}
name (路径参数): string,必需
CertificateSigningRequest 的名称。
body: CertificateSigningRequest,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CertificateSigningRequest): OK
201 (CertificateSigningRequest): Created
401: Unauthorized
update
替换对指定 CertificateSigningRequest 的批准信息PUT /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval
name (路径参数): string,必需
CertificateSigningRequest 的名称。
body: CertificateSigningRequest,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CertificateSigningRequest): OK
201 (CertificateSigningRequest): Created
401: Unauthorized
update
替换指定 CertificateSigningRequest 的状态PUT /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status
name (路径参数): string,必需
CertificateSigningRequest 的名称。
body: CertificateSigningRequest,必需
dryRun (in query): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (CertificateSigningRequest): OK
201 (CertificateSigningRequest): Created
401: Unauthorized
patch
部分更新指定的 CertificateSigningRequestPATCH /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}
name (路径参数): string,必需
CertificateSigningRequest 的名称。
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (CertificateSigningRequest): OK
201 (CertificateSigningRequest): Created
401: Unauthorized
patch
部分更新指定 CertificateSigningRequest 的批准信息PATCH /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/approval
name (路径参数): string,必需
CertificateSigningRequest 的名称。
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (CertificateSigningRequest): OK
201 (CertificateSigningRequest): Created
401: Unauthorized
patch
部分更新指定 CertificateSigningRequest 的状态PATCH /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}/status
name (路径参数): string,必需
CertificateSigningRequest 的名称。
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (CertificateSigningRequest): OK
201 (CertificateSigningRequest): Created
401: Unauthorized
delete
删除一个 CertificateSigningRequestDELETE /apis/certificates.k8s.io/v1/certificatesigningrequests/{name}
name (路径参数): string,必需
CertificateSigningRequest 的名称。
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 CertificateSigningRequest 集合DELETE /apis/certificates.k8s.io/v1/certificatesigningrequests
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
LocalSubjectAccessReview 检查用户或组是否可以在给定的命名空间内执行某操作。 划分命名空间范围的资源简化了命名空间范围的策略设置,例如权限检查。
apiVersion: authorization.k8s.io/v1
kind: LocalSubjectAccessReview
metadata (ObjectMeta)
标准的列表元数据。 更多信息:https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (SubjectAccessReviewSpec),必需
spec 包含有关正在评估的请求的信息。 spec.namespace 必须是你的请求所针对的命名空间。 如果留空,则会被设置默认值。
status (SubjectAccessReviewStatus)
status 由服务器填写,表示请求是否被允许。
create
创建 LocalSubjectAccessReviewPOST /apis/authorization.k8s.io/v1/namespaces/{namespace}/localsubjectaccessreviews
namespace (路径参数): string,必需
body: LocalSubjectAccessReview,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (LocalSubjectAccessReview): OK
201 (LocalSubjectAccessReview): Created
202 (LocalSubjectAccessReview): Accepted
401: Unauthorized
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
SelfSubjectAccessReview 检查当前用户是否可以执行某操作。 不填写 spec.namespace 表示 “在所有命名空间中”。 Self 是一个特殊情况,因为用户应始终能够检查自己是否可以执行某操作。
apiVersion: authorization.k8s.io/v1
kind: SelfSubjectAccessReview
metadata (ObjectMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (SelfSubjectAccessReviewSpec),必需
spec 包含有关正在评估的请求的信息。 user 和 group 必须为空。
status (SubjectAccessReviewStatus)
status 由服务器填写,表示请求是否被允许。
SelfSubjectAccessReviewSpec 是访问请求的描述。 resourceAuthorizationAttributes 和 nonResourceAuthorizationAttributes 二者必须设置其一,并且只能设置其一。
nonResourceAttributes (NonResourceAttributes)
nonResourceAttributes 描述非资源访问请求的信息。
nonResourceAttributes 包括提供给 Authorizer 接口进行非资源请求鉴权时所用的属性。
nonResourceAttributes.path (string)
path 是请求的 URL 路径。
nonResourceAttributes.verb (string)
verb 是标准的 HTTP 动作。
resourceAttributes (ResourceAttributes)
resourceAuthorizationAttributes 描述资源访问请求的信息。
resourceAttributes 包括提供给 Authorizer 接口进行资源请求鉴权时所用的属性。
resourceAttributes.group (string)
group 是资源的 API 组。 "*" 表示所有组。
resourceAttributes.name (string)
name 是 "get" 正在请求或 "delete" 已删除的资源的名称。 ""(空字符串)表示所有资源。
resourceAttributes.namespace (string)
namespace 是正在请求的操作的命名空间。 目前,无命名空间和所有命名空间之间没有区别。 对于 LocalSubjectAccessReviews,默认为 ""(空字符串)。 对于集群范围的资源,默认为 ""(空字符串)。 对于来自 SubjectAccessReview 或 SelfSubjectAccessReview 的命名空间范围的资源,""(空字符串)表示 "all"(所有资源)。
resourceAttributes.resource (string)
resource 是现有的资源类别之一。 "*" 表示所有资源类别。
resourceAttributes.subresource (string)
subresource 是现有的资源类型之一。 "" 表示无。
resourceAttributes.verb (string)
verb 是 kubernetes 资源 API 动作,例如 get、list、watch、create、update、delete、proxy。 "*" 表示所有动作。
resourceAttributes.version (string)
version 是资源的 API 版本。 "*" 表示所有版本。
create
创建 SelfSubjectAccessReviewPOST /apis/authorization.k8s.io/v1/selfsubjectaccessreviews
body: SelfSubjectAccessReview,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (SelfSubjectAccessReview): OK
201 (SelfSubjectAccessReview): Created
202 (SelfSubjectAccessReview): Accepted
401: Unauthorized
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
SelfSubjectRulesReview 枚举当前用户可以在某命名空间内执行的操作集合。 返回的操作列表可能不完整,具体取决于服务器的鉴权模式以及评估过程中遇到的任何错误。 SelfSubjectRulesReview 应由 UI 用于显示/隐藏操作,或让最终用户尽快理解自己的权限。 SelfSubjectRulesReview 不得被外部系统使用以驱动鉴权决策, 因为这会引起混淆代理人(Confused deputy)、缓存有效期/吊销(Cache lifetime/revocation)和正确性问题。 SubjectAccessReview 和 LocalAccessReview 是遵从 API 服务器所做鉴权决策的正确方式。
apiVersion: authorization.k8s.io/v1
kind: SelfSubjectRulesReview
metadata (ObjectMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (SelfSubjectRulesReviewSpec),必需
spec 包含有关正在评估的请求的信息。
status (SubjectRulesReviewStatus)
status 由服务器填写,表示用户可以执行的操作的集合。
SubjectRulesReviewStatus 包含规则检查的结果。 此检查可能不完整,具体取决于服务器配置的 Authorizer 的集合以及评估期间遇到的任何错误。 由于鉴权规则是叠加的,所以如果某个规则出现在列表中,即使该列表不完整,也可以安全地假定该主体拥有该权限。
status.incomplete (boolean),必需
当此调用返回的规则不完整时,incomplete 结果为 true。 这种情况常见于 Authorizer(例如外部 Authorizer)不支持规则评估时。
status.nonResourceRules ([]NonResourceRule),必需
nonResourceRules 是允许主体对非资源执行路径执行的操作列表。 该列表顺序不重要,可以包含重复项,还可能不完整。
nonResourceRule 包含描述非资源路径的规则的信息。
status.nonResourceRules.verbs ([]string),必需
verb 是 kubernetes 非资源 API 动作的列表,例如 get、post、put、delete、patch、head、options。
*
表示所有动作。
status.nonResourceRules.nonResourceURLs ([]string)
nonResourceURLs 是用户应有权访问的一组部分 URL。
允许使用 *
,但仅能作为路径中最后一段且必须用于完整的一段。
*
表示全部。
status.resourceRules ([]ResourceRule),必需
resourceRules 是允许主体对资源执行的操作的列表。 该列表顺序不重要,可以包含重复项,还可能不完整。
resourceRule 是允许主体对资源执行的操作的列表。该列表顺序不重要,可以包含重复项,还可能不完整。
status.resourceRules.verbs ([]string),必需
verb 是 kubernetes 资源 API 动作的列表,例如 get、list、watch、create、update、delete、proxy。
*
表示所有动作。
status.resourceRules.apiGroups ([]string)
apiGroups 是包含资源的 APIGroup 的名称。
如果指定了多个 API 组,则允许对任何 API 组中枚举的资源之一请求任何操作。
*
表示所有 APIGroup。
status.resourceRules.resourceNames ([]string)
resourceNames 是此规则所适用的资源名称白名单,可选。
空集合意味着允许所有资源。
*
表示所有资源。
status.resourceRules.resources ([]string)
resources 是此规则所适用的资源的列表。
*
表示指定 APIGroup 中的所有资源。
*/foo
表示指定 APIGroup 中所有资源的子资源 "foo"。
status.evaluationError (string)
evaluationError 可以与 rules 一起出现。 它表示在规则评估期间发生错误,例如 Authorizer 不支持规则评估以及 resourceRules 和/或 nonResourceRules 可能不完整。
SelfSubjectRulesReviewSpec 定义 SelfSubjectRulesReview 的规范。
namespace (string)
namespace 是要评估规则的命名空间。 必需。
create
创建 SelfSubjectRulesReviewPOST /apis/authorization.k8s.io/v1/selfsubjectrulesreviews
body: SelfSubjectRulesReview,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (SelfSubjectRulesReview): OK
201 (SelfSubjectRulesReview): Created
202 (SelfSubjectRulesReview): Accepted
401: Unauthorized
apiVersion: authorization.k8s.io/v1
import "k8s.io/api/authorization/v1"
SubjectAccessReview 检查用户或组是否可以执行某操作。
apiVersion: authorization.k8s.io/v1
kind: SubjectAccessReview
metadata (ObjectMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (SubjectAccessReviewSpec),必需
spec 包含有关正在评估的请求的信息。
status (SubjectAccessReviewStatus)
status 由服务器填写,表示请求是否被允许。
SubjectAccessReviewSpec 是访问请求的描述。 resourceAuthorizationAttributes 和 nonResourceAuthorizationAttributes 二者必须设置其一,并且只能设置其一。
extra (map[string][]string)
extra 对应于来自鉴权器的 user.Info.GetExtra() 方法。 由于这是针对 Authorizer 的输入,所以它需要在此处反映。
groups ([]string)
groups 是你正在测试的组。
nonResourceAttributes (NonResourceAttributes)
nonResourceAttributes 描述非资源访问请求的信息。
nonResourceAttributes 包括提供给 Authorizer 接口进行非资源请求鉴权时所用的属性。
nonResourceAttributes.path (string)
path 是请求的 URL 路径。
nonResourceAttributes.verb (string)
verb 是标准的 HTTP 动作。
resourceAttributes (ResourceAttributes)
resourceAuthorizationAttributes 描述资源访问请求的信息。
resourceAttributes 包括提供给 Authorizer 接口进行资源请求鉴权时所用的属性。
resourceAttributes.group (string)
group 是资源的 API 组。 "*" 表示所有资源。
resourceAttributes.name (string)
name 是 "get" 正在请求或 "delete" 已删除的资源。 ""(空字符串)表示所有资源。
resourceAttributes.namespace (string)
namespace 是正在请求的操作的命名空间。 目前,无命名空间和所有命名空间之间没有区别。 对于 LocalSubjectAccessReviews,默认为 ""(空字符串)。 对于集群范围的资源,默认为 ""(空字符串)。 对于来自 SubjectAccessReview 或 SelfSubjectAccessReview 的命名空间范围的资源, ""(空字符串)表示 "all"(所有资源)。
resourceAttributes.resource (string)
resource 是现有的资源类别之一。 "*" 表示所有资源类别。
resourceAttributes.subresource (string)
subresource 是现有的资源类别之一。 "" 表示无子资源。
resourceAttributes.verb (string)
verb 是 kubernetes 资源的 API 动作,例如 get、list、watch、create、update、delete、proxy。 "*" 表示所有动作。
resourceAttributes.version (string)
version 是资源的 API 版本。 "*" 表示所有版本。
uid (string)
有关正在请求的用户的 UID 信息。
user (string)
user 是你正在测试的用户。 如果你指定 “user” 而不是 “groups”,它将被解读为“如果 user 不是任何组的成员,将会怎样”。
SubjectAccessReviewStatus
allowed (boolean),必需
allowed 是必需的。 如果允许该操作,则为 true,否则为 false。
denied (boolean)
denied 是可选的。 如果拒绝该操作,则为 true,否则为 false。 如果 allowed 和 denied 均为 false,则 Authorizer 对是否鉴权操作没有意见。 如果 allowed 为 true,则 denied 不能为 true。
evaluationError (string)
evaluationError 表示鉴权检查期间发生一些错误。 出现错误的情况下完全有可能继续确定鉴权状态。 例如,RBAC 可能缺少一个角色,但仍存在足够多的角色进行绑定,进而了解请求有关的原因。
reason (string)
reason 是可选的。 它表示为什么允许或拒绝请求。
create
创建 SubjectAccessReviewPOST /apis/authorization.k8s.io/v1/subjectaccessreviews
body: SubjectAccessReview,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (SubjectAccessReview): OK
201 (SubjectAccessReview): Created
202 (SubjectAccessReview): Accepted
401: Unauthorized
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
ClusterRole 是一个集群级别的 PolicyRule 逻辑分组, 可以被 RoleBinding 或 ClusterRoleBinding 作为一个单元引用。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata (ObjectMeta)
标准的对象元数据。
aggregationRule (AggregationRule)
aggregationRule 是一个可选字段,用于描述如何构建这个 ClusterRole 的 rules。 如果设置了 aggregationRule,则 rules 将由控制器管理,对 rules 的直接变更会被该控制器阻止。
aggregationRule 描述如何定位并聚合其它 ClusterRole 到此 ClusterRole
aggregationRule.clusterRoleSelectors ([]LabelSelector)
clusterRoleSelectors 包含一个选择器的列表,用于查找 ClusterRole 并创建规则。 如果发现任何选择器匹配的 ClusterRole,将添加其对应的权限。
rules ([]PolicyRule)
rules 包含了这个 ClusterRole 的所有 PolicyRule。
PolicyRule 包含描述一个策略规则的信息,但不包含该规则适用于哪个主体或适用于哪个命名空间的信息。
rules.apiGroups ([]string)
apiGroups 是包含资源的 apiGroup 的名称。 如果指定了多个 API 组,则允许针对任何 API 组中的其中一个枚举资源来请求任何操作。
rules.resources ([]string)
resources 是此规则所适用的资源的列表。“*” 表示所有资源。
verbs 是适用于此规则中所包含的所有 ResourceKinds 的动作。 “*” 表示所有动作。
rules.resourceNames ([]string)
resourceNames 是此规则所适用的资源名称白名单,可选。 空集合意味着允许所有资源。
rules.nonResourceURLs ([]string)
nonResourceURLs 是用户应有权访问的一组部分 URL。 允许使用 “*”,但仅能作为路径中最后一段且必须用于完整的一段, 因为非资源 URL 没有划分命名空间。 此字段仅适用于从 ClusterRoleBinding 引用的 ClusterRole。 rules 可以应用到 API 资源(如 “pod” 或 “secret”)或非资源 URL 路径(如 “/api”), 但不能同时应用于两者。
ClusterRoleList 是 ClusterRole 的集合。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleList
metadata (ListMeta)
标准的对象元数据。
items ([]ClusterRole),必需
items 是 ClusterRole 的列表。
get
读取指定的 ClusterRoleGET /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
name (路径参数): string,必需
ClusterRole 的名称
pretty (查询参数): string
200 (ClusterRole): OK
401: Unauthorized
list
列出或观测类别为 ClusterRole 的对象GET /apis/rbac.authorization.k8s.io/v1/clusterroles
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ClusterRoleList): OK
401: Unauthorized
create
创建一个 ClusterRolePOST /apis/rbac.authorization.k8s.io/v1/clusterroles
body: ClusterRole,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ClusterRole): OK
201 (ClusterRole): Created
202 (ClusterRole): Accepted
401: Unauthorized
update
替换指定的 ClusterRolePUT /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
name (路径参数): string,必需
ClusterRole 的名称
body: ClusterRole,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ClusterRole): OK
201 (ClusterRole): Created
401: Unauthorized
patch
部分更新指定的 ClusterRolePATCH /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
name (路径参数): string,必需
ClusterRole 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (ClusterRole): OK
201 (ClusterRole): Created
401: Unauthorized
delete
删除一个 ClusterRoleDELETE /apis/rbac.authorization.k8s.io/v1/clusterroles/{name}
name (路径参数): string,必需
ClusterRole 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 ClusterRole 的集合DELETE /apis/rbac.authorization.k8s.io/v1/clusterroles
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
ClusterRoleBinding 引用 ClusterRole,但不包含它。 它可以引用全局命名空间中的 ClusterRole,并通过 Subject 添加主体信息。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata (ObjectMeta)
标准对象的元数据。
roleRef (RoleRef),必需
RoleRef 只能引用全局命名空间中的 ClusterRole。 如果无法解析 RoleRef,则 Authorizer 必定返回一个错误。
roleRef.apiGroup (string),必需
apiGroup 是被引用资源的组
roleRef.kind (string),必需
kind 是被引用的资源的类别
roleRef.name (string),必需
name 是被引用的资源的名称
subjects ([]Subject)
Subjects 包含角色所适用的对象的引用。
Subject 包含对角色绑定所适用的对象或用户标识的引用。其中可以包含直接 API 对象的引用或非对象(如用户名和组名)的值。
被引用的对象的类别。这个 API 组定义的值是 User
、Group
和 ServiceAccount
。
如果 Authorizer 无法识别类别值,则 Authorizer 应报告一个错误。
subjects.name (string),必需
被引用的对象的名称。
apiGroup 包含被引用主体的 API 组。对于 ServiceAccount 主体默认为 ""。 对于 User 和 Group 主体,默认为 "rbac.authorization.k8s.io"。
subjects.namespace (string)
被引用对象的命名空间。 如果对象类别是 "User" 或 "Group" 等非命名空间作用域的对象且该值不为空, 则 Authorizer 应报告一个错误。
ClusterRoleBindingList 是 ClusterRoleBinding 的集合。
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBindingList
metadata (ListMeta)
标准的对象元数据。
items ([]ClusterRoleBinding),必需
items 是 ClusterRoleBindings 的列表。
get
读取指定的 ClusterRoleBindingGET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
name (路径参数): string,必需
ClusterRoleBinding 的名称
pretty (查询参数): string
200 (ClusterRoleBinding): OK
401: Unauthorized
list
列出或观测类别为 ClusterRoleBinding 的对象GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ClusterRoleBindingList): OK
401: Unauthorized
create
创建 ClusterRoleBindingPOST /apis/rbac.authorization.k8s.io/v1/clusterrolebindings
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ClusterRoleBinding): OK
201 (ClusterRoleBinding): Created
202 (ClusterRoleBinding): Accepted
401: Unauthorized
update
替换指定的 ClusterRoleBindingPUT /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
name (路径参数): string,必需
ClusterRoleBinding 的名称
body: ClusterRoleBinding,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ClusterRoleBinding): OK
201 (ClusterRoleBinding): Created
401: Unauthorized
patch
部分更新指定的 ClusterRoleBindingPATCH /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
name (路径参数): string,必需
ClusterRoleBinding 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (ClusterRoleBinding): OK
201 (ClusterRoleBinding): Created
401: Unauthorized
delete
删除 ClusterRoleBindingDELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings/{name}
name (路径参数): string,必需
ClusterRoleBinding 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 ClusterRoleBinding 的集合DELETE /apis/rbac.authorization.k8s.io/v1/clusterrolebindings
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
Role 是一个按命名空间划分的 PolicyRule 逻辑分组,可以被 RoleBinding 作为一个单元引用。
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata (ObjectMeta)
标准的对象元数据。
rules ([]PolicyRule)
rules 包含了这个 Role 的所有 PolicyRule。
PolicyRule 包含描述一个策略规则的信息,但不包含该规则适用于哪个主体或适用于哪个命名空间的信息。
rules.apiGroups ([]string)
apiGroups 是包含资源的 apiGroup 的名称。 如果指定了多个 API 组,则允许对任何 API 组中的其中一个枚举资源来请求任何操作。
rules.resources ([]string)
resources 是此规则所适用的资源的列表。 “*” 表示所有资源。
rules.verbs ([]string),必需
verbs 是适用于此规则中所包含的所有 ResourceKinds 的动作。 “*” 表示所有动作。
rules.resourceNames ([]string)
resourceNames 是此规则所适用的资源名称白名单,可选。 空集合意味着允许所有资源。
rules.nonResourceURLs ([]string)
nonResourceURLs 是用户应有权访问的一组部分 URL。 允许使用 “*”,但仅能作为路径中最后一段且必须用于完整的一段, 因为非资源 URL 没有划分命名空间。 此字段仅适用于从 ClusterRoleBinding 引用的 ClusterRole。 rules 可以应用到 API 资源(如 “pod” 或 “secret”)或非资源 URL 路径(如 “/api”), 但不能同时应用于两者。
RoleList 是 Role 的集合。
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleList
metadata (ListMeta)
标准的对象元数据。
items ([]Role),必需
items 是 Role 的列表。
get
读取指定的 RoleGET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
200 (Role): OK
401: Unauthorized
list
列出或观测类别为 Role 的对象GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (RoleList): OK
401: Unauthorized
list
列出或观测类别为 Role 的对象GET /apis/rbac.authorization.k8s.io/v1/roles
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (RoleList): OK
401: Unauthorized
create
创建 RolePOST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
namespace (路径参数): string,必需
body: Role,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Role): OK
201 (Role): Created
202 (Role): Accepted
401: Unauthorized
update
替换指定的 RolePUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
name (路径参数): string,必需
Role 的名称
namespace (路径参数): string,必需
body: Role,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Role): OK
201 (Role): Created
401: Unauthorized
patch
部分更新指定的 RolePATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
name (路径参数): string,必需
Role 的名称
namespace (路径参数): string,必需
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (Role): OK
201 (Role): Created
401: Unauthorized
delete
删除 RoleDELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles/{name}
name (路径参数): string,必需
Role 的名称
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 Role 的集合DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/roles
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: rbac.authorization.k8s.io/v1
import "k8s.io/api/rbac/v1"
RoleBinding 引用一个角色,但不包含它。 RoleBinding 可以引用相同命名空间中的 Role 或全局命名空间中的 ClusterRole。 RoleBinding 通过 Subjects 和所在的命名空间信息添加主体信息。 处于给定命名空间中的 RoleBinding 仅在该命名空间中有效。
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata (ObjectMeta)
标准的对象元数据。
roleRef (RoleRef),必需
roleRef 可以引用当前命名空间中的 Role 或全局命名空间中的 ClusterRole。 如果无法解析 roleRef,则 Authorizer 必定返回一个错误。
roleRef.apiGroup (string),必需
apiGroup 是被引用资源的组
roleRef.kind (string),必需
kind 是被引用的资源的类别
roleRef.name (string),必需
name 是被引用的资源的名称
subjects ([]Subject)
subjects 包含角色所适用的对象的引用。
Subject 包含对角色绑定所适用的对象或用户标识的引用。其中可以包含直接 API 对象的引用或非对象(如用户名和组名)的值。
subjects.kind (string),必需
被引用的对象的类别。
这个 API 组定义的值是 User
、Group
和 ServiceAccount
。
如果 Authorizer 无法识别类别值,则 Authorizer 应报告一个错误。
subjects.name (string),必需
被引用的对象的名称。
subjects.apiGroup (string)
apiGroup 包含被引用主体的 API 组。 对于 ServiceAccount 主体默认为 ""。 对于 User 和 Group 主体,默认为 "rbac.authorization.k8s.io"。
subjects.namespace (string)
被引用的对象的命名空间。 如果对象类别是 “User” 或 “Group” 等非命名空间作用域的对象且该值不为空, 则 Authorizer 应报告一个错误。
RoleBindingList 是 RoleBinding 的集合。
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBindingList
metadata (ListMeta)
标准的对象元数据。
items ([]RoleBinding),必需
items 是 RoleBinding 的列表。
get
读取指定的 RoleBindingGET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
name (路径参数): string,必需
RoleBinding 的名称
namespace (路径参数): string,必需
pretty (查询参数): string
200 (RoleBinding): OK
401: Unauthorized
list
列出或观测类别为 RoleBinding 的对象GET /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (RoleBindingList): OK
401: Unauthorized
list
列出或观测类别为 RoleBinding 的对象GET /apis/rbac.authorization.k8s.io/v1/rolebindings
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (RoleBindingList): OK
401: Unauthorized
create
创建 RoleBindingPOST /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings
namespace (路径参数): string,必需
body: RoleBinding,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (RoleBinding): OK
201 (RoleBinding): Created
202 (RoleBinding): Accepted
401: Unauthorized
update
替换指定的 RoleBindingPUT /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
name (路径参数): string,必需
RoleBinding 的名称
namespace (路径参数): string,必需
body: RoleBinding,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (RoleBinding): OK
201 (RoleBinding): Created
401: Unauthorized
patch
部分更新指定的 RoleBindingPATCH /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
name (路径参数): string,必需
RoleBinding 的名称
namespace (路径参数): string,必需
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (RoleBinding): OK
201 (RoleBinding): Created
401: Unauthorized
delete
删除 RoleBindingDELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings/{name}
name (路径参数): string,必需
RoleBinding 的名称
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 RoleBinding 的集合DELETE /apis/rbac.authorization.k8s.io/v1/namespaces/{namespace}/rolebindings
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
LimitRange 设置名字空间中每个资源类别的资源用量限制。
apiVersion: v1
kind: LimitRange
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (LimitRangeSpec)
spec 定义强制执行的限制。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
LimitRangeSpec 定义与类别匹配的资源的最小/最大使用限制。
limits ([]LimitRangeItem),必需
limits 是强制执行的 LimitRangeItem 对象的列表。
LimitRangeItem 定义与类别匹配的任意资源的最小/最大使用限制。
limits.type (string),必需
此限制应用到的资源的类型。
LimitRangeList 是 LimitRange 项的列表。
apiVersion: v1
kind: LimitRangeList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]LimitRange),必需
items 是 LimitRange 对象的列表。更多信息: https://kubernetes.io/zh-cn/docs/concepts/configuration/manage-resources-containers/
get
读取指定的 LimitRangeGET /api/v1/namespaces/{namespace}/limitranges/{name}
name (路径参数): string,必需
LimitRange 的名称
namespace (路径参数): string,必需
pretty (查询参数): string
200 (LimitRange): OK
401: Unauthorized
list
列出或监视 LimitRange 类别的对象GET /api/v1/namespaces/{namespace}/limitranges
namespace (路径参数): string,必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (LimitRangeList): OK
401: Unauthorized
list
列出或监视 LimitRange 类别的对象GET /api/v1/limitranges
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (LimitRangeList): OK
401: Unauthorized
create
创建 LimitRangePOST /api/v1/namespaces/{namespace}/limitranges
namespace (路径参数): string,必需
body: LimitRange,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (LimitRange): OK
201 (LimitRange): Created
202 (LimitRange): Accepted
401: Unauthorized
update
替换指定的 LimitRangePUT /api/v1/namespaces/{namespace}/limitranges/{name}
name (路径参数): string,必需
LimitRange 的名称
namespace (路径参数): string,必需
body: LimitRange,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (LimitRange): OK
201 (LimitRange): Created
401: Unauthorized
patch
部分更新指定的 LimitRangePATCH /api/v1/namespaces/{namespace}/limitranges/{name}
name (路径参数): string,必需
LimitRange 的名称
namespace (路径参数): string,必需
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (LimitRange): OK
201 (LimitRange): Created
401: Unauthorized
delete
删除 LimitRangeDELETE /api/v1/namespaces/{namespace}/limitranges/{name}
name (路径参数): string,必需
LimitRange 的名称
namespace (路径参数): string,必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 LimitRange 的集合DELETE /api/v1/namespaces/{namespace}/limitranges
namespace (路径参数): string,必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: policy/v1
import "k8s.io/api/policy/v1"
PodDisruptionBudget 是一个对象,用于定义可能对一组 Pod 造成的最大干扰。
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata (ObjectMeta)
标准的对象元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata。
spec (PodDisruptionBudgetSpec)
PodDisruptionBudget 预期行为的规约。
status (PodDisruptionBudgetStatus)
此 PodDisruptionBudget 的最近观测状态。
PodDisruptionBudgetSpec 是对 PodDisruptionBudget 的描述。
maxUnavailable (IntOrString)
如果 “selector” 所选中的 Pod 中最多有 “maxUnavailable” Pod 在驱逐后不可用(即去掉被驱逐的 Pod 之后),则允许驱逐。 例如,可以通过将此字段设置为 0 来阻止所有自愿驱逐。此字段是与 “minAvailable” 互斥的设置。
IntOrString 是一种可以包含 int32 或字符串数值的类型。在 JSON 或 YAML 编组和解组时, 会生成或使用内部类型。例如,此类型允许你定义一个可以接受名称或数字的 JSON 字段。
minAvailable (IntOrString)
如果 “selector” 所选中的 Pod 中,至少 “minAvailable” 个 Pod 在驱逐后仍然可用(即去掉被驱逐的 Pod 之后),则允许驱逐。 因此,你可以通过将此字段设置为 “100%” 来禁止所有自愿驱逐。
IntOrString 是一种可以包含 int32 或字符串数值的类型。在 JSON 或 YAML 编组和解组时, 会生成或使用内部类型。例如,此类型允许你定义一个可以接受名称或数字的 JSON 字段。
selector (LabelSelector)
标签查询,用来选择其驱逐由干扰预算来管理的 Pod 集合。 选择算符为 null 时将不会匹配任何 Pod,而空 ({}) 选择算符将选中名字空间内的所有 Pod。
PodDisruptionBudgetStatus 表示有关此 PodDisruptionBudget 状态的信息。状态可能会反映系统的实际状态。
currentHealthy (int32), 必需
当前健康 Pod 的数量。
desiredHealthy (int32), 必需
健康 Pod 的最小期望值。
disruptionsAllowed (int32), 必需
当前允许的 Pod 干扰计数。
conditions ([]Condition)
补丁策略:根据 type
键执行合并操作
Map:键 type 的唯一值将在合并期间被保留
conditions 包含 PDB 的状况。干扰控制器会设置 DisruptionAllowed 状况。 以下是 reason 字段的已知值(将来可能会添加其他原因):
Condition 包含此 API 资源当前状态的一个方面的详细信息。
conditions.lastTransitionTime (Time), 必需
lastTransitionTime 是状况最近一次从一种状态转换到另一种状态的时间。 这种变化通常出现在下层状况发生变化的时候。如果无法了解下层状况变化,使用 API 字段更改的时间也是可以接受的。
Time 是 time.Time 的包装器,它支持对 YAML 和 JSON 的正确编组。 time 包的许多工厂方法提供了包装器。
conditions.message (string), 必需
message 是一条人类可读的消息,指示有关转换的详细信息。它可能是一个空字符串。
conditions.reason (string), 必需
reason 包含一个程序标识符,指示状况最后一次转换的原因。 特定状况类型的生产者可以定义该字段的预期值和含义,以及这些值是否可被视为有保证的 API。 该值应该是 CamelCase 字符串。此字段不能为空。
conditions.status (string), 必需
状况的状态为 True、False、Unknown 之一。
conditions.type (string), 必需
CamelCase 或 foo.example.com/CamelCase 形式的状况类型。
conditions.observedGeneration (int64)
observedGeneration 表示设置状况时所基于的 .metadata.generation。 例如,如果 .metadata.generation 当前为 12,但 .status.conditions[x].observedGeneration 为 9, 则状况相对于实例的当前状态已过期。
disruptedPods (map[string]Time)
disruptedPods 包含有关 Pod 的一些信息,这些 Pod 的驱逐操作已由 API 服务器上的 eviction 子资源处理程序处理, 但尚未被 PodDisruptionBudget 控制器观察到。 从 API 服务器处理驱逐请求到 PDB 控制器看到该 Pod 已标记为删除(或超时后),Pod 将记录在此映射中。 映射中的键名是 Pod 的名称,键值是 API 服务器处理驱逐请求的时间。 如果删除没有发生并且 Pod 仍然存在,PodDisruptionBudget 控制器将在一段时间后自动将 Pod 从列表中删除。 如果一切顺利,此映射大部分时间应该是空的。映射中的存在大量条目可能表明 Pod 删除存在问题。
Time 是 time.Time 的包装器,它支持对 YAML 和 JSON 的正确编组。 time 包的许多工厂方法提供了包装器。
observedGeneration (int64)
更新此 PDB 状态时观察到的最新一代。 DisruptionsAllowed 和其他状态信息仅在 observedGeneration 等于 PDB 的对象的代数时才有效。
PodDisruptionBudgetList 是 PodDisruptionBudget 的集合。
apiVersion: policy/v1
kind: PodDisruptionBudgetList
metadata (ListMeta)
标准的对象元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata。
items ([]PodDisruptionBudget), 必需
items 是 PodDisruptionBudgets 的列表。
get
读取指定的 PodDisruptionBudgetGET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}
name (路径参数): string, 必需
PodDisruptionBudget 的名称。
namespace (路径参数): string, 必需
pretty (查询参数): string
200 (PodDisruptionBudget): OK
401: Unauthorized
get
读取指定 PodDisruptionBudget 的状态GET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status
name (路径参数): string, 必需
PodDisruptionBudget 的名称。
namespace (路径参数): string, 必需
pretty (查询参数): string
响应
200 (PodDisruptionBudget): OK
401: Unauthorized
list
列出或监视 PodDisruptionBudget 类型的对象GET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets
namespace (路径参数): string, 必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (PodDisruptionBudgetList): OK
401: Unauthorized
list
列出或监视 PodDisruptionBudget 类型的对象GET /apis/policy/v1/poddisruptionbudgets
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (PodDisruptionBudgetList): OK
401: Unauthorized
create
创建一个 PodDisruptionBudgetPOST /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets
namespace (路径参数): string, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PodDisruptionBudget): OK
201 (PodDisruptionBudget): Created
202 (PodDisruptionBudget): Accepted
401: Unauthorized
update
替换指定的 PodDisruptionBudgetPUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}
name (路径参数): string, 必需
PodDisruptionBudget 的名称。
namespace (路径参数): string, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
200 (PodDisruptionBudget): OK
201 (PodDisruptionBudget): Created
401: Unauthorized
update
替换指定 PodDisruptionBudget 的状态PUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status
name (路径参数): string, 必需
PodDisruptionBudget 的名称。
namespace (路径参数): string, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
200 (PodDisruptionBudget): OK
201 (PodDisruptionBudget): Created
401: Unauthorized
patch
部分更新指定的 PodDisruptionBudgetPATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}
name (路径参数): string, 必需
PodDisruptionBudget 的名称
namespace (路径参数): string, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PodDisruptionBudget): OK
201 (PodDisruptionBudget): Created
401: Unauthorized
patch
部分更新指定 PodDisruptionBudget 的状态PATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status
name (路径参数): string, 必需
PodDisruptionBudget 的名称。
namespace (路径参数): string, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PodDisruptionBudget): OK
201 (PodDisruptionBudget): Created
401: Unauthorized
delete
删除 PodDisruptionBudgetDELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}
name (路径参数): string, 必需
PodDisruptionBudget 的名称。
namespace (路径参数): string, 必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 PodDisruptionBudget 的集合DELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets
namespace (路径参数): string, 必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: policy/v1beta1
import "k8s.io/api/policy/v1beta1"
PodSecurityPolicy 对影响到安全上下文的请求能力进行治理,而安全上下文可以应用到 Pod 和容器上。 在 1.21 中已被弃用。
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (PodSecurityPolicySpec)
spec 定义强制执行的策略。
PodSecurityPolicySpec 定义强制执行的策略。
runAsUser (RunAsUserStrategyOptions),必需
runAsUser 是一种策略,它将规定允许为 runAsUser 设置的值。
RunAsUserStrategyOptions 定义策略类型和用于创建该策略的任意选项。
runAsUser.rule (string),必需
rule 是一种策略,它将规定允许为 runAsUser 设置的值。
runAsUser.ranges ([]IDRange)
ranges 是可以使用的 UID 的允许范围。 如果你要强制使用某个确定 UID,则应提供起点值和终点值相同的范围设定。 对于 mustRunAs 而言是必需的。
runAsUser.ranges.max (int64),必需
max 是范围的终点,该值包含在此范围内。
runAsUser.ranges.min (int64),必需
min 是范围的起点,该值包含在此范围内。
runAsGroup (RunAsGroupStrategyOptions)
runAsGroup 是一种策略,它将规定可以为 runAsGroup 设置的值。
如果省略此字段,则 Pod 的 runAsGroup 可以取任何值。
此字段要求启用 RunAsGroup
特性门控。
RunAsGroupStrategyOptions 定义策略类型和用于创建该策略的任意选项。
runAsGroup.rule (string),必需
rule 是一种策略,它将规定可以为 runAsGroup 设置的值。
runAsGroup.ranges ([]IDRange)
ranges 是可以使用的 GID 的范围。 如果你要强制使用某个确定的 GID,则可提供起点和终点相同的范围设定。 对于 mustRunAs 而言是必需的。
runAsGroup.ranges.max (int64),必需
max 是范围的终点,该值包含在此范围内。
runAsGroup.ranges.min (int64),必需
min 是范围的起点,该值包含在此范围内。
fsGroup (FSGroupStrategyOptions),必需
fsGroup 是一种策略,它将规定 SecurityContext 将使用哪个 fs 组。
FSGroupStrategyOptions 定义策略类型和用于创建该策略的任意选项。
fsGroup.ranges ([]IDRange)
ranges 是 fs 组的允许范围。 如果你要强制使用某个确定的 fs 组,则应提供起点和终点相同的范围设定。 对于 mustRunAs 而言是必需的。
fsGroup.ranges.max (int64),必需
max 是范围的终点,该值包含在此范围内。
fsGroup.ranges.min (int64),必需
min 是范围的起点,该值包含在此范围内。
fsGroup.rule (string)
rule 是一种策略,它将规定 SecurityContext 中使用哪个 FSGroup。
supplementalGroups (SupplementalGroupsStrategyOptions),必需
supplementalGroups 是一种策略,它将规定 SecurityContext 将使用哪个补充组。
SupplementalGroupsStrategyOptions 定义策略类型和用于创建该策略的任意选项。
supplementalGroups.ranges ([]IDRange)
ranges 是补充组的允许范围。 如果你要强制使用固定的某个补充组,则应提供起点和终点相同的范围设定。 对于 mustRunAs 而言是必需的。
supplementalGroups.ranges.max (int64),必需
max 是范围的终点,该值包含在此范围内。
supplementalGroups.ranges.min (int64),必需
min 是范围的起点,该值包含在此范围内。
supplementalGroups.rule (string)
rule 是一种策略,它将规定 SecurityContext 中使用哪个补充组。
seLinux (SELinuxStrategyOptions),必需
seLinux 是一种策略,它将规定可以设置的标签集合。
SELinuxStrategyOptions 定义策略类型和用于创建该策略的任意选项。
seLinux.rule (string),必需
rule 是一种策略,它将规定可以设置的标签集合。
seLinux.seLinuxOptions (SELinuxOptions)
seLinuxOptions 是运行所必需的。对于 mustRunAs 而言是必需的。更多信息: https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/security-context/
seLinux.seLinuxOptions.level (string)
level 是应用到容器的 SELinux 级别标签。
seLinux.seLinuxOptions.role (string)
role 是应用到容器的 SELinux 角色标签。
seLinux.seLinuxOptions.type (string)
type 是应用到容器的 SELinux 类型标签。
seLinux.seLinuxOptions.user (string)
user 是应用到容器的 SELinux 用户标签。
readOnlyRootFilesystem (boolean)
readOnlyRootFilesystem 设为 true 时将强制容器使用只读根文件系统来运行。 如果容器明确请求以非只读根文件系统来运行,则 PSP 应拒绝该 Pod。 如果设置为 false,则如果愿意,容器可以以只读根文件系统来运行,但不是必须使用只读根文件系统。
privileged (boolean)
privileged 决定 Pod 是否可以请求以特权模式运行。
allowPrivilegeEscalation (boolean)
allowPrivilegeEscalation 决定 Pod 是否可以请求允许提升特权。如果未指定,则默认为 true。
defaultAllowPrivilegeEscalation (boolean)
defaultAllowPrivilegeEscalation 控制一个进程是否可以获得比其父进程更多权限的默认设置。
allowedCSIDrivers ([]AllowedCSIDriver)
allowedCSIDrivers 是允许使用的内联 CSI 驱动列表,这些驱动必须被显式嵌入到 Pod 规约中。 空值表示任何 CSI 驱动都可以用于内联临时卷。这是一个 beta 字段, 只有 API 服务器启用 CSIInlineVolume 特性门控,才会使用此字段。
AllowedCSIDriver 表示允许使用的单个内联 CSI 驱动。
allowedCSIDrivers.name (string),必需
name 是 CSI 驱动的注册名称。
allowedCapabilities ([]string)
allowedCapabilities 是可以请求添加到容器的权能列表。 这个字段中的权能可以由 Pod 作者自行添加。 你不得同时在 allowedCapabilities 和 requiredDropCapabilities 中列出同一个权能。
requiredDropCapabilities ([]string)
requiredDropCapabilities 是将从容器中丢弃的权能。这些权能需要被丢弃,且不能添加。
defaultAddCapabilities ([]string)
defaultAddCapabilities 是默认被添加到容器的权能集,除非 Pod 规约特意丢弃该权能。 你不可以同时在 defaultAddCapabilities 和 requiredDropCapabilities 中列出同一个权能。 此处添加的权能是被隐式允许的,不必包括在 allowedCapabilities 列表中。
allowedFlexVolumes ([]AllowedFlexVolume)
allowedFlexVolumes 是允许设置的 FlexVolume 卷的列表。 空或 nil 值表示可以使用所有 FlexVolume。 只有在 “volumes” 字段中允许使用 Flexvolume 卷时,此参数才有效。
AllowedFlexVolume 表示允许使用的单个 Flexvolume。
allowedFlexVolumes.driver (string),必需
driver 是 FlexVolume 驱动的名称。
allowedHostPaths ([]AllowedHostPath)
allowedHostPaths 是允许使用的主机路径的列表。空表示可以使用所有主机路径。
allowedHostPath 定义将按 Pod 使用的策略启用的主机卷条件。它要求定义路径前缀。
allowedHostPaths.pathPrefix (string)
pathPrefix 是主机卷必须匹配的路径前缀。
此字段不支持 *
。使用主机路径检验路径前缀时,会裁剪掉尾部的斜线。
例如:/foo
将允许 /foo
、/foo/
和 /foo/bar
。
/foo
将不允许 /food
或 /etc/foo
。
allowedHostPaths.readOnly (boolean)
当设置为 true 时,仅当所有与 pathPrefix 匹配的主机卷的卷挂载均为 readOnly 时,才允许使用。
allowedProcMountTypes ([]string)
AllowedProcMountTypes 是允许使用的 ProcMountType 的列表。 空表或 nil 表示仅可以使用 DefaultProcMountType。 此字段要求启用 ProcMountType 特性门控。
allowedUnsafeSysctls ([]string)
allowedUnsafeSysctls 是明确允许的不安全 sysctl 的列表,默认为空。
每个条目要么是一个普通的 sysctl 名称,要么以 “*” 结尾,
在后面这种情况下字符串值被视为所允许的 sysctl 的前缀。
单个 *
意味着允许所有不安全的 sysctl。
Kubelet 必须显式列出所有被允许的、不安全的 sysctl,以防被拒绝。
例如 foo/*
允许 foo/bar
、foo/baz
等。
例如 foo.*
允许 foo.bar
、foo.baz
等。
forbiddenSysctls ([]string)
forbiddenSysctls 是被明确禁止的 sysctl 的列表,默认为空。
每个条目要么是一个普通的 sysctl 名称,要么以 *
结尾,
以 *
结尾的字符串值表示被禁止的 sysctl 的前缀。
单个 *
意味着禁止所有 sysctl。
例如 foo/*
禁止 foo/bar
、foo/baz
等。
例如 foo.*
禁止 foo.bar
、foo.baz
等。
hostIPC (boolean)
hostIPC 决定此策略是否允许在 Pod 规约中使用 hostIPC。
hostNetwork (boolean)
hostNetwork 决定此策略是否允许在 Pod 规约中使用 hostNetwork。
hostPID (boolean)
hostPID 决定此策略是否允许在 Pod 规约中使用 hostPID。
hostPorts ([]HostPortRange)
hostPorts 决定允许暴露哪些主机端口范围。
HostPortRange 定义将按 Pod 使用的策略启用的主机端口范围。它要求同时定义起点和终点。
hostPorts.max (int32),必需
max 是范围的终点,该值包含在此范围内。
hostPorts.min (int32),必需
min 是范围的起点,该值包含在此范围内。
runtimeClass (RuntimeClassStrategyOptions)
runtimeClass 是一种策略,它将规定 Pod 所被允许的 RuntimeClass。 如果省略此字段,则 Pod 的 runtimeClassName 将不受限制。 该字段的实施取决于被启用的 RuntimeClass 特性门控。
RuntimeClassStrategyOptions 定义一种策略,它将规定 Pod 所被允许的 RuntimeClass。
runtimeClass.allowedRuntimeClassNames ([]string),必需
allowedRuntimeClassNames 是可以在 Pod 中指定的 runtimeClass 名称的列表。
*
值意味着允许任何 runtimeClass 值,并且如果设置了 *
,则它必须是唯一的列表项。
空列表要求不能设置 runtimeClassName 字段。
runtimeClass.defaultRuntimeClassName (string)
defaultRuntimeClassName 是要在 Pod 中设置的默认 runtimeClassName。 该默认值必须被 allowedRuntimeClassNames 列表所允许。nil 值不会改变 Pod 设置。
volumes ([]string)
volumes 是所允许的卷插件的列表。空的列表意味着不可以使用卷。要允许所有卷,你可以使用 *
。
PodSecurityPolicyList 是 PodSecurityPolicy 对象的列表。
apiVersion: policy/v1beta1
kind: PodSecurityPolicyList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]PodSecurityPolicy),必需
items 是 PodSecurityPolicy 对象的列表。
get
读取指定的 PodSecurityPolicyGET /apis/policy/v1beta1/podsecuritypolicies/{name}
name (路径参数): string,必需
PodSecurityPolicy 的名称
pretty (查询参数): string
200 (PodSecurityPolicy): OK
401: Unauthorized
list
列出或监视 PodSecurityPolicy 类别的对象GET /apis/policy/v1beta1/podsecuritypolicies
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (PodSecurityPolicyList): OK
401: Unauthorized
create
创建 PodSecurityPolicyPOST /apis/policy/v1beta1/podsecuritypolicies
body: PodSecurityPolicy,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PodSecurityPolicy): OK
201 (PodSecurityPolicy): Created
202 (PodSecurityPolicy): Accepted
401: Unauthorized
update
替换指定的 PodSecurityPolicyPUT /apis/policy/v1beta1/podsecuritypolicies/{name}
name (路径参数): string,必需
PodSecurityPolicy 的名称
body: PodSecurityPolicy,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PodSecurityPolicy): OK
201 (PodSecurityPolicy): Created
401: Unauthorized
patch
部分更新指定的 PodSecurityPolicyPATCH /apis/policy/v1beta1/podsecuritypolicies/{name}
name (路径参数): string,必需
PodSecurityPolicy 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PodSecurityPolicy): OK
201 (PodSecurityPolicy): Created
401: Unauthorized
delete
删除 PodSecurityPolicyDELETE /apis/policy/v1beta1/podsecuritypolicies/{name}
name (路径参数): string,必需
PodSecurityPolicy 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (PodSecurityPolicy): OK
202 (PodSecurityPolicy): Accepted
401: Unauthorized
deletecollection
删除 PodSecurityPolicy 的集合DELETE /apis/policy/v1beta1/podsecuritypolicies
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: apiextensions.k8s.io/v1
import "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
CustomResourceDefinition 表示应在 API 服务器上公开的资源。其名称必须采用 <.spec.name>.<.spec.group>
格式。
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata (ObjectMeta)
标准的对象元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (CustomResourceDefinitionSpec), 必需
spec 描述了用户希望资源的呈现方式
status (CustomResourceDefinitionStatus)
status 表示 CustomResourceDefinition 的实际状态
CustomResourceDefinitionSpec 描述了用户希望资源的呈现方式
group (string),必需
group 是自定义资源的 API 组。自定义资源在 /apis/<group>/...
下提供。
必须与 CustomResourceDefinition 的名称匹配(格式为 <names.plural>.<group>
)。
names (CustomResourceDefinitionNames),必需
names 表示自定义资源的资源和种类名称。
CustomResourceDefinitionNames 表示提供此 CustomResourceDefinition 资源的名称
names.kind (string),必需
kind 是资源的序列化类型。它通常是驼峰命名的单数形式。自定义资源实例将使用此值作为 API 调用中的 kind
属性。
names.plural (string),必需
plural 是所提供的资源的复数名称,自定义资源在 /apis/<group>/<version>/.../<plural>
下提供。
必须与 CustomResourceDefinition 的名称匹配(格式为 <names.plural>.<group>
)。必须全部小写。
names.categories ([]string)
categories 是自定义资源所属的分组资源列表(例如 'all')。
它在 API 发现文档中发布,并支持客户端像 kubectl get all
这样的调用。
names.listKind (string)
listKind 是此资源列表的序列化类型。默认为 "kind
List"。
names.shortNames ([]string)
shortNames 是资源的短名称,在 API 发现文档中公开,并支持客户端调用,如 kubectl get <shortname>
。必须全部小写。
names.singular (string)
singular 是资源的单数名称。必须全部小写。默认为小写 kind
。
scope (string),必需
scope 表示自定义资源是群集作用域还是命名空间作用域。允许的值为 Cluster
和 Namespaced
。
versions ([]CustomResourceDefinitionVersion),必需
versions 是自定义资源的所有 API 版本的列表。版本名称用于计算服务版本在 API 发现中列出的顺序。 如果版本字符串是与 Kubernetes 的版本号形式类似,则它将排序在非 Kubernetes 形式版本字符串之前。 Kubernetes 的版本号字符串按字典顺序排列。Kubernetes 版本号以 “v” 字符开头, 后面是一个数字(主版本),然后是可选字符串 “alpha” 或 “beta” 和另一个数字(次要版本)。 它们首先按 GA > beta > alpha 排序(其中 GA 是没有 beta 或 alpha 等后缀的版本),然后比较主要版本, 最后是比较次要版本。版本排序列表示例:v10、v2、v1、v11beta2、v10beta3、v3beta1、v12alpha1、v11alpha2、foo1、foo10。
CustomResourceDefinitionVersion 描述 CRD 的一个版本
versions.name (string),必需
name 是版本名称,例如 “v1”、“v2beta1” 等。如果 served
是 true,自定义资源在
/apis/<group>/<version>/...
版本下提供。
versions.served (boolean),必需
served 是用于启用/禁用该版本通过 REST API 提供服务的标志
versions.storage (boolean),必需
storage 表示在将自定义资源持久保存到存储时应使用此版本。有且仅有一个版本的 storage=true。
versions.additionalPrinterColumns ([]CustomResourceColumnDefinition)
additionalPrinterColumns 表示在表输出中返回的附加列。 有关详细信息,请参阅 https://kubernetes.io/zh-cn/docs/reference/using-api/api-concepts/#receiving-resources-as-tables。 如果没有指定列,则显示自定义资源存活时间(AGE)列。
CustomResourceColumnDefinition 指定用于服务器端打印的列。
versions.additionalPrinterColumns.jsonPath (string),必需
jsonPath 是一个简单的 JSON 路径(使用数组表示法),它对每个自定义资源进行评估,以生成该列的值。
versions.additionalPrinterColumns.name (string),必需
name 是便于阅读的列名称
versions.additionalPrinterColumns.type (string),必需
type 是此列的 OpenAPI 类型定义。有关详细信息, 请参阅 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types
versions.additionalPrinterColumns.description (string)
description 是该列的可读性描述
versions.additionalPrinterColumns.format (string)
format 是这个列的可选 OpenAPI 类型定义。'name' 格式应用于主标识符列,以帮助客户端识别列是资源名称。 有关详细信息,请参阅 https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#data-types。
versions.additionalPrinterColumns.priority (int32)
priority 是一个定义此列相对于其他列的相对重要性的整数。数字越低,优先级越高。 在空间有限的情况下,可以省略的列的优先级应大于 0。
versions.deprecated (boolean)
deprecated 表示此版本的自定义资源 API 已弃用。设置为 true 时,对此版本的 API 请求会在服务器响应头信息中带有警告(warning)信息。此值默认为 false。
versions.deprecationWarning (string)
deprecationWarning 会覆盖返回给 API 客户端的默认警告。只能在 deprecated
为 true 时设置。
默认警告表示此版本已弃用,建议使用最新的同等或更高稳定性版本(如果存在)。
versions.schema (CustomResourceValidation)
schema 描述了用于验证、精简和默认此版本的自定义资源的模式。
CustomResourceValidation 是 CustomResources 的验证方法列表。
versions.schema.openAPIV3Schema (JSONSchemaProps)
openAPIV3Schema 是用于验证和精简的 OpenAPI v3 模式。
versions.subresources (CustomResourceSubresources)
subresources 指定此版本已定义的自定义资源具有哪些子资源。
CustomResourceSubresources 定义了 CustomResources 子资源的状态和规模。
versions.subresources.scale (CustomResourceSubresourceScale)
scale 表示自定义资源应该提供一个 /scale
子资源,该子资源返回一个 autoscaling/v1
Scale 对象。
CustomResourceSubresourceScale 定义了如何为 CustomResources 的 scale 子资源提供服务。
versions.subresources.scale.specReplicasPath (string),必需
specReplicasPath 定义对应于 Scale 的自定义资源内的 JSON 路径 spec.replicas
。
只允许没有数组表示法的 JSON 路径。必须是 .spec
下的 JSON 路径。
如果自定义资源中的给定路径下没有值,那么 GET /scale
子资源将返回错误。
versions.subresources.scale.statusReplicasPath (string),必需
statusReplicasPath 定义对应于 Scale 的自定义资源内的 JSON 路径 status.replicas
。
只允许不带数组表示法的 JSON 路径。必须是 .status
下的 JSON 路径。
如果自定义资源中给定路径下没有值,则 /scale
子资源中的 status.replicas
值将默认为 0。
versions.subresources.scale.labelSelectorPath (string)
labelSelectorPath 定义对应于 Scale 的自定义资源内的 JSON 路径 status.selector
。
只允许不带数组表示法的 JSON 路径。必须是 .status
或 .spec
下的路径。
必须设置为与 HorizontalPodAutoscaler 一起使用。
此 JSON 路径指向的字段必须是字符串字段(不是复杂的选择器结构),其中包含字符串形式的序列化标签选择器。
更多信息: https://kubernetes.io/zh-cn/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions#scale-subresource。
如果自定义资源中给定路径下没有值,则 /scale
子资源中的 status.selector
默认值为空字符串。
versions.subresources.status (CustomResourceSubresourceStatus)
status 表示自定义资源应该为 /status
子资源服务。当启用时:
status
节的改变;/status
子资源的请求忽略对对象的 status
节以外的任何变化。CustomResourceSubresourceStatus 定义了如何为自定义资源提供 status 子资源。
状态由 CustomResource 中的 .status
JSON 路径表示。设置后,
/status
子资源。/status
子资源发出的 PUT 请求时,需要提供自定义资源对象,服务器端会忽略对 status 节以外的任何内容更改。conversion (CustomResourceConversion)
conversion 定义了 CRD 的转换设置。
CustomResourceConversion 描述了如何转换不同版本的自定义资源。
conversion.strategy (string),必需
strategy 指定如何在版本之间转换自定义资源。允许的值为:
None
:转换器仅更改 apiVersion 并且不会触及自定义资源中的任何其他字段。Webhook
:API 服务器将调用外部 Webhook 进行转换。此选项需要其他信息。这要求
spec.preserveUnknownFields 为 false,并且设置 spec.conversion.webhook。conversion.webhook (WebhookConversion)
webhook 描述了如何调用转换 Webhook。当 strategy
设置为 Webhook
时有效。
WebhookConversion 描述了如何调用转换 Webhook
conversion.webhook.conversionReviewVersions ([]string),必需
conversionReviewVersions 是 Webhook 期望的 ConversionReview
版本的有序列表。
API 服务器将使用它支持的列表中的第一个版本。如果 API 服务器不支持此列表中指定的版本,则自定义资源的转换将失败。
如果持久化的 Webhook 配置指定了允许的版本但其中不包括 API 服务器所了解的任何版本,则对 Webhook 的调用将失败。
conversion.webhook.clientConfig (WebhookClientConfig)
如果 strategy 是 Webhook
, 那么 clientConfig 是关于如何调用 Webhook 的说明。
WebhookClientConfig 包含与 Webhook 建立 TLS 连接的信息。
conversion.webhook.clientConfig.caBundle ([]byte)
caBundle 是一个 PEM 编码的 CA 包,用于验证 Webhook 服务器的服务证书。 如果未指定,则使用 API 服务器上的系统根证书。
conversion.webhook.clientConfig.service (ServiceReference)
service 是对此 Webhook 服务的引用。必须指定 service 或 url 字段之一。
如果在集群中运行 Webhook,那么你应该使用 service
。
ServiceReference 保存对 Service.legacy.k8s.io 的一个引用。
conversion.webhook.clientConfig.service.name (string),必需
name 是服务的名称。必需。
conversion.webhook.clientConfig.service.namespace (string),必需
namespace 是服务的命名空间。必需。
conversion.webhook.clientConfig.service.path (string)
path 是一个可选的 URL 路径,Webhook 将通过该路径联系服务。
conversion.webhook.clientConfig.service.port (int32)
port 是 Webhook 联系的可选服务端口。port
应该是一个有效的端口号(1-65535,包含)。
为实现向后兼容,默认端口号为 443。
conversion.webhook.clientConfig.url (string)
url 以标准 URL 的形式(scheme://host:port/path
)给出 Webhook 的位置。url
或 service
必须指定一个且只能指定一个。
host
不应引用集群中运行的服务;若使用集群内服务应改为使用 service
字段。
host 值可能会通过外部 DNS 解析(例如,kube-apiserver
无法解析集群内 DNS,因为这将违反分层规则)。
host
也可能是 IP 地址。
请注意,使用 localhost
或 127.0.0.1
作为 host
是有风险的,
除非你非常小心地在所有运行 API 服务器的主机上运行这个 Webhook,因为这些 API 服务器可能需要调用这个 Webhook。
这样的安装可能是不可移植的,也就是说,不容易在一个新的集群中复现。
scheme 必须是 "https";URL 必须以 "https://" 开头。
路径(path)是可选的,如果存在,则可以是 URL 中允许的任何字符串。 你可以使用路径传递一个任意字符串给 Webhook,例如,一个集群标识符。
不允许使用用户或基本认证,例如 "user:password@",是不允许的。片段("#...")和查询参数("?...")也是不允许的。
preserveUnknownFields (boolean)
preserveUnknownFields 表示将对象写入持久性存储时应保留 OpenAPI 模式中未规定的对象字段。
apiVersion、kind、元数据(metadata)和元数据中的已知字段始终保留。不推荐使用此字段,而建议在
spec.versions[*].schema.openAPIV3Schema
中设置 x-preserve-unknown-fields
为 true。
更多详细信息参见: https://kubernetes.io/zh-cn/docs/tasks/access-kubernetes-api/custom-resources/custom-resource-definitions/#pruning-versus-preserving-unknown-fields
JSONSchemaProps 是JSON 模式(JSON-Schema),遵循其规范草案第 4 版 (http://json-schema.org/)。
$ref (string)
$schema (string)
additionalItems (JSONSchemaPropsOrBool)
JSONSchemaPropsOrBool 表示 JSONSchemaProps 或布尔值。布尔属性默认为 true。
additionalProperties (JSONSchemaPropsOrBool)
JSONSchemaPropsOrBool 表示 JSONSchemaProps 或布尔值。布尔属性默认为 true。
allOf ([]JSONSchemaProps)
anyOf ([]JSONSchemaProps)
default (JSON)
default 是未定义对象字段的默认值。设置默认值操作是 CustomResourceDefaulting 特性门控所控制的一个 Beta 特性。 应用默认值设置时要求 spec.preserveUnknownFields 为 false。
JSON 表示任何有效的 JSON 值。支持以下类型:bool、int64、float64、string、[]interface{}、map[string]interface{} 和 nil。
definitions (map[string]JSONSchemaProps)
dependencies (map[string]JSONSchemaPropsOrStringArray)
JSONSchemaPropsOrStringArray 表示 JSONSchemaProps 或字符串数组。
description (string)
enum ([]JSON)
JSON 表示任何有效的 JSON 值。支持以下类型:bool、int64、float64、string、[]interface{}、map[string]interface{} 和 nil。
example (JSON)
JSON 表示任何有效的 JSON 值。支持以下类型:bool、int64、float64、string、[]interface{}、map[string]interface{} 和 nil。
exclusiveMaximum (boolean)
exclusiveMinimum (boolean)
externalDocs (ExternalDocumentation)
ExternalDocumentation 允许引用外部资源作为扩展文档。
externalDocs.description (string)
externalDocs.url (string)
format (string)
format 是 OpenAPI v3 格式字符串。未知格式将被忽略。以下格式会被验证合法性:
id (string)
items (JSONSchemaPropsOrArray)
JSONSchemaPropsOrArray 表示可以是 JSONSchemaProps 或 JSONSchemaProps 数组的值。这里目的主要用于序列化。
maxItems (int64)
maxLength (int64)
maxProperties (int64)
maximum (double)
minItems (int64)
minLength (int64)
minProperties (int64)
minimum (double)
multipleOf (double)
not (JSONSchemaProps)
nullable (boolean)
oneOf ([]JSONSchemaProps)
pattern (string)
patternProperties (map[string]JSONSchemaProps)
properties (map[string]JSONSchemaProps)
required ([]string)
title (string)
type (string)
uniqueItems (boolean)
x-kubernetes-embedded-resource (boolean)
x-kubernetes-embedded-resource 定义该值是一个嵌入式 Kubernetes runtime.Object,具有 TypeMeta 和 ObjectMeta。 类型必须是对象。允许进一步限制嵌入对象。会自动验证 kind、apiVersion 和 metadata 等字段值。 x-kubernetes-preserve-unknown-fields 允许为 true,但如果对象已完全指定 (除 kind、apiVersion、metadata 之外),则不必为 true。
x-kubernetes-int-or-string (boolean)
x-kubernetes-int-or-string 指定此值是整数或字符串。如果为 true,则允许使用空类型, 并且如果遵循以下模式之一,则允许作为 anyOf 的子类型:
x-kubernetes-list-map-keys ([]string)
X-kubernetes-list-map-keys 通过指定用作 map 索引的键来使用 x-kubernetes-list-type map
注解数组。
这个标签必须只用于 "x-kubernetes-list-type" 扩展设置为 "map" 的列表。 而且,为这个属性指定的值必须是子结构的标量类型的字段(不支持嵌套)。
指定的属性必须是必需的或具有默认值,以确保所有列表项都存在这些属性。
x-kubernetes-list-type (string)
x-kubernetes-list-type 注解一个数组以进一步描述其拓扑。此扩展名只能用于列表,并且可能有 3 个可能的值:
atomic
:
列表被视为单个实体,就像标量一样。原子列表在更新时将被完全替换。这个扩展可以用于任何类型的列表(结构,标量,…)。set
:
set 是不能有多个具有相同值的列表。每个值必须是标量、具有 x-kubernetes-map-type
atomic
的对象或具有 x-kubernetes-list-type atomic
的数组。map
:
这些列表类似于映射表,因为它们的元素具有用于标识它们的非索引键。合并时保留顺序。
map 标记只能用于元数类型为 object 的列表。
数组默认为原子数组。x-kubernetes-map-type (string)
x-kubernetes-map-type 注解一个对象以进一步描述其拓扑。此扩展只能在 type 为 object 时使用,并且可能有 2 个可能的值:
granular
:
这些 map 是真实的映射(键值对),每个字段都是相互独立的(它们都可以由不同的角色来操作)。
这是所有 map 的默认行为。atomic
:map 被视为单个实体,就像标量一样。原子 map 更新后将被完全替换。x-kubernetes-preserve-unknown-fields (boolean)
x-kubernetes-preserve-unknown-fields 针对未在验证模式中指定的字段,禁止 API 服务器的解码步骤剪除这些字段。 这一设置对字段的影响是递归的,但在模式中指定了嵌套 properties 或 additionalProperties 时,会切换回正常的字段剪除行为。 该值可为 true 或 undefined,不能为 false。
x-kubernetes-validations ([]ValidationRule)
补丁策略:基于键 rule
合并
Map:合并时将保留 rule 键的唯一值
x-kubernetes-validations 描述了用 CEL 表达式语言编写的验证规则列表。此字段是 Alpha 级别。
使用此字段需要启用 CustomResourceValidationExpressions
特性门控。
ValidationRule 描述用 CEL 表达式语言编写的验证规则。
x-kubernetes-validations.rule (string),必需
rule 表示将由 CEL 评估的表达式。参考: https://github.com/google/cel-spec。
rule 的作用域为模式中的 x-kubernetes-validation 扩展所在的位置。CEL 表达式中的 self
与作用域值绑定。
例子:rule 的作用域是一个具有状态子资源的资源根:{"rule": "self.status.actual <= self.spec.maxDesired"}。
如果 rule 的作用域是一个带有属性的对象,那么该对象的可访问属性是通过 self
进行字段选择的,
并且可以通过 has(self.field)
来检查字段是否存在。在 CEL 表达式中,Null 字段被视为不存在的字段。
如果该 rule 的作用域是一个带有附加属性的对象(例如一个 map),那么该 map 的值可以通过
self[mapKey]
来访问,map 是否包含某主键可以通过 mapKey in self
来检查。
map 中的所有条目都可以通过 CEL 宏和函数(如 self.all(...)
)访问。
如果 rule 的作用域是一个数组,数组的元素可以通过 self[i]
访问,也可以通过宏和函数访问。
如果 rule 的作用域为标量,self
绑定到标量值。举例:
apiVersion
, kind
, metadata.name
和 metadata.generateName
总是可以从对象的根和任何带
x-kubernetes-embedded-resource 注解的对象访问。其他元数据属性都无法访问。
在 CEL 表达式中无法访问通过 x-kubernetes-preserve-unknown-fields 保存在自定义资源中的未知数据。 这包括:
由包含 x-kubernetes-preserve-unknown-fields 的对象模式所保留的未知字段值;
属性模式为 "未知类型" 的对象属性。"未知类型" 递归定义为:
只有名称符合正则表达式 [a-zA-Z_.-/][a-zA-Z0-9_.-/]*
的属性才可被访问。
在表达式中访问属性时,可访问的属性名称根据以下规则进行转义:
'__' 转义为 'underscores'
'.' 转义为 'dot'
'-' 转义为 'dash'
'/' 转义为 'slash'
恰好匹配 CEL 保留关键字的属性名称转义为 '{keyword}' 。这里的关键字具体包括: "true","false","null","in","as","break","const","continue","else","for","function","if", "import","let","loop","package","namespace","return"。 举例:
{"rule": "self.__namespace__ > 0"}
{"rule": "self.x__dash__prop > 0"}
{"rule": "self.redact__underscores__d > 0"}
对 x-kubernetes-list-type 为 'set' 或 'map' 的数组进行比较时忽略元素顺序,如:[1, 2] == [2, 1]。 使用 x-kubernetes-list-type 对数组进行串接使用下列类型的语义:
X + Y
执行合并,其中 X
保留所有元素的数组位置,并附加不相交的元素 Y
,保留其局部顺序。X + Y
执行合并,保留 X
中所有键的数组位置,但当 X
和 Y
的键集相交时,会被 Y
中的值覆盖。
添加 Y
中具有不相交键的元素,保持其局顺序。x-kubernetes-validations.message (string)
message 表示验证失败时显示的消息。如果规则包含换行符,则需要该消息。消息不能包含换行符。 如果未设置,则消息为 "failed rule: {Rule}",如:"must be a URL with the host matching spec.host"
CustomResourceDefinitionStatus 表示 CustomResourceDefinition 的状态
acceptedNames (CustomResourceDefinitionNames)
acceptedNames 是实际用于服务发现的名称。它们可能与规约(spec)中的名称不同。
CustomResourceDefinitionNames 表示提供此 CustomResourceDefinition 资源的名称
acceptedNames.kind (string),必需
kind 是资源的序列化类型。它通常是驼峰命名的单数形式。自定义资源实例将使用此值作为 API 调用中的 kind
属性。
acceptedNames.plural (string), required
plural 是所提供的资源的复数名称,自定义资源在 /apis/<group>/<version>/.../<plural>
下提供。
必须与 CustomResourceDefinition 的名称匹配(格式为 <names.plural>.<group>
)。必须全部小写。
acceptedNames.categories ([]string)
categories 是此自定义资源所属的分组资源列表(例如 'all')。
它在 API 发现文档中发布,并被客户端用于支持像 kubectl get all
这样的调用。
acceptedNames.listKind (string)
listKind 是此资源列表的序列化类型。默认为 "<kind>List
"。
acceptedNames.shortNames ([]string)
shortNames 是资源的短名称,在 API 发现文档中公开,并支持客户端调用,如 kubectl get <shortname>
。必须全部小写。
acceptedNames.singular (string)
singular 是资源的单数名称。必须全部小写。默认为小写形式的 kind
。
conditions ([]CustomResourceDefinitionCondition)
Map:合并时将保留 type 键的唯一值
conditions 表示 CustomResourceDefinition 特定方面的状态
CustomResourceDefinitionCondition 包含此 Pod 当前状况的详细信息。
conditions.status (string),必需
status 表示状况(Condition)的状态,取值为 True、False 或 Unknown 之一。
conditions.type (string),必需
type 是状况的类型。类型包括:Established、NamesAccepted 和 Terminating。
conditions.lastTransitionTime (Time)
lastTransitionTime 是上一次发生状况状态转换的时间。
Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。为 time 包的许多函数方法提供了封装器。
conditions.message (string)
message 是有关上次转换的详细可读信息。
conditions.reason (string)
reason 表述状况上次转换原因的、驼峰格式命名的、唯一的一个词。
storedVersions ([]string)
storedVersions 列出了曾经被持久化的所有 CustomResources 版本。跟踪这些版本可以为 etcd 中的存储版本提供迁移路径。
该字段是可变的,因此迁移控制器可以完成到另一个版本的迁移(确保存储中没有遗留旧对象),然后从该列表中删除其余版本。
当版本在此列表中时,则不能从 spec.versions
中删除。
CustomResourceDefinitionList 是 CustomResourceDefinition 对象的列表。
items ([]CustomResourceDefinition),必需
items 列出单个 CustomResourceDefinition 对象
apiVersion (string)
apiVersion 定义对象表示的版本化模式。服务器应将已识别的模式转换为最新的内部值,并可能拒绝未识别的值。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
kind (string)
kind 是一个字符串值,表示该对象所表示的 REST 资源。服务器可以从客户端提交请求的端点推断出 REST 资源。不能被更新。驼峰命名。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
metadata (ListMeta)
标准的对象元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
get
读取指定的 CustomResourceDefinitionGET /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}
name (路径参数):string,必需
CustomResourceDefinition 的名称
pretty (查询参数):string
200 (CustomResourceDefinition): OK
401: Unauthorized
get
读取指定 CustomResourceDefinition 的状态GET /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status
name (路径参数):string,必需
CustomResourceDefinition 的名称
pretty (查询参数):string
200 (CustomResourceDefinition): OK
401: Unauthorized
list
列出或观察 CustomResourceDefinition 类型的对象GET /apis/apiextensions.k8s.io/v1/customresourcedefinitions
allowWatchBookmarks (查询参数):boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
watch (查询参数):boolean
200 (CustomResourceDefinitionList): OK
401: Unauthorized
create
创建一个 CustomResourceDefinitionPOST /apis/apiextensions.k8s.io/v1/customresourcedefinitions
body: CustomResourceDefinition,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (CustomResourceDefinition): OK
201 (CustomResourceDefinition): Created
202 (CustomResourceDefinition): Accepted
401: Unauthorized
update
替换指定的 CustomResourceDefinitionPUT /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}
name (路径参数):string,必需
CustomResourceDefinition 的名称
body: CustomResourceDefinition,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (CustomResourceDefinition): OK
201 (CustomResourceDefinition): Created
401: Unauthorized
update
替换指定 CustomResourceDefinition 的状态PUT /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status
name (路径参数):string,必需
CustomResourceDefinition 的名称
body: CustomResourceDefinition,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (CustomResourceDefinition): OK
201 (CustomResourceDefinition): Created
401: Unauthorized
patch
部分更新指定的 CustomResourceDefinitionPATCH /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}
name (路径参数):string,必需
CustomResourceDefinition 的名称
body: Patch,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty(查询参数):string
200 (CustomResourceDefinition): OK
201 (CustomResourceDefinition): Created
401: Unauthorized
patch
部分更新指定 CustomResourceDefinition 的状态PATCH /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}/status
name (路径参数):string,必需
CustomResourceDefinition 的名称
body: Patch,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty (查询参数):string
200 (CustomResourceDefinition): OK
201 (CustomResourceDefinition): Created
401: Unauthorized
delete
删除一个 CustomResourceDefinitionDELETE /apis/apiextensions.k8s.io/v1/customresourcedefinitions/{name}
name (路径参数):string,必需
CustomResourceDefinition 的名称
body: DeleteOptions
dryRun (查询参数):string
gracePeriodSeconds (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 CustomResourceDefinition 的集合DELETE /apis/apiextensions.k8s.io/v1/customresourcedefinitions
body: DeleteOptions
continue (查询参数):string
dryRun (查询参数):string
fieldSelector (查询参数):string
gracePeriodSeconds (查询参数):integer
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
200 (Status): OK
401: Unauthorized
apiVersion: admissionregistration.k8s.io/v1
import "k8s.io/api/admissionregistration/v1"
ValidatingWebhookConfiguration 描述准入 Webhook 的配置,该 Webhook 可在不更改对象的情况下接受或拒绝对象请求。
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata (ObjectMeta)
标准的对象元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata。
webhooks ([]ValidatingWebhook)
补丁策略:根据 name
键执行合并操作
webhooks 是 Webhook 以及受影响的资源和操作的列表。
ValidatingWebhook 描述了一个准入 Webhook 及其适用的资源和操作。
webhooks.admissionReviewVersions ([]string), 必需
admissionReviewVersions 是 Webhook 期望的首选 AdmissionReview
版本的有序列表。
API 服务器将尝试使用它支持的列表中的第一个版本。如果 API 服务器不支持此列表中指定的版本,则此对象将验证失败。
如果持久化的 Webhook 配置指定了允许的版本,并且不包括 API 服务器已知的任何版本,则对 Webhook 的调用将失败并受失败策略的约束。
webhooks.clientConfig (WebhookClientConfig), 必需
clientConfig 定义了如何与 Webhook 通信。必需。
WebhookClientConfig 包含与 Webhook 建立 TLS 连接的信息
webhooks.clientConfig.caBundle ([]byte)
caBundle
是一个 PEM 编码的 CA 包,将用于验证 Webhook 的服务证书。如果未指定,则使用 apiserver 上的系统信任根。
webhooks.clientConfig.service (ServiceReference)
service
是对此 Webhook 服务的引用。必须指定 service
或 url
。
如果 Webhook 在集群中运行,那么你应该使用 service
。
ServiceReference 持有对 Service.legacy.k8s.io 的引用
webhooks.clientConfig.service.name (string), 必需
name
是服务的名称。必需。
webhooks.clientConfig.service.namespace (string), 必需
namespace
是服务的命名空间。必需。
webhooks.clientConfig.service.path (string)
path
是一个可选的 URL 路径,它将发送任何请求到此服务。
webhooks.clientConfig.service.port (int32)
如果指定,则为托管 Webhook 的服务上的端口。默认为 443 以实现向后兼容性。port
应该是一个有效的端口号(包括 1-65535)。
webhooks.clientConfig.url (string)
url
以标准 URL 形式(scheme://host:port/path
)给出了 Webhook 的位置。必须指定 url
或 service
中的一个。
host
不应指代在集群中运行的服务;请改用 service
字段。在某些 apiserver 中,可能会通过外部 DNS 解析 host
。
(例如,kube-apiserver
无法解析集群内 DNS,因为这会违反分层原理)。host
也可以是 IP 地址。
请注意,使用 localhost
或 127.0.0.1
作为 host
是有风险的,除非你非常小心地在运行 apiserver 的所有主机上运行此 Webhook,
而这些 API 服务器可能需要调用此 Webhook。此类部署可能是不可移植的,即不容易在新集群中重复安装。
该方案必须是 “https”;URL 必须以 “https://” 开头。
路径是可选的,如果存在,可以是 URL 中允许的任何字符串。你可以使用路径将任意字符串传递给 Webhook,例如集群标识符。
不允许使用用户或基本身份验证,例如不允许使用 “user:password@”。 不允许使用片段(“#...”)和查询参数(“?...”)。
webhooks.name (string), 必需
准入 Webhook 的名称。应该是完全限定的名称,例如 imagepolicy.kubernetes.io,其中 “imagepolicy” 是 Webhook 的名称, kubernetes.io 是组织的名称。必需。
sideEffects 说明此 Webhook 是否有副作用。可接受的值为:None、NoneOnDryRun(通过 v1beta1 创建的 Webhook 也可以指定 Some 或 Unknown)。 具有副作用的 Webhook 必须实现协调系统,因为请求可能会被准入链中的未来步骤拒绝,因此需要能够撤消副作用。 如果请求与带有 sideEffects == Unknown 或 Some 的 Webhook 匹配,则带有 dryRun 属性的请求将被自动拒绝。
webhooks.failurePolicy (string)
failurePolicy 定义了如何处理来自准入端点的无法识别的错误 - 允许的值是 Ignore 或 Fail。默认为 Fail。
webhooks.matchPolicy (string)
matchPolicy 定义了如何使用 "rules" 列表来匹配传入的请求。允许的值为 "Exact" 或 "Equivalent"。
Exact: 仅当请求与指定规则完全匹配时才匹配请求。
例如,如果可以通过 apps/v1、apps/v1beta1 和 extensions/v1beta1 修改 deployments 资源,
但 “rules” 仅包含 apiGroups:["apps"]、apiVersions:["v1"]、resources:["deployments "]
,
对 apps/v1beta1 或 extensions/v1beta1 的请求不会被发送到 Webhook。
Equivalent: 如果针对的资源包含在 “rules” 中,即使是通过另一个 API 组或版本,也视作匹配请求。
例如,如果可以通过 apps/v1、apps/v1beta1 和 extensions/v1beta1 修改 deployments 资源,
并且 “rules” 仅包含 apiGroups:["apps"]、apiVersions:["v1"]、resources:["deployments "]
,
对 apps/v1beta1 或 extensions/v1beta1 的请求将被转换为 apps/v1 并发送到 Webhook。
默认为 “Equivalent”。
webhooks.namespaceSelector (LabelSelector)
namespaceSelector 根据对象的命名空间是否与 selector 匹配来决定是否在该对象上运行 Webhook。
如果对象本身是命名空间,则在 object.metadata.labels 上执行匹配。 如果对象是另一个集群范围的资源,则永远不会跳过 Webhook 执行匹配。
例如,在命名空间与 “0” 或 “1” 的 “runlevel” 不关联的任何对象上运行 Webhook; 你可以按如下方式设置 selector :
"namespaceSelector": {
"matchExpressions": [
{
"key": "runlevel",
"operator": "NotIn",
"values": [
"0",
"1"
]
}
]
}
相反,如果你只想在命名空间与 “prod” 或 “staging” 的 “environment” 相关联的对象上运行 Webhook;
你可以按如下方式设置 selector:
"namespaceSelector": {
"matchExpressions": [
{
"key": "environment",
"operator": "In",
"values": [
"prod",
"staging"
]
}
]
}
有关标签选择算符的更多示例,请参阅
https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/labels。
默认为空的 LabelSelector,匹配所有对象。
webhooks.objectSelector (LabelSelector)
objectSelector 根据对象是否具有匹配的标签来决定是否运行 Webhook。 objectSelector 针对将被发送到 Webhook 的 oldObject 和 newObject 进行评估,如果任一对象与选择器匹配,则视为匹配。 空对象(create 时为 oldObject,delete 时为 newObject)或不能有标签的对象(如 DeploymentRollback 或 PodProxyOptions 对象) 认为是不匹配的。 仅当 Webhook 支持时才能使用对象选择器,因为最终用户可以通过设置标签来跳过准入 webhook。 默认为空的 LabelSelector,匹配所有内容。
webhooks.rules ([]RuleWithOperations)
rules 描述了 Webhook 关心的资源/子资源上有哪些操作。Webhook 关心操作是否匹配任何rules。 但是,为了防止 ValidatingAdmissionWebhooks 和 MutatingAdmissionWebhooks 将集群置于只能完全禁用插件才能恢复的状态, ValidatingAdmissionWebhooks 和 MutatingAdmissionWebhooks 永远不会在处理 ValidatingWebhookConfiguration 和 MutatingWebhookConfiguration 对象的准入请求被调用。
RuleWithOperations 是操作和资源的元组。建议确保所有元组组合都是有效的。
webhooks.rules.apiGroups ([]string)
apiGroups 是资源所属的 API 组列表。'' 是所有组。 如果存在 '',则列表的长度必须为 1。必需。
webhooks.rules.apiVersions ([]string)
apiVersions 是资源所属的 API 版本列表。'' 是所有版本。 如果存在 '',则列表的长度必须为 1。必需。
webhooks.rules.operations ([]string)
operations 是准入 Webhook 所关心的操作 —— CREATE、UPDATE、DELETE、CONNECT
或用来指代所有已知操作以及将来可能添加的准入操作的 *
。
如果存在 '*',则列表的长度必须为 1。必需。
webhooks.rules.resources ([]string)
resources 是此规则适用的资源列表。
'pods' 表示 pods,'pods/log' 表示 pods 的日志子资源。'' 表示所有资源,但不是子资源。 'pods/' 表示 pods 的所有子资源, '/scale' 表示所有 scale 子资源, '/*' 表示所有资源及其子资源。
如果存在通配符,则验证规则将确保资源不会相互重叠。
根据所指定的对象,可能不允许使用子资源。必需。
webhooks.rules.scope (string)
scope 指定此规则的范围。有效值为 "Cluster", "Namespaced" 和 ""。 "Cluster" 表示只有集群范围的资源才会匹配此规则。 Namespace API 对象是集群范围的。 "Namespaced" 意味着只有命名空间作用域的资源会匹配此规则。 "" 表示没有范围限制。 子资源与其父资源的作用域相同。默认为 "*"。
webhooks.timeoutSeconds (int32)
timeoutSeconds 指定此 Webhook 的超时时间。超时后,Webhook 的调用将被忽略或 API 调用将根据失败策略失败。 超时值必须在 1 到 30 秒之间。默认为 10 秒。
ValidatingWebhookConfigurationList 是 ValidatingWebhookConfiguration 的列表。
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfigurationList
metadata (ListMeta)
标准的对象元数据,更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds。
items ([]ValidatingWebhookConfiguration), 必需
ValidatingWebhookConfiguration 列表。
get
读取指定的 ValidatingWebhookConfigurationGET /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}
name (路径参数): string, 必需
ValidatingWebhookConfiguration 的名称。
pretty (查询参数): string
200 (ValidatingWebhookConfiguration): OK
401: Unauthorized
list
列出或观察 ValidatingWebhookConfiguration 类型的对象GET /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
fieldSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ValidatingWebhookConfigurationList): OK
401: Unauthorized
create
创建一个 ValidatingWebhookConfigurationPOST /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ValidatingWebhookConfiguration): OK
201 (ValidatingWebhookConfiguration): Created
202 (ValidatingWebhookConfiguration): Accepted
401: Unauthorized
update
替换指定的 ValidatingWebhookConfigurationPUT /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}
name (路径参数): string, 必需
ValidatingWebhookConfiguration 的名称。
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (ValidatingWebhookConfiguration): OK
201 (ValidatingWebhookConfiguration): Created
401: Unauthorized
patch
部分更新指定的 ValidatingWebhookConfigurationPATCH /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}
name (路径参数): string, 必需
ValidatingWebhookConfiguration 的名称。
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (ValidatingWebhookConfiguration): OK
201 (ValidatingWebhookConfiguration): Created
401: Unauthorized
delete
删除 ValidatingWebhookConfigurationDELETE /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations/{name}
name (路径参数): string, 必需
ValidatingWebhookConfiguration 的名称。
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 ValidatingWebhookConfiguration 的集合DELETE /apis/admissionregistration.k8s.io/v1/validatingwebhookconfigurations
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
Node 是 Kubernetes 中的工作节点。 每个节点在缓存中(即在 etcd 中)都有一个唯一的标识符。
apiVersion: v1
kind: Node
metadata (ObjectMeta)
标准的对象元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata 。
spec (NodeSpec)
spec 定义节点的行为。 https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 。
status (NodeStatus)
此节点的最近观测状态。由系统填充。只读。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status 。
NodeSpec 描述了创建节点时使用的属性。
configSource (NodeConfigSource)
已弃用:以前用于为 DynamicKubeletConfig 功能指定节点配置的来源。 自 1.24 的版本起,此功能已从 Kubelets 中移除,并将在 1.26 的版本中完全移除。
NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22的版本起已被弃用
configSource.configMap (ConfigMapNodeConfigSource)
configMap 是对 Node 的 ConfigMap 的引用。
ConfigMapNodeConfigSource 包含引用某 ConfigMap 作为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration
configSource.configMap.kubeletConfigKey (string), 必需
kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。
configSource.configMap.name (string), 必需
name 是被引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。
configSource.configMap.namespace (string), 必需
namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。
configSource.configMap.resourceVersion (string)
resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
configSource.configMap.uid (string)
uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
externalID (string)
已弃用。并非所有 kubelet 都会设置此字段。 1.13 的版本之后会删除该字段。见: https://issues.k8s.io/61966 。
podCIDR (string)
podCIDR 表示分配给节点的 Pod IP 范围。
podCIDRs ([]string)
podCIDRs 表示分配给节点以供该节点上的 Pod 使用的 IP 范围。 如果指定了该字段,则第 0 个条目必须与 podCIDR 字段匹配。 对于 IPv4 和 IPv6,它最多可以包含 1 个值。
providerID (string)
云提供商分配的节点ID,格式为:<ProviderName>://<ProviderSpecificNodeID>
taints ([]Taint)
如果设置了,则为节点的污点。
此污点附加到的节点对任何不容忍污点的 Pod 都有 “影响”。
必需的。污点对不容忍污点的 Pod 的影响。合法的 effect 值有 NoSchedule、PreferNoSchedule 和 NoExecute。
unschedulable (boolean)
unschedulable 控制新 Pod 的节点可调度性。 默认情况下,节点是可调度的。 更多信息: https://kubernetes.io/docs/concepts/nodes/node/#manual-node-administration 。
NodeStatus 是有关节点当前状态的信息。
addresses ([]NodeAddress)
补丁策略:根据 type
键执行合并操作
节点可到达的地址列表。从云提供商处查询(如果有)。 更多信息: https://kubernetes.io/docs/concepts/nodes/node/#addresses 。 注意:该字段声明为可合并,但合并键不够唯一,合并时可能导致数据损坏。 调用者应改为使用完全替换性质的补丁操作。 有关示例,请参见 http://pr.k8s.io/79391。
NodeAddress 包含节点地址的信息。
addresses.address (string), 必需
节点地址。
addresses.type (string), 必需
节点地址类型,Hostname、ExternalIP 或 InternalIP 之一。
allocatable (map[string]Quantity)
allocatable 表示节点的可用于调度的资源。默认为容量。
capacity (map[string]Quantity)
capacity 代表一个节点的总资源。 更多信息: https://kubernetes.io/docs/concepts/storage/persistent-volumes#capacity 。
conditions ([]NodeCondition)
补丁策略:根据 type
键执行合并操作
conditions 是当前观测到的节点状况的数组。 更多信息: https://kubernetes.io/docs/concepts/nodes/node/#condition 。
NodeCondition 包含节点状况的信息。
conditions.status (string), 必需
状况的状态为 True、False、Unknown 之一。
conditions.type (string), 必需
节点状况的类型。
conditions.lastHeartbeatTime (Time)
给定状况最近一次更新的时间。
Time 是 time.Time 的包装器,它支持对 YAML 和 JSON 的正确编组。 time 包的许多工厂方法提供了包装器。
conditions.lastTransitionTime (Time)
状况最近一次从一种状态转换到另一种状态的时间。
Time 是 time.Time 的包装器,它支持对 YAML 和 JSON 的正确编组。 time 包的许多工厂方法提供了包装器。
conditions.message (string)
指示有关上次转换详细信息的人类可读消息。
conditions.reason (string)
(简要)状况最后一次转换的原因。
config (NodeConfigStatus)
通过动态 Kubelet 配置功能分配给节点的配置状态。
NodeConfigStatus 描述了由 Node.spec.configSource 分配的配置的状态。
config.active (NodeConfigSource)
active 报告节点正在使用的检查点配置。 active 将代表已分配配置的当前版本或当前 LastKnownGood 配置,具体取决于尝试使用已分配配置是否会导致错误。
NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22 版本起已弃用
config.active.configMap (ConfigMapNodeConfigSource)
configMap 是对 Node 的 ConfigMap 的引用。
ConfigMapNodeConfigSource 包含引用某 ConfigMap 作为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration。
config.active.configMap.kubeletConfigKey (string), 必需
kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。
config.active.configMap.name (string), 必需
name 是所引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。
config.active.configMap.namespace (string), 必需
namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。
config.active.configMap.resourceVersion (string)
resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
config.active.configMap.uid (string)
uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
config.assigned (NodeConfigSource)
assigned 字段报告节点将尝试使用的检查点配置。 当 Node.spec.configSource 被更新时,节点将所关联的配置负载及指示预期配置的记录通过检查点操作加载到本地磁盘。 节点参考这条记录来选择它的配置检查点,并在 assigned 中报告这条记录。 仅在记录被保存到磁盘后才会更新 status 中的 assigned。 当 kubelet 重新启动时,它会尝试通过加载和验证由 assigned 标识的检查点有效负载来使 assigned 配置成为 active 配置。
NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22 版本起已弃用
config.assigned.configMap (ConfigMapNodeConfigSource)
configMap 是对 Node 的 ConfigMap 的引用。
ConfigMapNodeConfigSource 包含引用某 ConfigMap 为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration。
config.assigned.configMap.kubeletConfigKey (string), 必需
kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。
config.assigned.configMap.name (string), 必需
name 是所引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。
config.assigned.configMap.namespace (string), 必需
namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。
config.assigned.configMap.resourceVersion (string)
resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
config.assigned.configMap.uid (string)
uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
config.error (string)
error 描述了在 spec.configSource 与活动配置间协调时发生的所有问题。 可能会发生的情况,例如,尝试将 spec.configSource 通过检查点操作复制到到本地 assigned 记录时, 尝试对与 spec.configSource 关联的有效负载执行检查点操作,尝试加载或验证 assigned 的配置时。 同步配置时可能会在不同位置发生错误,较早的错误(例如下载或检查点错误)不会导致回滚到 LastKnownGood, 并且可能会在 Kubelet 重试后解决。 后期发生的错误(例如加载或验证检查点配置)将导致回滚到 LastKnownGood。 在后一种情况下,通常可以通过修复 spec.sonfigSource 中 assigned 配置来解决错误。 你可以通过在 Kubelet 日志中搜索错误消息来找到更多的调试信息。 error 是错误状态的人类可读描述;机器可以检查 error 是否为空,但不应依赖跨 Kubelet 版本的 error 文本的稳定性。
config.lastKnownGood (NodeConfigSource)
lastKnownGood 报告节点在尝试使用 assigned 配置时遇到错误时将回退到的检查点配置。 当节点确定 assigned 配置稳定且正确时,assigned 配置会成为 lastKnownGood 配置。 这当前实施为从更新分配配置的本地记录开始的 10 分钟浸泡期。 如果在此期间结束时分配的配置依旧处于活动状态,则它将成为 lastKnownGood。 请注意,如果 spec.configSource 重置为 nil(使用本地默认值), LastKnownGood 也会立即重置为 nil,因为始终假定本地默认配置是好的。 你不应该对节点确定配置稳定性和正确性的方法做出假设,因为这可能会在将来发生变化或变得可配置。
NodeConfigSource 指定节点配置的来源。指定一个子字段(不包括元数据)必须为非空。此 API 自 1.22 版本起已弃用
config.lastKnownGood.configMap (ConfigMapNodeConfigSource)
configMap 是对 Node 的 ConfigMap 的引用。
ConfigMapNodeConfigSource 包含引用某 ConfigMap 作为节点配置源的信息。 此 API 自 1.22 版本起已被弃用: https://git.k8s.io/enhancements/keps/sig-node/281-dynamic-kubelet-configuration 。
config.lastKnownGood.configMap.kubeletConfigKey (string), 必需
kubeletConfigKey 声明所引用的 ConfigMap 的哪个键对应于 KubeletConfiguration 结构体, 该字段在所有情况下都是必需的。
config.lastKnownGood.configMap.name (string), 必需
name 是所引用的 ConfigMap 的 metadata.name。 此字段在所有情况下都是必需的。
namespace 是所引用的 ConfigMap 的 metadata.namespace。 此字段在所有情况下都是必需的。
config.lastKnownGood.configMap.resourceVersion (string)
resourceVersion 是所引用的 ConfigMap 的 metadata.resourceVersion。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
config.lastKnownGood.configMap.uid (string)
uid 是所引用的 ConfigMap 的 metadata.uid。 该字段在 Node.spec 中是禁止的,在 Node.status 中是必需的。
daemonEndpoints (NodeDaemonEndpoints)
在节点上运行的守护进程的端点。
NodeDaemonEndpoints 列出了节点上运行的守护进程打开的端口。
images ([]ContainerImage)
该节点上的容器镜像列表。
描述一个容器镜像
images.names ([]string)
已知此镜像的名称。 例如 ["k8s.gcr.io/hyperkube:v1.0.7", "dockerhub.io/google_containers/hyperkube:v1.0.7"]
images.sizeBytes (int64)
镜像的大小(以字节为单位)。
nodeInfo (NodeSystemInfo)
用于唯一标识节点的 ids/uuids 集。 更多信息: https://kubernetes.io/docs/concepts/nodes/node/#info 。
NodeSystemInfo 是一组用于唯一标识节点的 ids/uuids。
nodeInfo.architecture (string), 必需
节点报告的 architecture。
节点报告的 bootID。
nodeInfo.containerRuntimeVersion (string), 必需
节点通过运行时远程 API 报告的 ContainerRuntime 版本(例如 containerd://1.4.2)。
nodeInfo.kernelVersion (string), 必需
节点来自 “uname -r” 报告的内核版本(例如 3.16.0-0.bpo.4-amd64)。
nodeInfo.kubeProxyVersion (string), 必需
节点报告的 KubeProxy 版本。
nodeInfo.kubeletVersion (string), 必需
节点报告的 Kubelet 版本。
nodeInfo.machineID (string), 必需
节点上报的 machineID。 对于集群中的唯一机器标识,此字段是首选。 从 man(5) machine-id 了解更多信息: http://man7.org/linux/man-pages/man5/machine-id.5.html 。
节点上报的操作系统。
nodeInfo.osImage (string), 必需
节点从 /etc/os-release 报告的操作系统映像(例如 Debian GNU/Linux 7 (wheezy))。
nodeInfo.systemUUID (string), 必需
节点报告的 systemUUID。 对于唯一的机器标识 MachineID 是首选。 此字段特定于 Red Hat 主机 https://access.redhat.com/documentation/en-us/red_hat_subscription_management/1/html/rhsm/uuid 。
phase (string)
NodePhase 是最近观测到的节点的生命周期阶段。 更多信息: https://kubernetes.io/docs/concepts/nodes/node/#phase 该字段从未填充,现在已被弃用。
volumesAttached ([]AttachedVolume)
附加到节点的卷的列表。
AttachedVolume 描述附加到节点的卷
devicePath 表示卷应该可用的设备路径。
volumesAttached.name (string), 必需
附加卷的名称。
volumesInUse ([]string)
节点正在使用(安装)的可附加卷的列表。
NodeList 是已注册到 master 的所有节点的完整列表。
apiVersion: v1
kind: NodeList
metadata (ListMeta)
标准的列表元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 。
items ([]Node), 必需
节点的列表。
get
读取指定节点GET /api/v1/nodes/{name}
name (路径参数): string, 必需
节点的名称。
pretty (路径参数): string
200 (Node): OK
401: Unauthorized
get
读取指定节点的状态GET /api/v1/nodes/{name}/status
name (路径参数): string, 必需
节点的名称。
pretty (查询参数): string
200 (Node): OK
401: Unauthorized
list
列出或监视节点类型的对象GET /api/v1/nodes
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (NodeList): OK
401: Unauthorized
create
创建一个节点POST /api/v1/nodes
body: Node, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Node): OK
201 (Node): Created
202 (Node): Accepted
401: Unauthorized
update
替换指定节点PUT /api/v1/nodes/{name}
name (路径参数): string, 必需
节点的名称。
body: Node, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Node): OK
201 (Node): Created
401: Unauthorized
update
替换指定节点的状态PUT /api/v1/nodes/{name}/status
name (路径参数): string, 必需
节点的名称。
body: Node, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Node): OK
201 (Node): Created
401: Unauthorized
patch
部分更新指定节点PATCH /api/v1/nodes/{name}
name (路径参数): string, 必需
节点的名称。
body: Patch, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (Node): OK
201 (Node): Created
401: Unauthorized
patch
部分更新指定节点的状态PATCH /api/v1/nodes/{name}/status
name (路径参数): string, 必需
节点的名称。
body: Patch, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (Node): OK
201 (Node): Created
401: Unauthorized
delete
删除一个节点DELETE /api/v1/nodes/{name}
name (路径参数): string, 必需
节点的名称。
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除节点的集合DELETE /api/v1/nodes
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
Namespace 为名字提供作用域。使用多个命名空间是可选的。
apiVersion: v1
kind: Namespace
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (NamespaceSpec)
spec 定义了 Namespace 的行为。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (NamespaceStatus)
status 描述了当前 Namespace 的状态。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
NamespaceSpec 用于描述 Namespace 的属性。
NamespaceStatus 表示 Namespace 的当前状态信息。
conditions ([]NamespaceCondition)
补丁策略:基于 type
健合并
表示命名空间当前状态的最新可用状况。
NamespaceCondition 包含命名空间状态的详细信息。
conditions.status (string),必需
状况(condition)的状态,取值为 True、False 或 Unknown 之一。
命名空间控制器状况的类型。
phase (string)
phase 是命名空间的当前生命周期阶段。更多信息: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
NamespaceList 是一个命名空间列表。
apiVersion: v1
kind: NamespaceList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]Namespace),必需
items 是列表中的 Namespace 对象列表。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
get
读取指定的 NamespaceGET /api/v1/namespaces/{name}
name (路径参数):string,必需
Namespace 的名称
pretty (查询参数):string
200 (Namespace):OK
401:Unauthorized
get
读取指定 Namespace 的状态GET /api/v1/namespaces/{name}/status
name (路径参数):string,必需
Namespace 的名称
pretty (查询参数):string
200 (Namespace):OK
401:Unauthorized
list
列出或者检查类别为 Namespace 的对象GET /api/v1/namespaces
allowWatchBookmarks (查询参数):boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
watch (查询参数):boolean
200 (NamespaceList):OK
401:Unauthorized
create
创建一个 NamespacePOST /api/v1/namespaces
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (Namespace):OK
201 (Namespace):Created
202 (Namespace):Accepted
401:Unauthorized
update
替换指定的 NamespacePUT /api/v1/namespaces/{name}
name (路径参数):string,必需
Namespace 的名称
body: Namespace, 必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (Namespace):OK
201 (Namespace):Created
401:Unauthorized
update
替换指定 Namespace 的终结器PUT /api/v1/namespaces/{name}/finalize
name (路径参数):string,必需
Namespace 的名称
body: Namespace,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (Namespace):OK
201 (Namespace):Created
401:Unauthorized
update
替换指定 Namespace 的状态PUT /api/v1/namespaces/{name}/status
name (路径阐述):string,必需
Namespace 的名称
body: Namespace,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (Namespace):OK
201 (Namespace):Created
401: Unauthorized
patch
部分更新指定的 NamespacePATCH /api/v1/namespaces/{name}
name (路径参数):string,必需
Namespace 的名称
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty (查询参数): string
200 (Namespace):OK
201 (Namespace):Created
401: Unauthorized
patch
部分更新指定 Namespace 的状态PATCH /api/v1/namespaces/{name}/status
name (路径参数):string,必需
Namespace 的名称
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数): boolean
pretty (查询参数):string
200 (Namespace):OK
201 (Namespace):Created
401:Unauthorized
delete
删除一个 NamespaceDELETE /api/v1/namespaces/{name}
name (路径参数):string,必需
Namespace 的名称
body: DeleteOptions
dryRun (查询参数):string
gracePeriodSeconds (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
200 (Status):OK
202 (Status):Accepted
401:Unauthorized
apiVersion: events.k8s.io/v1
import "k8s.io/api/events/v1"
Event 是集群中某个事件的报告。它一般表示系统的某些状态变化。 Event 的保留时间有限,触发器和消息可能会随着时间的推移而演变。 事件消费者不应假定给定原因的事件的时间所反映的是一致的下层触发因素,或具有该原因的事件的持续存在。 Events 应被视为通知性质的、尽最大努力而提供的补充数据。
apiVersion: events.k8s.io/v1
kind: Event
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
eventTime (MicroTime),必需
evenTime 是该事件首次被观察到的时间。它是必需的。
MicroTime 是微秒级精度的 Time 版本
action (string)
action 是针对相关对象所采取的或已失败的动作。字段值是机器可读的。对于新的 Event,此字段不能为空, 且最多为 128 个字符。
deprecatedCount (int32)
deprecatedCount 是确保与 core.v1 Event 类型向后兼容的已弃用字段。
deprecatedFirstTimestamp (Time)
deprecatedFirstTimestamp 是确保与 core.v1 Event 类型向后兼容的已弃用字段。
Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。为 time 包的许多函数方法提供了封装器。
deprecatedLastTimestamp (Time)
deprecatedLastTimestamp 是确保与 core.v1 Event 类型向后兼容的已弃用字段。
Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。为 time 包的许多函数方法提供了封装器。
deprecatedSource (EventSource)
deprecatedSource 是确保与 core.v1 Event 类型向后兼容的已弃用字段。
EventSource 包含事件信息。
deprecatedSource.component (string)
生成事件的组件。
deprecatedSource.host (string)
产生事件的节点名称。
note (string)
node 是对该操作状态的可读描述。注释的最大长度是 1kB,但是库应该准备好处理最多 64kB 的值。
reason (string)
reason 是采取行动的原因。它是人类可读的。对于新的 Event,此字段不能为空,且最多为128个字符。
regarding (ObjectReference)
关于包含此 Event 所涉及的对象。在大多数情况下,所指的是报告事件的控制器所实现的一个 Object。 例如 ReplicaSetController 实现了 ReplicaSet,这个事件被触发是因为控制器对 ReplicaSet 对象做了一些变化。
related (ObjectReference)
related 是用于更复杂操作的、可选的、从属性的对象。例如,当 regarding 对象触发 related 对象的创建或删除时。
reportingController (string)
reportingController 是触发该事件的控制器的名称,例如 kubernetes.io/kubelet
。对于新的 Event,此字段不能为空。
reportingInstance (string)
reportingInstance 为控制器实例的 ID,例如 kubelet-xyzf
。对于新的 Event,此字段不能为空,且最多为 128 个字符。
series (EventSeries)
series 是该事件代表的事件系列的数据,如果是单事件,则为 nil。
EventSeries 包含一系列事件的信息,即一段时间内持续发生的事情。 EventSeries 的更新频率由事件报告者决定。 默认事件报告程序在 "k8s.io/client-go/tools/events/event_broadcaster.go" 展示在发生心跳时该结构如何被更新,可以指导定制的报告者实现。
series.count (int32),必需
count 是到最后一次心跳时间为止在该系列中出现的次数。
type (string)
type 是该事件的类型(Normal、Warning),未来可能会添加新的类型。字段值是机器可读的。 对于新的 Event,此字段不能为空。
EventList 是一个 Event 对象列表。
apiVersion: events.k8s.io/v1
kind: EventList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]Event),必需
items 是模式(Schema)对象的列表。
get
读取特定 EventGET /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}
name (路径参数):string,必需
Event 名称
namespace (路径参数):string,必需
pretty (路径参数):string
200 (Event): OK
401: Unauthorized
list
列出或观察事件类型对象GET /apis/events.k8s.io/v1/namespaces/{namespace}/events
namespace (路径参数):string,必需
allowWatchBookmarks (查询参数):boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
watch (查询参数):boolean
200 (EventList): OK
401: Unauthorized
list
列出或观察事件类型对象GET /apis/events.k8s.io/v1/events
allowWatchBookmarks (查询参数):boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
watch (查询参数):boolean
200 (EventList): OK
401: Unauthorized
create
创建一个 EventPOST /apis/events.k8s.io/v1/namespaces/{namespace}/events
namespace (查询参数):string,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (Event): OK
201 (Event): Created
202 (Event): Accepted
401: Unauthorized
update
替换指定 EventPUT /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}
name (路径参数):string,必需
Event 名称
namespace (路径参数):string,必需
dryRun (查询参数):必需
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (Event): OK
201 (Event): Created
401: Unauthorized
patch
部分更新指定的 EventPATCH /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}
name (路径参数):string,必需
Event 名称
namespace (路径参数):string,必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty (查询参数):string
200 (Event): OK
201 (Event): Created
401: Unauthorized
delete
删除 EventDELETE /apis/events.k8s.io/v1/namespaces/{namespace}/events/{name}
name (路径参数):string,必需
Event 名称
namespace (路径参数):string,必需
body: DeleteOptions
dryRun (查询参数):string
gracePeriodSeconds (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 Event 集合DELETE /apis/events.k8s.io/v1/namespaces/{namespace}/events
namespace (in path):string,必需
body: DeleteOptions
continue (查询参数):string
dryRun (查询参数):string
fieldSelector (查询参数):string
gracePeriodSeconds (查询参数):integer
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
200 (Status): OK
401: Unauthorized
apiVersion: apiregistration.k8s.io/v1
import "k8s.io/kube-aggregator/pkg/apis/apiregistration/v1"
APIService 是用来表示一个特定的 GroupVersion 的服务器。名称必须为 "version.group"。
apiVersion: apiregistration.k8s.io/v1
kind: APIService
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (APIServiceSpec)
spec 包含用于定位和与服务器通信的信息
status (APIServiceStatus)
status 包含某 API 服务器的派生信息
APIServiceSpec 包含用于定位和与服务器通信的信息。仅支持 HTTPS 协议,但是你可以禁用证书验证。
groupPriorityMinimum (int32), 必需
groupPriorityMininum 是这个组至少应该具有的优先级。优先级高表示客户端优先选择该组。
请注意,该组的其他版本可能会指定更高的 groupPriorityMininum 值,使得整个组获得更高的优先级。
主排序基于 groupPriorityMinimum 值,从高到低排序(20 在 10 之前)。
次要排序基于对象名称的字母顺序(v1.bar 在 v1.foo 之前)。
我们建议这样配置:*.k8s.io
(扩展除外)值设置为 18000,PaaS(OpenShift、Deis)建议值为 2000 左右。
versionPriority (int32), 必需
versionPriority 控制该 API 版本在其组中的排序,必须大于零。主排序基于 versionPriority, 从高到低排序(20 在 10 之前)。因为在同一个组里,这个数字可以很小,可能是几十。 在版本优先级相等的情况下,版本字符串将被用来计算组内的顺序。如果版本字符串是与 Kubernetes 的版本号形式类似, 则它将排序在 Kubernetes 形式版本字符串之前。Kubernetes 的版本号字符串按字典顺序排列。 Kubernetes 版本号以 “v” 字符开头,后面是一个数字(主版本),然后是可选字符串 “alpha” 或 “beta” 和另一个数字(次要版本)。 它们首先按 GA > beta > alpha 排序(其中 GA 是没有 beta 或 alpha 等后缀的版本),然后比较主要版本, 最后是比较次要版本。版本排序列表示例:v10、v2、v1、v11beta2、v10beta3、v3beta1、v12alpha1、v11alpha2、foo1、foo10。
caBundle ([]byte)
原子性:将在合并期间被替换
caBundle 是一个 PEM 编码的 CA 包,用于验证 API 服务器的服务证书。如果未指定, 则使用 API 服务器上的系统根证书。
group (string)
group 是此服务器主机的 API 组名称。
insecureSkipTLSVerify (boolean)
insecureSkipTLSVerify 代表在与此服务器通信时禁用 TLS 证书验证。强烈建议不要这样做。你应该使用 caBundle。
service (ServiceReference)
service 是对该 API 服务器的服务的引用。它只能在端口 443 上通信。如果 service 是 nil, 则意味着 API groupversion 的处理是在当前服务器上本地处理的。服务调用被直接委托给正常的处理程序链来完成。
ServiceReference 保存对 Service.legacy.k8s.io 的一个引用。
service.name (string)
name 是服务的名称
service.namespace (string)
namespace 是服务的命名空间
service.port (int32)
如果指定,则为托管 Webhook 的服务上的端口。为实现向后兼容,默认端口号为 443。
port
应该是一个有效的端口号(1-65535,包含)。
version (string)
version 是此服务器的 API 版本。例如:“v1”。
APIServiceStatus 包含有关 API 服务器的派生信息
conditions ([]APIServiceCondition)
补丁策略:基于键 type
合并
Map:合并时将保留 type 键的唯一值
APIService 的当前服务状态。
APIServiceCondition 描述 APIService 在特定点的状态
conditions.status (string), 必需
status 表示状况(Condition)的状态,取值为 True、False 或 Unknown 之一。
conditions.type (string), 必需
type 是状况的类型。
conditions.lastTransitionTime (Time)
上一次发生状况状态转换的时间。
Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。为 time 包的许多函数方法提供了封装器。
conditions.message (string)
指示上次转换的详细可读信息。
conditions.reason (string)
表述状况上次转换原因的、驼峰格式命名的、唯一的一个词。
APIServiceList 是 APIService 对象的列表。
apiVersion: apiregistration.k8s.io/v1
kind: APIServiceList
metadata (ListMeta)
标准的列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]APIService), 必需
items 是 APIService 的列表
get
读取指定的 APIServiceGET /apis/apiregistration.k8s.io/v1/apiservices/{name}
name (路径参数):string,必需
APIService 名称
pretty (查询参数):string
200 (APIService): OK
401: Unauthorized
get
读取指定 APIService 的状态GET /apis/apiregistration.k8s.io/v1/apiservices/{name}/status
name (路径参数):string,必需
APIService 名称
pretty (查询参数):string
200 (APIService): OK
401: Unauthorized
list
列出或观察 APIService 类的对象GET /apis/apiregistration.k8s.io/v1/apiservices
allowWatchBookmarks (查询参数):boolean
continue (查询参数):string
fieldSelector (查询参数):string
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
watch (查询参数):boolean
200 (APIServiceList): OK
401: Unauthorized
create
创建一个 APIServicePOST /apis/apiregistration.k8s.io/v1/apiservices
body:APIService, 必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (APIService): OK
201 (APIService): Created
202 (APIService): Accepted
401: Unauthorized
update
替换指定的 APIServicePUT /apis/apiregistration.k8s.io/v1/apiservices/{name}
name (路径参数):string, 必需
APIService 名称
body:APIService, 必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (APIService): OK
201 (APIService): Created
401: Unauthorized
update
替换指定 APIService 的 statusPUT /apis/apiregistration.k8s.io/v1/apiservices/{name}/status
name(路径参数):string, 必需
APIService 名称
body:APIService, 必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
pretty (查询参数):string
200 (APIService): OK
201 (APIService): Created
401: Unauthorized
patch
部分更新指定的 APIServicePATCH /apis/apiregistration.k8s.io/v1/apiservices/{name}
name(路径参数):string, 必需
APIService 名称
body:Patch, 必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty (查询参数):string
200 (APIService): OK
201 (APIService): Created
401: Unauthorized
patch
部分更新指定 APIService 的 statusPATCH /apis/apiregistration.k8s.io/v1/apiservices/{name}/status
name(路径参数):string, 必需
APIService 名称
body:Patch, 必需
dryRun (查询参数):string
fieldManager (查询参数):string
fieldValidation (查询参数):string
force (查询参数):boolean
pretty (查询参数):string
200 (APIService): OK
201 (APIService): Created
401: Unauthorized
delete
删除一个 APIServiceDELETE /apis/apiregistration.k8s.io/v1/apiservices/{name}
name(路径参数):string, 必需
APIService 名称
body:DeleteOptions
dryRun (查询参数):string
gracePeriodSeconds (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 APIService 集合DELETE /apis/apiregistration.k8s.io/v1/apiservices
body:DeleteOptions
continue (查询参数):string
dryRun (查询参数):string
fieldSelector (查询参数):string
gracePeriodSeconds (查询参数):integer
labelSelector (查询参数):string
limit (查询参数):integer
pretty (查询参数):string
propagationPolicy (查询参数):string
resourceVersion (查询参数):string
resourceVersionMatch (查询参数):string
timeoutSeconds (查询参数):integer
200 (Status): OK
401: Unauthorized
apiVersion: coordination.k8s.io/v1
import "k8s.io/api/coordination/v1"
Lease 定义了租约的概念。
apiVersion: coordination.k8s.io/v1
kind: Lease
metadata (ObjectMeta)
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Lease 规范。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
LeaseSpec 是一个 Lease 的规范。
acquireTime (MicroTime)
acquireTime 是当前租约被获取的时间。
holderIdentity (string)
holderIdentity 包含当前租约持有人的身份。
leaseDurationSeconds (int32)
leaseDurationSeconds 是租约候选人需要等待强制获取租约的持续时间。这是相对于上次观察到的更新时间的度量。
leaseTransitions (int32)
LeasetTransitions 是租约持有人之间的转换次数。
renewTime (MicroTime)
renewTime 是当前租约持有人上次更新租约的时间。
LeaseList 是 Lease 对象的列表。
apiVersion: coordination.k8s.io/v1
kind: LeaseList
metadata (ListMeta)
标准列表元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
Items 是架构对象的列表。
get
读取指定的租赁GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
name (路径参数): string, 必需
Lease 名称
namespace (路径参数): string, 必需
pretty (查询参数): string
200 (Lease): OK
401: Unauthorized
list
列出或监视 Lease 类对象GET /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
namespace (路径参数): string, 必需
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (LeaseList): OK
401: Unauthorized
list
列出或监视 Lease 类对象GET /apis/coordination.k8s.io/v1/leases
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (LeaseList): OK
401: Unauthorized
create
创建 LeasePOST /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
namespace (路径参数): string, 必需
body: Lease, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Lease): OK
201 (Lease): Created
202 (Lease): Accepted
401: Unauthorized
update
替换指定的 LeasePUT /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
name (路径参数): string, 必需
租贷名称
namespace (路径参数): string, 必需
body: Lease, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Lease): OK
201 (Lease): Created
401: Unauthorized
patch
部分更新指定的 LeasePATCH /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
name (路径参数): string, 必需
租贷名称
namespace (路径参数): string, 必需
body: Patch, 必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (Lease): OK
201 (Lease): Created
401: Unauthorized
delete
删除一个 LeaseDELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases/{name}
name (路径参数): string, 必需
租贷的名称
namespace (路径参数): string, 必需
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 Lease 收款DELETE /apis/coordination.k8s.io/v1/namespaces/{namespace}/leases
namespace (路径参数): string, 必需
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: node.k8s.io/v1
import "k8s.io/api/node/v1"
RuntimeClass 定义集群中支持的容器运行时类。 RuntimeClass 用于确定哪个容器运行时用于运行某 Pod 中的所有容器。 RuntimeClass 由用户或集群制备程序手动定义,并在 PodSpec 中引用。 Kubelet 负责在运行 Pod 之前解析 RuntimeClassName 引用。 有关更多详细信息,请参阅 https://kubernetes.io/zh-cn/docs/concepts/containers/runtime-class/
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata (ObjectMeta)
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
handler (string),必需
handler 指定底层运行时和配置,在 CRI 实现过程中将使用这些运行时和配置来处理这个类的 Pod。 可能的值特定于节点和 CRI 配置。 假定所有 handler 可用于每个节点上,且同一名称的 handler 在所有节点上是等效的。 例如,一个名为 “runc” 的 handler 可能指定 runc OCI 运行时将(使用原生 Linux 容器) 用于运行 Pod 中的容器。该 handler 必须采用小写,遵从 DNS Label (RFC 1123) 要求,且是不可变更的。
overhead (Overhead)
overhead 表示运行给定 RuntimeClass 的 Pod 时所关联的资源开销。有关更多详细信息,请参阅 https://kubernetes.io/zh-cn/docs/concepts/scheduling-eviction/pod-overhead/
Overhead 结构表示运行一个 Pod 所关联的资源开销。
overhead.podFixed (map[string]Quantity)
podFixed 表示与运行一个 Pod 所关联的资源开销。
scheduling (Scheduling)
scheduling 包含调度约束,这些约束用来确保以这个 RuntimeClass 运行的 Pod 被调度到支持此运行时类的节点。 如果 scheduling 设为空,则假定所有节点支持此 RuntimeClass。
Scheduling 指定支持 RuntimeClass 的节点的调度约束。
scheduling.nodeSelector (map[string]string)
nodeSelector 列出支持此 RuntimeClass 的节点上必须存在的标签。 使用此 RuntimeClass 的 Pod 只能调度到与这个选择算符匹配的节点上。 RuntimeClass nodeSelector 与 Pod 现有的 nodeSelector 合并。 任何冲突均会使得该 Pod 在准入时被拒绝。
scheduling.tolerations ([]Toleration)
原子性:将在合并期间被替换
tolerations 在准入期间追加到以此 RuntimeClass 运行的 Pod(不包括重复项)上, 本质上是求取 Pod 和 RuntimeClass 所容忍的节点并集。
附加此容忍度的 Pod 将容忍用匹配运算符 operator
运算后与三元组
<key,value,effect>
匹配的任何污点。
scheduling.tolerations.key (string)
key 是容忍度所应用到的污点键。空意味着匹配所有污点键。 如果键为空,则运算符必须为 Exists;这个组合意味着匹配所有值和所有键。
scheduling.tolerations.operator (string)
operator 表示一个键与值的关系。有效的运算符为 Exists 和 Equal。默认为 Equal。 Exists 等价于将值设置为通配符的情况,因此一个 Pod 可以容忍特定类别的所有污点。
scheduling.tolerations.value (string)
value 是容忍度匹配到的污点值。如果运算符为 Exists,则值应为空,否则就是一个普通字符串。
scheduling.tolerations.effect (string)
effect 表示匹配度污点效果。空意味着匹配所有污点效果。 当指定值时,允许的值为 NoSchedule、PreferNoSchedule 或 NoExecute。
scheduling.tolerations.tolerationSeconds (int64)
tolerationSeconds 表示容忍度容忍污点的时间段(必须是 NoExecute 的效果,否则忽略此字段)。 默认情况下,不设置此字段,这意味着永远容忍污点(不驱逐)。零和负值将被系统视为 0(立即驱逐)。
RuntimeClassList 是 RuntimeClass 对象的列表。
apiVersion: node.k8s.io/v1
kind: RuntimeClassList
metadata (ListMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]RuntimeClass),必需
items 是 schema 对象的列表。
get
读取指定的 RuntimeClassGET /apis/node.k8s.io/v1/runtimeclasses/{name}
name (路径参数): string,必需
RuntimeClass 的名称
pretty (查询参数): string
200 (RuntimeClass): OK
401: Unauthorized
list
列出或监视 RuntimeClass 类别的对象GET /apis/node.k8s.io/v1/runtimeclasses
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (RuntimeClassList): OK
401: Unauthorized
create
创建 RuntimeClassPOST /apis/node.k8s.io/v1/runtimeclasses
body: RuntimeClass,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (RuntimeClass): OK
201 (RuntimeClass): Created
202 (RuntimeClass): Accepted
401: Unauthorized
update
替换指定的 RuntimeClassPUT /apis/node.k8s.io/v1/runtimeclasses/{name}
name (路径参数): string,必需
RuntimeClass 的名称
body: RuntimeClass,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (RuntimeClass): OK
201 (RuntimeClass): Created
401: Unauthorized
patch
部分更新指定的 RuntimeClassPATCH /apis/node.k8s.io/v1/runtimeclasses/{name}
name (路径参数): string,必需
RuntimeClass 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (RuntimeClass): OK
201 (RuntimeClass): Created
401: Unauthorized
delete
删除 RuntimeClassDELETE /apis/node.k8s.io/v1/runtimeclasses/{name}
name (路径参数): string,必需
RuntimeClass 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 RuntimeClass 的集合DELETE /apis/node.k8s.io/v1/runtimeclasses
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
import "k8s.io/api/flowcontrol/v1beta2"
FlowSchema 定义一组流的模式。请注意,一个流由属性类似的一组入站 API 请求组成, 用一对字符串进行标识:FlowSchema 的名称和一个 “流区分项”。
apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
kind: FlowSchema
metadata (ObjectMeta)
metadata
是标准的对象元数据。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (FlowSchemaSpec)
spec
是 FlowSchema 预期行为的规约。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (FlowSchemaStatus)
status
是 FlowSchema 的当前状态。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
FlowSchemaSpec 描述 FlowSchema 的规约看起来是怎样的。
priorityLevelConfiguration (PriorityLevelConfigurationReference),必需
priorityLevelConfiguration
应引用集群中的 PriorityLevelConfiguration。
如果此应用无法被解析,则忽略此 FlowSchema,并在其状态中将其标记为无效。必需。
PriorityLevelConfigurationReference 包含指向正被使用的 “request-priority” 的信息。
priorityLevelConfiguration.name (string),必需
name
是正被引用的优先级配置的名称。必需。
distinguisherMethod (FlowDistinguisherMethod)
distinguisherMethod
定义如何为匹配此模式的请求来计算流区分项。
nil
表示该区分项被禁用,且因此将始终为空字符串。
FlowDistinguisherMethod 指定流区分项的方法。
distinguisherMethod.type (string),必需
type
是流区分项的类型。支持的类型为 “ByUser” 和 “ByNamespace”。必需。
matchingPrecedence (int32)
matchingPrecedence
用于选择与给定请求匹配的一个 FlowSchema。
选中的 FlowSchema 是某个 MatchingPrecedence 数值最小(我们视其为逻辑上最大)的 FlowSchema。
每个 MatchingPrecedence 值必须在 [1,10000] 的范围内。
请注意,如果未指定优先顺序,则其默认设为 1000。
rules ([]PolicyRulesWithSubjects)
原子性:将在合并期间被替换
rules
描述哪些请求将与这个流模式匹配。只有当至少一条规则与请求匹配时,
才视为此 FlowSchema 与该请求匹配。如果字段值为空表,则 FlowSchema 不会与任何请求匹配。
PolicyRulesWithSubjects 给出针对 API 服务器请求的一个测试。 该测试将检查发出请求的主体、所请求的动作和要操作的资源。 只有同时满足以下两个条件时,才表示此 PolicyRulesWithSubjects 与请求匹配: (a) 至少一个主体成员与请求匹配且 (b) 至少 resourceRules 或 nonResourceRules 的一个成员与请求匹配。
rules.subjects ([]Subject),必需
原子性:将在合并期间被替换
subjects 是此规则相关的普通用户、服务账号或组的列表。在这个列表中必须至少有一个成员。 同时包含 system:authenticated 和 system:unauthenticated 用户组的列表会与每个请求匹配。 此字段为必需。
Subject 用来与匹配请求的发起方,请求的发起方由请求身份认证系统识别出来。 有三种方式来匹配一个发起方:按用户、按组或按服务账号。
rules.subjects.kind (string),必需
kind
标示其他字段中的哪个字段必须非空。必需。
rules.subjects.group (GroupSubject)
group
根据用户组名称进行匹配。
rules.subjects.group.name (string),必需
name 是要匹配的用户组,或使用 *
匹配所有用户组。有关一些广为人知的组名,请参阅
https://github.com/kubernetes/apiserver/blob/master/pkg/authentication/user/user.go。必需。
rules.subjects.serviceAccount (ServiceAccountSubject)
serviceAccount
与 ServiceAccount 对象进行匹配。
ServiceAccountSubject 保存服务账号类别主体的详细信息。
rules.subjects.serviceAccount.name (string),必需
name
是要匹配的 ServiceAccount 对象的名称,可使用 *
匹配所有名称。必需。
rules.subjects.serviceAccount.namespace (string),必需
namespace
是要匹配的 ServiceAccount 对象的名字空间。必需。
rules.nonResourceRules ([]NonResourcePolicyRule)
原子性:将在合并期间被替换
nonResourceRules
是由 NonResourcePolicyRule 对象构成的列表,
根据请求的动作和目标非资源 URL 来识别匹配的请求。
NonResourcePolicyRule 是根据请求的动作和目标非资源 URL 来匹配非资源请求的一种规则。 只有满足以下两个条件时,NonResourcePolicyRule 才会匹配一个请求: (a) 至少 verbs 的一个成员与请求匹配且 (b) 至少 nonResourceURLs 的一个成员与请求匹配。
rules.nonResourceRules.nonResourceURLs ([]string),必需
集合:合并期间保留唯一值
nonResourceURLs
是用户有权访问的一组 URL 前缀,不可以为空。
此字段为必需设置的字段。例如:
*
与所有非资源 URL 匹配。如果存在此字符,则必须是唯一的输入项。
必需。rules.nonResourceRules.verbs ([]string),必需
集合:在合并期间保留唯一值
verbs
是与动作匹配的列表,不可以为空。*
与所有动作匹配。
如果存在此字符,则必须是唯一的输入项。必需。
rules.resourceRules ([]ResourcePolicyRule)
原子性:将在合并期间被替换
resourceRules
是 ResourcePolicyRule 对象的列表,根据请求的动作和目标资源识别匹配的请求。
resourceRules
和 nonResourceRules
两者必须至少有一个非空。
ResourcePolicyRule 是用来匹配资源请求的规则,对请求的动作和目标资源进行测试。
只有满足以下条件时,ResourcePolicyRule 才会与某个资源请求匹配:
(a) 至少 verbs 的一个成员与请求的动作匹配,
(b) 至少 apiGroups 的一个成员与请求的 API 组匹配,
(c) 至少 resources 的一个成员与请求的资源匹配,
(d) 要么 (d1) 请求未指定一个名字空间(即,namespace==""
)且 clusterScope 为 true,
要么 (d2) 请求指定了一个名字空间,且至少 namespaces 的一个成员与请求的名字空间匹配。
rules.resourceRules.apiGroups ([]string),必需
集合:合并期间保留唯一值
apiGroups
是与 API 组匹配的列表,不可以为空。*
表示与所有 API 组匹配。
如果存在此字符,则其必须是唯一的条目。必需。
rules.resourceRules.resources ([]string),必需
集合:合并期间保留唯一值
resources
是匹配的资源(即小写和复数)的列表,如果需要的话,还可以包括子资源。
例如 [ "services", "nodes/status" ]。此列表不可以为空。
*
表示与所有资源匹配。如果存在此字符,则必须是唯一的条目。必需。
rules.resourceRules.verbs ([]string),必需
集合:合并期间保留唯一值
verbs
是匹配的动作的列表,不可以为空。*
表示与所有动作匹配。
如果存在此字符,则必须是唯一的条目。必需。
rules.resourceRules.clusterScope (boolean)
clusterScope
表示是否与未指定名字空间
(出现这种情况的原因是该资源没有名字空间或请求目标面向所有名字空间)的请求匹配。
如果此字段被省略或为 false,则 namespaces
字段必须包含一个非空的列表。
rules.resourceRules.namespaces ([]string)
集合:合并期间保留唯一值
namespaces
是限制匹配的目标的名字空间的列表。
指定一个目标名字空间的请求只会在以下某一个情况满足时进行匹配:
(a) 此列表包含该目标名字空间或 (b) 此列表包含 *
。
请注意,*
与所指定的任何名字空间匹配,但不会与未指定 名字空间的请求匹配
(请参阅 clusterScope
字段)。此列表可以为空,但前提是 clusterScope
为 true。
FlowSchemaStatus 表示 FlowSchema 的当前状态。
conditions ([]FlowSchemaCondition)
Map:合并期间保留根据键 type 保留其唯一值
conditions
是 FlowSchema 当前状况的列表。
FlowSchemaCondition 描述 FlowSchema 的状况。
conditions.lastTransitionTime (Time)
lastTransitionTime
是状况上一次从一个状态转换为另一个状态的时间。
Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。 为 time 包的许多函数方法提供了封装器。
conditions.message (string)
message
是一条人类可读的消息,表示上一次转换有关的详细信息。
conditions.reason (string)
reason
是状况上次转换原因的、驼峰格式命名的、唯一的一个词。
conditions.status (string)
status
是状况的状态。可以是 True、False、Unknown。必需。
conditions.type (string)
type
是状况的类型。必需。
FlowSchemaList 是 FlowSchema 对象的列表。
apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
kind: FlowSchemaList
metadata (ListMeta)
metadata
是标准的列表元数据。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]FlowSchema),必需
items
是 FlowSchemas 的列表。
get
读取指定的 FlowSchemaGET /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}
name (路径参数): string,必需
FlowSchema 的名称
pretty (查询参数): string
200 (FlowSchema): OK
401: Unauthorized
get
读取指定 FlowSchema 的状态GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}/status
name (路径参数): string,必需
FlowSchema 的名称
pretty (查询参数): string
200 (FlowSchema): OK
401: Unauthorized
list
列出或监视 FlowSchema 类别的对象GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (FlowSchemaList): OK
401: Unauthorized
create
创建 FlowSchemaPOST /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas
body: FlowSchema,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (FlowSchema): OK
201 (FlowSchema): Created
202 (FlowSchema): Accepted
401: Unauthorized
update
替换指定的 FlowSchemaPUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}
name (路径参数): string,必需
FlowSchema 的名称
body: FlowSchema,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (FlowSchema): OK
201 (FlowSchema): Created
401: Unauthorized
update
替换指定的 FlowSchema 的状态PUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}/status
name (路径参数): string,必需
FlowSchema 的名称
body: FlowSchema,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (FlowSchema): OK
201 (FlowSchema): Created
401: Unauthorized
patch
部分更新指定的 FlowSchemaPATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}
name (路径参数): string,必需
FlowSchema 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (FlowSchema): OK
201 (FlowSchema): Created
401: Unauthorized
patch
部分更新指定的 FlowSchema 的状态PATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}/status
name (路径参数): string,必需
FlowSchema 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (FlowSchema): OK
201 (FlowSchema): Created
401: Unauthorized
delete
删除 FlowSchemaDELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas/{name}
name (路径参数): string,必需
FlowSchema 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 FlowSchema 的集合DELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/flowschemas
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
import "k8s.io/api/flowcontrol/v1beta2"
PriorityLevelConfiguration 表示一个优先级的配置。
apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
kind: PriorityLevelConfiguration
metadata (ObjectMeta)
metadata
是标准的对象元数据。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
spec (PriorityLevelConfigurationSpec)
spec
是 “request-priority” 预期行为的规约。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
status (PriorityLevelConfigurationStatus)
status
是 “请求优先级” 的当前状况。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
PriorityLevelConfigurationSpec 指定一个优先级的配置。
type (string),必需
type
指示此优先级是否遵从有关请求执行的限制。
取值为 "Exempt"
意味着此优先级的请求不遵从某个限制(且因此从不排队)且不会减损其他优先级可用的容量。
取值为 "Limited"
意味着 (a) 此优先级的请求遵从这些限制且
(b) 服务器某些受限的容量仅可用于此优先级。必需。
limited (LimitedPriorityLevelConfiguration)
limited
指定如何为某个受限的优先级处理请求。
当且仅当 type
是 "Limited"
时,此字段必须为非空。
LimitedPriorityLevelConfiguration 指定如何处理需要被限制的请求。它解决两个问题:
limited.assuredConcurrencyShares (int32)
assuredConcurrencyShares
(ACS) 配置执行限制,这是在给定时间可以执行的、此优先级的请求数量的限制。
ACS 必须是一个正数。服务器的并发限制(SCL)数量按其保证的并发份额划分到并发能力受限的各个优先级中。
这一计算会为所有这种优先级分别生成其确定的并发值(ACV),即一次可以执行的请求数量:
ACV(l) = ceil( SCL * ACS(l) / ( sum[priority levels k] ACS(k) ) )
较大的 ACS 值意味着(以影响所有其他优先级为代价)保留更多的并发请求。此字段的默认值为 30。
limited.limitResponse (LimitResponse)
limitResponse
指示如何处理当前无法立即执行的请求。
LimitResponse 定义如何处理当前无法立即执行的请求。
limited.limitResponse.type (string),必需
type
是 “Queue” 或 “Reject”。此字段必须设置。
“Queue” 意味着在到达时无法被执行的请求可以被放到队列中,直到它们被执行或者队列长度超出限制为止。
“Reject” 意味着到达时无法执行的请求将被拒绝。
limited.limitResponse.queuing (QueuingConfiguration)
queuing
包含排队所用的配置参数。只有 type
是 "Queue"
时,此字段才可以为非空。
QueuingConfiguration 保存排队所用的配置参数。
limited.limitResponse.queuing.handSize (int32)
handSize
是一个小的正数,用于配置如何将请求随机分片到队列中。
当以该优先级将请求排队时,将对请求的流标识符(字符串对)进行哈希计算,
该哈希值用于打乱队列队列的列表,并处理此处指定的一批请求。
请求被放入这一批次中最短的队列中。
handSize
不得大于 queues
,并且应该明显更小(以便几个大的流量不会使大多数队列饱和)。
有关设置此字段的更多详细指导,请参阅面向用户的文档。此字段的默认值为 8。
limited.limitResponse.queuing.queueLengthLimit (int32)
queueLengthLimit
是任意时刻允许在此优先级的给定队列中等待的请求数上限;
额外的请求将被拒绝。
此值必须是正数。如果未指定,则默认为 50。
limited.limitResponse.queuing.queues (int32)
queues
是这个优先级的队列数。此队列在每个 API 服务器上独立存在。此值必须是正数。
将其设置为 1 相当于禁止了混洗分片操作,进而使得对相关流模式的区分方法不再有意义。
此字段的默认值为 64。
PriorityLevelConfigurationStatus 表示 “请求优先级” 的当前状况。
conditions ([]PriorityLevelConfigurationCondition)
Map:合并期间保留根据键 type 保留其唯一值
conditions
是 “请求优先级” 的当前状况。
PriorityLevelConfigurationCondition 定义优先级的状况。
conditions.lastTransitionTime (Time)
lastTransitionTime
是状况上次从一个状态转换为另一个状态的时间。
Time 是对 time.Time 的封装。Time 支持对 YAML 和 JSON 进行正确封包。 为 time 包的许多函数方法提供了封装器。
conditions.message (string)
message
是人类可读的消息,指示有关上次转换的详细信息。
conditions.reason (string)
reason
是状况上次转换原因的、驼峰格式命名的、唯一的一个词。
conditions.status (string)
status
表示状况的状态,取值为 True、False 或 Unknown 之一。必需。
conditions.type (string)
type
表示状况的类型,必需。
PriorityLevelConfigurationList 是 PriorityLevelConfiguration 对象的列表。
apiVersion: flowcontrol.apiserver.k8s.io/v1beta2
kind: PriorityLevelConfigurationList
metadata (ListMeta)
metadata
是标准的对象元数据。更多信息:
https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
items ([]PriorityLevelConfiguration),必需
items
是请求优先级设置的列表。
get
读取指定的 PriorityLevelConfigurationGET /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}
name (路径参数): string,必需
PriorityLevelConfiguration 的名称
pretty (查询参数): string
200 (PriorityLevelConfiguration): OK
401: Unauthorized
get
读取指定的 PriorityLevelConfiguration 的状态GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}/status
name (路径参数): string,必需
PriorityLevelConfiguration 的名称
pretty (查询参数): string
200 (PriorityLevelConfiguration): OK
401: Unauthorized
list
列出或监视 PriorityLevelConfiguration 类别的对象GET /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (PriorityLevelConfigurationList): OK
401: Unauthorized
create
创建 PriorityLevelConfigurationPOST /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations
body: PriorityLevelConfiguration,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PriorityLevelConfiguration): OK
201 (PriorityLevelConfiguration): Created
202 (PriorityLevelConfiguration): Accepted
401: Unauthorized
update
替换指定的 PriorityLevelConfigurationPUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}
name (路径参数): string,必需
PriorityLevelConfiguration 的名称
body: PriorityLevelConfiguration,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PriorityLevelConfiguration): OK
201 (PriorityLevelConfiguration): Created
401: Unauthorized
update
替换指定的 PriorityLevelConfiguration 的状态PUT /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}/status
name (路径参数): string,必需
PriorityLevelConfiguration 的名称
body: PriorityLevelConfiguration,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (PriorityLevelConfiguration): OK
201 (PriorityLevelConfiguration): Created
401: Unauthorized
patch
部分更新指定的 PriorityLevelConfigurationPATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}
name (路径参数): string,必需
PriorityLevelConfiguration 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PriorityLevelConfiguration): OK
201 (PriorityLevelConfiguration): Created
401: Unauthorized
patch
部分更新指定的 PriorityLevelConfiguration 的状态PATCH /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}/status
name (路径参数): string,必需
PriorityLevelConfiguration 的名称
body: Patch,必需
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
force (查询参数): boolean
pretty (查询参数): string
200 (PriorityLevelConfiguration): OK
201 (PriorityLevelConfiguration): Created
401: Unauthorized
delete
删除 PriorityLevelConfigurationDELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations/{name}
name (路径参数): string,必需
PriorityLevelConfiguration 的名称
body: DeleteOptions
dryRun (查询参数): string
gracePeriodSeconds (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
200 (Status): OK
202 (Status): Accepted
401: Unauthorized
deletecollection
删除 PriorityLevelConfiguration 的集合DELETE /apis/flowcontrol.apiserver.k8s.io/v1beta2/prioritylevelconfigurations
body: DeleteOptions
continue (查询参数): string
dryRun (查询参数): string
fieldSelector (查询参数): string
gracePeriodSeconds (查询参数): integer
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
propagationPolicy (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
200 (Status): OK
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
Binding 将一个对象与另一个对象联系起来; 例如,一个 Pod 被调度程序绑定到一个节点。 已在 1.7 版本弃用,请使用 Pod 的 binding 子资源。
apiVersion: v1
kind: Binding
metadata (ObjectMeta)
标准对象的元数据, 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
target (ObjectReference), 必需
要绑定到标准对象的目标对象。
create
创建一个 BindingPOST /api/v1/namespaces/{namespace}/bindings
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Binding): OK
201 (Binding): Created
202 (Binding): Accepted
401: Unauthorized
create
创建 Pod 的绑定POST /api/v1/namespaces/{namespace}/pods/{name}/binding
dryRun (查询参数): string
fieldManager (查询参数): string
fieldValidation (查询参数): string
pretty (查询参数): string
200 (Binding): OK
201 (Binding): Created
202 (Binding): Accepted
401: Unauthorized
apiVersion: v1
import "k8s.io/api/core/v1"
ComponentStatus(和 ComponentStatusList)保存集群检验信息。 已废弃:该 API 在 v1.19 及更高版本中废弃。
apiVersion: v1
kind: ComponentStatus
metadata (ObjectMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
conditions ([]ComponentCondition)
补丁策略:基于键 type
合并
观测到的组件状况的列表。
conditions.status (string),必需
组件状况的状态。“Healthy” 的有效值为:“True”、“False” 或 “Unknown”。
组件状况的类型。有效值:“Healthy”
conditions.error (string)
组件状况的错误码。例如,一个健康检查错误码。
conditions.message (string)
组件状况相关消息。例如,有关健康检查的信息。
作为 ComponentStatus 对象列表,所有组件状况的状态。 已废弃:该 API 在 v1.19 及更高版本中废弃。
apiVersion: v1
kind: ComponentStatusList
metadata (ListMeta)
标准的对象元数据。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
items ([]ComponentStatus),必需
ComponentStatus 对象的列表。
get
读取指定的 ComponentStatusGET /api/v1/componentstatuses/{name}
name (路径参数): string,必需
ComponentStatus 的名称
pretty (查询参数): string
200 (ComponentStatus): OK
401: Unauthorized
list
列出 ComponentStatus 类别的对象GET /api/v1/componentstatuses
allowWatchBookmarks (查询参数): boolean
continue (查询参数): string
fieldSelector (查询参数): string
labelSelector (查询参数): string
limit (查询参数): integer
pretty (查询参数): string
resourceVersion (查询参数): string
resourceVersionMatch (查询参数): string
timeoutSeconds (查询参数): integer
watch (查询参数): boolean
200 (ComponentStatusList): OK
401: Unauthorized
import "k8s.io/apimachinery/pkg/apis/meta/v1"
删除 API 对象时可以提供 DeleteOptions。
apiVersion (string)
APIVersion
定义对象表示的版本化模式。
服务器应将已识别的模式转换为最新的内部值,并可能拒绝无法识别的值。
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
dryRun ([]string)
该值如果存在,则表示不应保留修改。
无效或无法识别的 dryRun
指令将导致错误响应并且不会进一步处理请求。有效值为:
All
:处理所有试运行阶段(Dry Run Stages)gracePeriodSeconds (int64)
表示对象被删除之前的持续时间(以秒为单位)。
值必须是非负整数。零值表示立即删除。如果此值为 nil
,则将使用指定类型的默认宽限期。如果未指定,则为每个对象的默认值。
kind (string)
kind
是一个字符串值,表示此对象代表的 REST 资源。
服务器可以从客户端提交请求的端点推断出此值。此值无法更新,是驼峰的格式。
更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds 。
orphanDependents (boolean)
已弃用:该字段将在 1.7 中弃用,请使用 propagationPolicy
字段。
该字段表示依赖对象是否应该是孤儿。如果为 true/false,对象的 finalizers 列表中会被添加上或者移除掉 “orphan” 终结器(Finalizer)。
可以设置此字段或者设置 propagationPolicy
字段,但不能同时设置以上两个字段。
preconditions (Preconditions)
先决条件必须在执行删除之前完成。如果无法满足这些条件,将返回 409(冲突)状态。
preconditions.resourceVersion (string)
指定目标资源版本(resourceVersion)。
preconditions.uid (string)
指定目标 UID。
propagationPolicy (string)
表示是否以及如何执行垃圾收集。可以设置此字段或 orphanDependents
字段,但不能同时设置二者。
默认策略由 metadata.finalizers
中现有终结器(Finalizer)集合和特定资源的默认策略决定。
可接受的值为:Orphan
- 令依赖对象成为孤儿对象;Background
- 允许垃圾收集器在后台删除依赖项;Foreground
- 一个级联策略,前台删除所有依赖项。
import "k8s.io/apimachinery/pkg/apis/meta/v1"
标签选择器是对一组资源的标签查询。
matchLabels
和 matchExpressions
的结果按逻辑与的关系组合。
一个 empty
标签选择器匹配所有对象。一个 null
标签选择器不匹配任何对象。
matchExpressions ([]LabelSelectorRequirement)
matchExpressions
是标签选择器要求的列表,这些要求的结果按逻辑与的关系来计算。
matchExpressions.key (string), 必填
补丁策略:按照键 key
合并
key
是选择器应用的标签键。
matchExpressions.operator (string),必填
operator
表示键与一组值的关系。有效的运算符包括 In
、NotIn
、Exists
和 DoesNotExist
。
matchExpressions.values ([]string)
values
是一个字符串值数组。如果运算符为 In
或 NotIn
,则 values
数组必须为非空。
如果运算符是 Exists
或 DoesNotExist
,则 values
数组必须为空。
该数组在策略性合并补丁(Strategic Merge Patch)期间被替换。
matchLabels (map[string]string)
matchLabels
是 {key
,value
} 键值对的映射。
matchLabels
映射中的单个 {key
,value
} 键值对相当于 matchExpressions
的一个元素,其键字段为 key
,运算符为 In
,values
数组仅包含 value
。
所表达的需求最终要按逻辑与的关系组合。
import "k8s.io/apimachinery/pkg/apis/meta/v1"
ListMeta
描述了合成资源必须具有的元数据,包括列表和各种状态对象。
一个资源仅能有 {ObjectMeta, ListMeta}
中的一个。
continue (string)
如果用户对返回的条目数量设置了限制,则 continue
可能被设置,表示服务器有更多可用的数据。
该值是不透明的,可用于向提供此列表服务的端点发出另一个请求,以检索下一组可用的对象。
如果服务器配置已更改或时间已过去几分钟,则可能无法继续提供一致的列表。
除非你在错误消息中收到此令牌(token),否则使用此 continue
值时返回的 resourceVersion
字段应该和第一个响应中的值是相同的。
remainingItemCount (int64)
remainingItemCount
是列表中未包含在此列表响应中的后续项目的数量。
如果列表请求包含标签或字段选择器,则剩余项目的数量是未知的,并且在序列化期间该字段将保持未设置和省略。
如果列表是完整的(因为它没有分块或者这是最后一个块),那么就没有剩余的项目,并且在序列化过程中该字段将保持未设置和省略。
早于 v1.15 的服务器不设置此字段。remainingItemCount
的预期用途是估计集合的大小。
客户端不应依赖于设置准确的 remainingItemCount
。
resourceVersion (string)
标识该对象的服务器内部版本的字符串,客户端可以用该字段来确定对象何时被更改。 该值对客户端是不透明的,并且应该原样传回给服务器。该值由系统填充,只读。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency 。
selfLink (string)
selfLink 表示此对象的 URL,由系统填充,只读。
已弃用:selfLink 是一个遗留的只读字段,不再由系统填充。
import "k8s.io/api/core/v1"
LocalObjectReference 包含足够的信息,可以让你在同一命名空间(namespace)内找到引用的对象。
name (string)
被引用者的名称。 更多信息: https://kubernetes.io/zh-cn/docs/concepts/overview/working-with-objects/names/#names。
import "k8s.io/api/core/v1"
节点选择器是要求包含键、值和关联键和值的运算符的选择器。
key (string), 必选
选择器适用的标签键。
operator (string), 必选
表示键与一组值的关系的运算符。有效的运算符包括:In、NotIn、Exists、DoesNotExist、Gt 和 Lt。
values ([]string)
字符串数组。如果运算符为 In 或 NotIn,则数组必须为非空。 如果运算符为 Exists 或 DoesNotExist,则数组必须为空。 如果运算符为 Gt 或 Lt,则数组必须有一个元素,该元素将被译为整数。 该数组在合并计划补丁时将被替换。
import "k8s.io/api/core/v1"
ObjectFieldSelector 选择对象的 APIVersioned 字段。
fieldPath (string), 必需的
在指定 API 版本中要选择的字段的路径。
apiVersion (string)
fieldPath
写入时所使用的模式版本,默认为 "v1"。
import "k8s.io/apimachinery/pkg/apis/meta/v1"
ObjectMeta 是所有持久化资源必须具有的元数据,其中包括用户必须创建的所有对象。
name (string)
name 在命名空间内必须是唯一的。创建资源时需要,尽管某些资源可能允许客户端请求自动地生成适当的名称。 名称主要用于创建幂等性和配置定义。无法更新。 更多信息: http://kubernetes.io/docs/user-guide/identifiers#names
generateName (string)
generateName 是一个可选前缀,由服务器使用,仅在未提供 name 字段时生成唯一名称。 如果使用此字段,则返回给客户端的名称将与传递的名称不同。该值还将与唯一的后缀组合。 提供的值与 name 字段具有相同的验证规则,并且可能会根据所需的后缀长度被截断,以使该值在服务器上唯一。
如果指定了此字段并且生成的名称存在,则服务器将不会返回 409 ——相反,它将返回 201 Created 或 500, 原因是 ServerTimeout 指示在分配的时间内找不到唯一名称,客户端应重试(可选,在 Retry-After 标头中指定的时间之后)。
仅在未指定 name 时应用。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency
namespace (string)
namespace 定义了一个值空间,其中每个名称必须唯一。空命名空间相当于 “default” 命名空间,但 “default” 是规范表示。 并非所有对象都需要限定在命名空间中——这些对象的此字段的值将为空。
必须是 DNS_LABEL。无法更新。更多信息: http://kubernetes.io/docs/user-guide/namespaces
labels (map[string]string)
可用于组织和分类(确定范围和选择)对象的字符串键和值的映射。 可以匹配 ReplicationControllers 和 Service 的选择器。更多信息: http://kubernetes.io/docs/user-guide/labels
annotations (map[string]string)
annotations 是一个非结构化的键值映射,存储在资源中,可以由外部工具设置以存储和检索任意元数据。 它们不可查询,在修改对象时应保留。更多信息: http://kubernetes.io/docs/user-guide/annotations
finalizers ([]string)
在从注册表中删除对象之前该字段必须为空。 每个条目都是负责的组件的标识符,各组件将从列表中删除自己对应的条目。 如果对象的 deletionTimestamp 非空,则只能删除此列表中的条目。 终结器可以按任何顺序处理和删除。没有按照顺序执行, 因为它引入了终结器卡住的重大风险。finalizers 是一个共享字段, 任何有权限的参与者都可以对其进行重新排序。如果按顺序处理终结器列表, 那么这可能导致列表中第一个负责终结器的组件正在等待列表中靠后负责终结器的组件产生的信号(字段值、外部系统或其他), 从而导致死锁。在没有强制排序的情况下,终结者可以在它们之间自由排序, 并且不容易受到列表中排序更改的影响。
managedFields ([]ManagedFieldsEntry)
managedFields 将 workflow-id 和版本映射到由该工作流管理的字段集。 这主要用于内部管理,用户通常不需要设置或理解该字段。 工作流可以是用户名、控制器名或特定应用路径的名称,如 “ci-cd”。 字段集始终存在于修改对象时工作流使用的版本。
ManagedFieldsEntry 是一个 workflow-id,一个 FieldSet,也是该字段集适用的资源的组版本。
managedFields.apiVersion (string)
apiVersion 定义此字段集适用的资源的版本。
格式是 “group/version”,就像顶级 apiVersion 字段一样。 必须跟踪字段集的版本,因为它不能自动转换。
managedFields.fieldsType (string)
FieldsType 是不同字段格式和版本的鉴别器。
目前只有一个可能的值:“FieldsV1”
managedFields.fieldsV1 (FieldsV1)
FieldsV1 包含类型 “FieldsV1” 中描述的第一个 JSON 版本格式。
FieldsV1 以 JSON 格式将一组字段存储在像 Trie 这样的数据结构中。
每个键或是 .
表示字段本身,并且始终映射到一个空集,
或是一个表示子字段或元素的字符串。该字符串将遵循以下四种格式之一:
f:<name>
,其中 <name>
是结构中字段的名称,或映射中的键v:<value>
,其中 <value>
是列表项的精确 json 格式值i:<index>
,其中 <index>
是列表中项目的位置k:<keys>
,其中 <keys>
是列表项的关键字段到其唯一值的映射
如果一个键映射到一个空的 Fields 值,则该键表示的字段是集合的一部分。确切的格式在 sigs.k8s.io/structured-merge-diff 中定义。
managedFields.manager (string)
manager 是管理这些字段的工作流的标识符。
managedFields.operation (string)
operation 是导致创建此 managedFields 表项的操作类型。
此字段的仅有合法值是 “Apply” 和 “Update”。
managedFields.subresource (string)
subresource 是用于更新该对象的子资源的名称,如果对象是通过主资源更新的,则为空字符串。
该字段的值用于区分管理者,即使他们共享相同的名称。例如,状态更新将不同于使用相同管理者名称的常规更新。 请注意,apiVersion 字段与 subresource 字段无关,它始终对应于主资源的版本。
managedFields.time (Time)
time 是设置这些字段的时间戳。如果 operation 为 “Apply”,则它应始终为空
time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。
为 time 包提供的许多工厂方法提供了包装类。
ownerReferences ([]OwnerReference)
补丁策略:在键 uid
上执行合并操作
此对象所依赖的对象列表。如果列表中的所有对象都已被删除,则该对象将被垃圾回收。 如果此对象由控制器管理,则此列表中的条目将指向此控制器,controller 字段设置为 true。 管理控制器不能超过一个。
OwnerReference 包含足够可以让你识别拥有对象的信息。 拥有对象必须与依赖对象位于同一命名空间中,或者是集群作用域的,因此没有命名空间字段。
ownerReferences.apiVersion (string),必选
被引用资源的 API 版本。
ownerReferences.kind (string),必选
被引用资源的类别。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
ownerReferences.name (string),必选
被引用资源的名称。更多信息: http://kubernetes.io/docs/user-guide/identifiers#names
ownerReferences.uid (string),必选
被引用资源的 uid。更多信息: http://kubernetes.io/docs/user-guide/identifiers#uids
ownerReferences.blockOwnerDeletion (boolean)
如果为 true,**并且**如果所有者具有 “foregroundDeletion” 终结器,
则在删除此引用之前,无法从键值存储中删除所有者。 默认为 false。要设置此字段,用户需要所有者的 “delete” 权限, 否则将返回 422 (Unprocessable Entity)。
ownerReferences.controller (boolean)
如果为 true,则此引用指向管理的控制器。
creationTimestamp (Time)
creationTimestamp 是一个时间戳,表示创建此对象时的服务器时间。 不能保证在单独的操作中按发生前的顺序设置。 客户端不得设置此值。它以 RFC3339 形式表示,并采用 UTC。
由系统填充。只读。列表为空。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。
deletionGracePeriodSeconds (int64)
此对象从系统中删除之前允许正常终止的秒数。 仅当设置了 deletionTimestamp 时才设置。 只能缩短。只读。
deletionTimestamp (Time)
deletionTimestamp 是删除此资源的 RFC 3339 日期和时间。 该字段在用户请求优雅删除时由服务器设置,客户端不能直接设置。 一旦 finalizers 列表为空,该资源预计将在此字段中的时间之后被删除 (不再从资源列表中可见,并且无法通过名称访问)。 只要 finalizers 列表包含项目,就阻止删除。一旦设置了 deletionTimestamp, 该值可能不会被取消设置或在未来进一步设置,尽管它可能会缩短或在此时间之前可能会删除资源。 例如,用户可能要求在 30 秒内删除一个 Pod。 Kubelet 将通过向 Pod 中的容器发送优雅的终止信号来做出反应。 30 秒后,Kubelet 将向容器发送硬终止信号(SIGKILL), 并在清理后从 API 中删除 Pod。在网络存在分区的情况下, 此对象可能在此时间戳之后仍然存在,直到管理员或自动化进程可以确定资源已完全终止。 如果未设置,则未请求优雅删除该对象。
请求优雅删除时由系统填充。只读。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
“Time 是 time.Time 的包装类,支持正确地序列化为 YAML 和 JSON。 为 time 包提供的许多工厂方法提供了包装类。”
generation (int64)
表示期望状态的特定生成的序列号。由系统填充。只读。
resourceVersion (string)
一个不透明的值,表示此对象的内部版本,客户端可以使用该值来确定对象是否已被更改。 可用于乐观并发、变更检测以及对资源或资源集的监听操作。 客户端必须将这些值视为不透明的,且未更改地传回服务器。 它们可能仅对特定资源或一组资源有效。
由系统填充。只读。客户端必须将值视为不透明。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
selfLink (string)
selfLink 是表示此对象的 URL。由系统填充。只读。
已弃用。Kubernetes 将在 1.20 版本中停止传播该字段,并计划在 1.21 版本中删除该字段。
uid (string)
UID 是该对象在时间和空间上的唯一值。它通常由服务器在成功创建资源时生成,并且不允许使用 PUT 操作更改。
由系统填充。只读。更多信息: http://kubernetes.io/docs/user-guide/identifiers#uids
clusterName (string)
已弃用:clusterName 是一个总是被系统清除并且从未使用过的遗留字段;它将在 1.25 中完全删除。 go 结构体中的对应字段名称已更改,以帮助客户端检测意外使用。
import "k8s.io/api/core/v1"
ObjectReference包含足够的信息,允许你检查或修改引用的对象。
apiVersion (string)
被引用者的 API 版本。
fieldPath (string)
如果引用的是对象的某个对象是整个对象,则该字符串而不是应包含的 JSON/Go 字段有效访问语句,
例如 desiredState.manifest.containers[ 2 ]
。例如,如果对象引用针对的是 Pod 中的一个容器,
此字段取值类似于:spec.containers{name}
(name
指触发的容器的名称),
或者如果没有指定容器名称,spec.containers[ 2 ]
(此 Pod 中索引为 2 的容器)。
选择这种只是为了有一些定义好的语法来引用对象的部分。
kind (string)
被引用者的类别(kind)。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
name (string)
被引用对象的名称。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
namespace (string)
被引用对象的名字空间。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
resourceVersion (string)
被引用对象的特定资源版本(如果有)。更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency
uid (string)
被引用对象的UID。更多信息: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids
import "k8s.io/apimachinery/pkg/apis/meta/v1"
提供 Patch 是为了给 Kubernetes PATCH 请求正文提供一个具体的名称和类型。
import "k8s.io/apimachinery/pkg/api/resource"
数量(Quantity)是数字的定点表示。 除了 String() 和 AsInt64() 的访问接口之外, 它以 JSON 和 YAML形式提供方便的打包和解包方法。
序列化格式如下:
<quantity> ::= <signedNumber><suffix>
(注意 <suffix> 可能为空,例如 <decimalSI> 的 "" 情形。) </br>
<digit> ::= 0 | 1 | ... | 9 </br>
<digits> ::= <digit> | <digit><digits> </br>
<number> ::= <digits> | <digits>.<digits> | <digits>. | .<digits> </br>
<sign> ::= "+" | "-" </br>
<signedNumber> ::= <number> | <sign><number> </br>
<suffix> ::= <binarySI> | <decimalExponent> | <decimalSI> </br>
<binarySI> ::= Ki | Mi | Gi | Ti | Pi | Ei
(国际单位制度;查阅: http://physics.nist.gov/cuu/Units/binary.html)</br>
<decimalSI> ::= m | "" | k | M | G | T | P | E
(注意,1024 = 1ki 但 1000 = 1k;我没有选择大写。) </br>
<decimalExponent> ::= "e" <signedNumber> | "E" <signedNumber> </br>
无论使用三种指数形式中哪一种,没有数量可以表示大于 263-1 的数,也不可能超过 3 个小数位。 更大或更精确的数字将被截断或向上取整。(例如:0.1m 将向上取整为 1m。) 如果将来我们需要更大或更小的数量,可能会扩展。
当从字符串解析数量时,它将记住它具有的后缀类型,并且在序列化时将再次使用相同类型。
在序列化之前,数量将以“规范形式”放置。这意味着指数或者后缀将被向上或向下调整(尾数相应增加或减少),并确保:
例如:
请注意,数量永远不会在内部以浮点数表示。这是本设计的重中之重。
只要它们格式正确,非规范值仍将解析,但将以其规范形式重新输出。(所以应该总是使用规范形式,否则不要执行 diff 比较。)
这种格式旨在使得很难在不撰写某种特殊处理代码的情况下使用这些数字,进而希望实现者也使用定点实现。
import "k8s.io/api/core/v1"
ResourceFieldSelector 表示容器资源(CPU,内存)及其输出格式。
resource (string), 必选
必选:选择的资源
containerName (string)
容器名称:对卷必选,对环境变量可选
divisor (Quantity)
指定所曝光资源的输出格式,默认值为“1”
import "k8s.io/apimachinery/pkg/apis/meta/v1"
状态(Status)是不返回其他对象的调用的返回值。
apiVersion (string)
APIVersion 定义对象表示的版本化模式。 服务器应将已识别的模式转换为最新的内部值,并可能拒绝无法识别的值。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
code (int32)
此状态的建议 HTTP 返回代码,如果未设置,则为 0。
details (StatusDetails)
与原因(Reason)相关的扩展数据。每个原因都可以定义自己的扩展细节。 此字段是可选的,并且不保证返回的数据符合任何模式,除非由原因类型定义。
StatusDetails 是一组附加属性,可以由服务器设置以提供有关响应的附加信息。 状态对象的原因字段定义将设置哪些属性。 客户端必须忽略与每个属性的定义类型不匹配的字段,并且应该假定任何属性可能为空、无效或未定义。
details.causes ([]StatusCause)
Causes 数组包含与 StatusReason 故障相关的更多详细信息。
并非所有 StatusReasons 都可以提供详细的原因。
*StatusCause 提供有关 api.Status 失败的更多信息,包括遇到多个错误的情况。*
details.causes.field (string)
导致此错误的资源字段,由其 JSON 序列化命名。
可能包括嵌套属性的点和后缀表示法。数组是从零开始索引的。 由于字段有多个错误,字段可能会在一系列原因中出现多次。可选。
示例:
details.causes.message (string)
对错误原因的可读描述。该字段可以按原样呈现给读者。
details.causes.reason (string)
错误原因的机器可读描述。如果此值为空,则没有可用信息。
details.group (string)
与状态 StatusReason 关联的资源的组属性。
details.kind (string)
与状态 StatusReason 关联的资源的种类属性。
在某些操作上可能与请求的资源种类不同。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
details.name (string)
与状态 StatusReason 关联的资源的名称属性(当有一个可以描述的名称时)。
details.retryAfterSeconds (int32)
如果指定,则应重试操作前的时间(以秒为单位)。
一些错误可能表明客户端必须采取替代操作——对于这些错误,此字段可能指示在采取替代操作之前等待多长时间。
details.uid (string)
资源的 UID(当有单个可以描述的资源时)。
kind (string)
Kind 是一个字符串值,表示此对象表示的 REST 资源。 服务器可以从客户端提交请求的端点推断出这一点。 无法更新。驼峰式规则。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
message (string)
此操作状态的人类可读描述。
metadata (ListMeta)
标准列表元数据。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
reason (string)
机器可读的说明,说明此操作为何处于“失败”状态。 如果此值为空,则没有可用信息。 Reason 澄清了 HTTP 状态代码,但不会覆盖它。
status (string)
操作状态。“Success”或“Failure” 之一。 更多信息: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status
import "k8s.io/api/core/v1"
TypedLocalObjectReference 包含足够的信息,可以让你在同一个名称空间中定位特定类型的引用对象。
kind (string), 必需
Kind 是被引用的资源的类型
name (string), 必需
Name 是被引用的资源的名称
apiGroup (string)
APIGroup 是被引用资源的组。如果不指定 APIGroup,则指定的 Kind 必须在核心 API 组中。对于任何其它第三方类型,都需要 APIGroup。
allowWatchBookmarks 字段请求类型为 BOOKMARK 的监视事件。 没有实现书签的服务器可能会忽略这个标志,并根据服务器的判断发送书签。 客户端不应该假设书签会在任何特定的时间间隔返回,也不应该假设服务器会在会话期间发送任何书签事件。 如果当前请求不是 watch 请求,则忽略该字段。
当需要从服务器检索更多结果时,应该设置 continue 选项。由于这个值是服务器定义的, 客户端只能使用先前查询结果中具有相同查询参数的 continue 值(continue值除外), 服务器可能拒绝它识别不到的 continue 值。 如果指定的 continue 值不再有效,无论是由于过期(通常是 5 到 15 分钟) 还是服务器上的配置更改,服务器将响应 "410 ResourceExpired" 错误和一个 continue 令牌。
如果客户端需要一个一致的列表,它必须在没有 continue 字段的情况下重新发起 list 请求。 否则,客户端可能会发送另一个带有 410 错误令牌的 list 请求,服务器将响应从下一个键开始的列表, 但列表数据来自最新的快照,这与之前 的列表结果不一致。第一个列表请求之后的对象创建,修改,或删除的对象将被包含在响应中, 只要他们的键是在“下一个键”之后。
当 watch 字段为 true 时,不支持此字段。客户端可以从服务器返回的最后一个 resourceVersion 值开始监视,就不会错过任何修改。
表示不应该持久化所请求的修改。无效或无法识别的 dryRun 指令将导致错误响应, 并且服务器不再对请求进行进一步处理。有效值为:
fieldManager 是与进行这些更改的参与者或实体相关联的名称。 长度小于或128个字符且仅包含可打印字符,如 https://golang.org/pkg/unicode/#IsPrint 所定义。
根据返回对象的字段限制返回对象列表的选择器。默认为返回所有字段。
fieldValidation 指示服务器如何处理请求(POST/PUT/PATCH)中包含未知或重复字段的对象,
前提是 ServerSideFieldValidation
特性门控也已启用。
有效值为:
ServerSideFieldValidation
特性门控被禁用时的默认行为。ServerSideFieldValidation
特性门控时的默认值。Force 将“强制”应用请求。这意味着用户将重新获得他人拥有的冲突领域。 对于非应用补丁请求,Force 标志必须不设置。
删除对象前的持续时间(秒数)。值必须为非负整数。取值为 0 表示立即删除。 如果该值为 nil,将使用指定类型的默认宽限期。如果没有指定,默认为每个对象的设置值。0 表示立即删除。
通过标签限制返回对象列表的选择器。默认为返回所有对象。
limit 是一个列表调用返回的最大响应数。如果有更多的条目,服务器会将列表元数据上的 'continue' 字段设置为一个值,该值可以用于相同的初始查询来检索下一组结果。
设置 limit 可能会在所有请求的对象被过滤掉的情况下返回少于请求的条目数量(下限为零), 并且客户端应该只根据 continue 字段是否存在来确定是否有更多的结果可用。 服务器可能选择不支持 limit 参数,并将返回所有可用的结果。 如果指定了 limit 并且 continue 字段为空,客户端可能会认为没有更多的结果可用。 如果 watch 为 true,则不支持此字段。
服务器保证在使用 continue 时返回的对象将与不带 limit 的列表调用相同,—— 也就是说,在发出第一个请求后所创建、修改或删除的对象将不包含在任何后续的继续请求中。
这有时被称为一致性快照,确保使用 limit 的客户端在分块接收非常大的结果的客户端能够看到所有可能的对象。 如果对象在分块列表期间被更新,则返回计算第一个列表结果时存在的对象版本。
对象名称和身份验证范围,例如用于团队和项目。
如果设置为 'true' ,那么输出是规范的打印。
该字段决定是否以及如何执行垃圾收集。可以设置此字段或 OrphanDependents,但不能同时设置。 默认策略由 metadata.finalizers 和特定资源的默认策略设置决定。可接受的值是:
resourceVersion 对请求所针对的资源版本设置约束。 详情请参见 https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions。
默认不设置
resourceVersionMatch 字段决定如何将 resourceVersion 应用于列表调用。 强烈建议对设置了 resourceVersion 的列表调用设置 resourceVersion 匹配, 具体请参见 https://kubernetes.io/docs/reference/using-api/api-concepts/#resource-versions。
默认不设置
list/watch 调用的超时秒数。这选项限制调用的持续时间,无论是否有活动。
监视对所述资源的更改,并将其这类变更以添加、更新和删除通知流的形式返回。指定 resourceVersion。