RuntimeClass

RuntimeClass 定义了集群中支持的容器运行时类别。

apiVersion: node.k8s.io/v1

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

RuntimeClass

RuntimeClass 定义了集群中支持的容器运行时类别。RuntimeClass 用于确定用于运行 pod 中所有容器的容器运行时。RuntimeClass 由用户或集群供应者手动定义,并在 PodSpec 中引用。Kubelet 负责在运行 pod 之前解析 RuntimeClassName 引用。有关更多详细信息,请参见 https://kubernetes.ac.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 (字符串), 必需

    handler 指定 CRI 实现将用来处理此类 pod 的底层运行时和配置。可能的值特定于节点和 CRI 配置。假设所有处理程序在每个节点上都可用,并且每个节点上名称相同的处理程序是等效的。例如,名为“runc”的处理程序可能指定将使用 runc OCI 运行时(使用本机 Linux 容器)来运行 pod 中的容器。Handler 必须是小写字母,符合 DNS 标签 (RFC 1123) 要求,并且是不可变的。

  • overhead (Overhead)

    overhead 表示与为给定 RuntimeClass 运行 pod 相关的资源开销。有关更多详细信息,请参见 https://kubernetes.ac.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 所容忍的节点集联合起来。

      此 Toleration 附加到的 pod 容忍任何与三元组 <key,value,effect> 匹配的污点,使用匹配操作符 .

      • scheduling.tolerations.key (字符串)

        Key 是容忍适用的污点键。空表示匹配所有污点键。如果键为空,则操作符必须为 Exists;此组合表示匹配所有值和所有键。

      • scheduling.tolerations.operator (字符串)

        Operator 表示键与值的关系。有效操作符为 Exists 和 Equal。默认值为 Equal。Exists 等效于值的通配符,因此 pod 可以容忍特定类别的所有污点。

      • scheduling.tolerations.value (字符串)

        Value 是容忍匹配的污点值。如果操作符为 Exists,则值应为空,否则仅为常规字符串。

      • scheduling.tolerations.effect (字符串)

        Effect 指示要匹配的污点效果。空表示匹配所有污点效果。当指定时,允许的值为 NoSchedule、PreferNoSchedule 和 NoExecute。

      • scheduling.tolerations.tolerationSeconds (int64)

        TolerationSeconds 表示容忍(必须是效果为 NoExecute 的容忍,否则该字段将被忽略)容忍污点的持续时间。默认情况下,它未设置,这意味着永远容忍污点(不要驱逐)。系统将零和负值视为 0(立即驱逐)。

RuntimeClassList

RuntimeClassList 是 RuntimeClass 对象的列表。


操作


get 读取指定的 RuntimeClass

HTTP 请求

GET /apis/node.k8s.io/v1/runtimeclasses/{name}

参数

  • name (在路径中): 字符串, 必需

    RuntimeClass 的名称

  • pretty (在查询中): 字符串

    pretty

响应

200 (RuntimeClass): OK

401: 未经授权

list 列出或监视 RuntimeClass 类型的对象

HTTP 请求

GET /apis/node.k8s.io/v1/runtimeclasses

参数

响应

200 (RuntimeClassList): OK

401: 未经授权

create 创建一个 RuntimeClass

HTTP 请求

POST /apis/node.k8s.io/v1/runtimeclasses

参数

响应

200 (RuntimeClass): OK

201 (RuntimeClass): 已创建

202 (RuntimeClass): 已接受

401: 未经授权

update 替换指定的 RuntimeClass

HTTP 请求

PUT /apis/node.k8s.io/v1/runtimeclasses/{name}

参数

  • name (在路径中): 字符串, 必需

    RuntimeClass 的名称

  • body: RuntimeClass, 必需

  • dryRun (在查询中): 字符串

    dryRun

  • fieldManager (在查询中): 字符串

    fieldManager

  • fieldValidation (在查询中): 字符串

    fieldValidation

  • pretty (在查询中): 字符串

    pretty

响应

200 (RuntimeClass): OK

201 (RuntimeClass): 已创建

401: 未经授权

patch 部分更新指定的 RuntimeClass

HTTP 请求

PATCH /apis/node.k8s.io/v1/runtimeclasses/{name}

参数

  • name (在路径中): 字符串, 必需

    RuntimeClass 的名称

  • body: Patch, 必需

  • dryRun (在查询中): 字符串

    dryRun

  • fieldManager (在查询中): 字符串

    fieldManager

  • fieldValidation (在查询中): 字符串

    fieldValidation

  • force (在查询中): 布尔值

    force

  • pretty (在查询中): 字符串

    pretty

响应

200 (RuntimeClass): OK

201 (RuntimeClass): 已创建

401: 未经授权

delete 删除一个 RuntimeClass

HTTP 请求

DELETE /apis/node.k8s.io/v1/runtimeclasses/{name}

参数

响应

200 (Status): OK

202 (Status): 已接受

401: 未经授权

deletecollection 删除 RuntimeClass 集合

HTTP 请求

DELETE /apis/node.k8s.io/v1/runtimeclasses

参数

响应

200 (Status): OK

401: 未经授权

此页面是自动生成的。

如果您打算报告此页面的问题,请在问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目中的其他地方进行。

上次修改时间:2023 年 4 月 3 日,太平洋标准时间上午 8:22:API Ref 多页面 v1.27 (7b39e9a9ec)