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 的标签查询,其剔除由中断预算管理。空选择器将不匹配任何 Pod,而空 ({}) 选择器将选择命名空间内的所有 Pod。
unhealthyPodEvictionPolicy (string)
UnhealthyPodEvictionPolicy 定义了何时应考虑剔除不健康的 Pod 的标准。目前的实现将健康 Pod 视为具有 type="Ready"、status="True" 的 status.conditions 条目的 Pod。
有效的策略是 IfHealthyBudget 和 AlwaysAllow。如果未指定策略,将使用默认行为,这对应于 IfHealthyBudget 策略。
IfHealthyBudget 策略意味着运行中(status.phase="Running")但尚未健康的 Pod 只有在受保护的应用程序未中断(status.currentHealthy 至少等于 status.desiredHealthy)时才可以被剔除。健康的 Pod 将受 PDB 的剔除限制。
AlwaysAllow 策略意味着所有运行中(status.phase="Running")但尚未健康的 Pod 都被视为已中断,并且无论是否满足 PDB 中的标准,都可以被剔除。这意味着受中断应用程序中预期运行的 Pod 可能没有机会变得健康。健康的 Pod 将受 PDB 的剔除限制。
未来可能会添加额外的策略。如果客户端在此字段中遇到无法识别的策略,则在做出剔除决定时应禁止剔除不健康的 Pod。
可能的枚举值
"AlwaysAllow" 策略意味着所有运行中(status.phase="Running")但尚未健康的 Pod 都被视为已中断,并且无论是否满足 PDB 中的标准,都可以被剔除。这意味着受中断应用程序中预期运行的 Pod 可能没有机会变得健康。健康的 Pod 将受 PDB 的剔除限制。"IfHealthyBudget" 策略意味着运行中(status.phase="Running")但尚未健康的 Pod 只有在受保护的应用程序未中断(status.currentHealthy 至少等于 status.desiredHealthy)时才可以被剔除。健康的 Pod 将受 PDB 的剔除限制。PodDisruptionBudgetStatus 代表有关 PodDisruptionBudget 状态的信息。状态可能会滞后于系统的实际状态。
currentHealthy (int32),必需
当前健康的 Pod 数量
desiredHealthy (int32),必需
期望的最少健康 Pod 数量
disruptionsAllowed (int32),必需
当前允许的 Pod 中断数量。
expectedPods (int32),必需
此中断预算计算的总 Pod 数量
conditions ([]Condition)
Patch 策略:在键 type 上合并
映射:在合并期间将保留键类型上的唯一值
Conditions 包含 PDB 的条件。中断控制器设置 DisruptionAllowed 条件。以下是 reason 字段的已知值(未来可能会添加更多原因):- SyncFailed:控制器遇到错误,无法计算允许的中断数量。因此不允许中断,条件的各种状态将为 False。
Condition 包含此 API 资源当前状态的一个方面的详细信息。
conditions.lastTransitionTime (Time), required
lastTransitionTime 是条件从一个状态过渡到另一个状态的最后时间。这应该是在底层条件发生变化时的时间。如果不知道,则使用 API 字段发生变化的时间是可以接受的。
Time 是 time.Time 的包装器,支持正确地编组到 YAML 和 JSON。为时间包提供的许多工厂方法提供包装器。
conditions.message (string), required
message 是一个人类可读的消息,指示过渡的详细信息。这可能是一个空字符串。
conditions.reason (string), required
reason 包含一个程序化标识符,指示条件上次转换的原因。特定条件类型的生产者可以为此字段定义期望值和含义,以及这些值是否被视为保证的 API。该值应为 CamelCase 字符串。此字段不能为空。
conditions.status (string), required
条件的 status,可以是 True、False 或 Unknown。
conditions.type (string), required
条件的类型,采用 CamelCase 格式或 foo.example.com/CamelCase 格式。
conditions.observedGeneration (int64)
observedGeneration 表示设置该条件时所依据的 .metadata.generation。例如,如果 .metadata.generation 当前为 12,但 .status.conditions[x].observedGeneration 为 9,则该条件相对于实例的当前状态已过时。
disruptedPods (map[string]Time)
DisruptedPods 包含有关 API 服务器剔除子资源处理程序已处理但 PodDisruptionBudget 控制器尚未观察到的剔除的 Pod 的信息。从 API 服务器处理剔除请求到 PodDisruptionBudget 控制器看到 Pod 已被标记为删除(或超时后),Pod 将处于此映射中。映射中的键是 Pod 的名称,值是 API 服务器处理剔除请求的时间。如果删除未发生且 Pod 仍然存在,它将在一段时间后由 PodDisruptionBudget 控制器自动从列表中删除。如果一切顺利,此映射在大多数时间应该是空的。映射中的大量条目可能表明 Pod 删除存在问题。
Time 是 time.Time 的包装器,支持正确地编组到 YAML 和 JSON。为时间包提供的许多工厂方法提供包装器。
observedGeneration (int64)
更新此 PDB 状态时观察到的最新一代。仅当 observedGeneration 等于 PDB 对象代数时,disruptionsAllowed 和其他状态信息才有效。
PodDisruptionBudgetList 是 PodDisruptionBudgets 的集合。
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: 未授权
get 读取指定的 PodDisruptionBudget 的状态GET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status
name (在路径中): string, 必需
PodDisruptionBudget 的名称
namespace (在路径中): string, 必需
pretty (在查询中): string
200 (PodDisruptionBudget):OK
401: 未授权
list 列出或监视 PodDisruptionBudget 类型的对象GET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets
namespace (在路径中): string, 必需
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (在查询中): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
200 (PodDisruptionBudgetList):OK
401: 未授权
list 列出或监视 PodDisruptionBudget 类型的对象GET /apis/policy/v1/poddisruptionbudgets
allowWatchBookmarks (in query): boolean
continue (in query): string
fieldSelector (in query): string
labelSelector (in query): string
limit (in query): integer
pretty (在查询中): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
watch (in query): boolean
200 (PodDisruptionBudgetList):OK
401: 未授权
create 创建一个 PodDisruptionBudgetPOST /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets
namespace (在路径中): string, 必需
body: PodDisruptionBudget,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
200 (PodDisruptionBudget):OK
201 (PodDisruptionBudget):已创建
202 (PodDisruptionBudget):已接受
401: 未授权
update 替换指定的 PodDisruptionBudgetPUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}
name (在路径中): string, 必需
PodDisruptionBudget 的名称
namespace (在路径中): string, 必需
body: PodDisruptionBudget,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
200 (PodDisruptionBudget):OK
201 (PodDisruptionBudget):已创建
401: 未授权
update 替换指定的 PodDisruptionBudget 的状态PUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status
name (在路径中): string, 必需
PodDisruptionBudget 的名称
namespace (在路径中): string, 必需
body: PodDisruptionBudget,必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
pretty (在查询中): string
200 (PodDisruptionBudget):OK
201 (PodDisruptionBudget):已创建
401: 未授权
patch 部分更新指定的 PodDisruptionBudgetPATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}
name (在路径中): string, 必需
PodDisruptionBudget 的名称
namespace (在路径中): string, 必需
body: Patch, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (in query): boolean
pretty (在查询中): string
200 (PodDisruptionBudget):OK
201 (PodDisruptionBudget):已创建
401: 未授权
patch 部分更新指定的 PodDisruptionBudget 的状态PATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/status
name (在路径中): string, 必需
PodDisruptionBudget 的名称
namespace (在路径中): string, 必需
body: Patch, 必需
dryRun (在查询中): string
fieldManager (在查询中): string
fieldValidation (在查询中): string
force (in query): boolean
pretty (在查询中): string
200 (PodDisruptionBudget):OK
201 (PodDisruptionBudget):已创建
401: 未授权
delete 删除一个 PodDisruptionBudgetDELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}
name (在路径中): string, 必需
PodDisruptionBudget 的名称
namespace (在路径中): string, 必需
body: DeleteOptions
dryRun (在查询中): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
pretty (在查询中): string
propagationPolicy (in query): string
200 (Status): 确定
202 (Status): 已接受
401: 未授权
deletecollection 删除 PodDisruptionBudget 集合DELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets
namespace (在路径中): string, 必需
body: DeleteOptions
continue (in query): string
dryRun (在查询中): string
fieldSelector (in query): string
gracePeriodSeconds (in query): integer
ignoreStoreReadErrorWithClusterBreakingPotential (in query): boolean
labelSelector (in query): string
limit (in query): integer
pretty (在查询中): string
propagationPolicy (in query): string
resourceVersion (in query): string
resourceVersionMatch (in query): string
sendInitialEvents (in query): boolean
timeoutSeconds (in query): integer
200 (Status): 确定
401: 未授权
本页面是自动生成的。
如果您打算报告此页面的问题,请在您的问题描述中提及该页面是自动生成的。修复可能需要在 Kubernetes 项目的其他地方进行。