Struct k8s_openapi::api::policy::v1::PodDisruptionBudgetSpec
source · pub struct PodDisruptionBudgetSpec {
pub max_unavailable: Option<IntOrString>,
pub min_available: Option<IntOrString>,
pub selector: Option<LabelSelector>,
pub unhealthy_pod_eviction_policy: Option<String>,
}
Expand description
PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
Fields§
An eviction is allowed if at most “maxUnavailable” pods selected by “selector” are unavailable after the eviction, i.e. even in absence of the evicted pod. For example, one can prevent all voluntary evictions by specifying 0. This is a mutually exclusive setting with “minAvailable”.
min_available: Option<IntOrString>
An eviction is allowed if at least “minAvailable” pods selected by “selector” will still be available after the eviction, i.e. even in the absence of the evicted pod. So for example you can prevent all voluntary evictions by specifying “100%”.
selector: Option<LabelSelector>
Label query over pods whose evictions are managed by the disruption budget. A null selector will match no pods, while an empty ({}) selector will select all pods within the namespace.
unhealthy_pod_eviction_policy: Option<String>
UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction. Current implementation considers healthy pods, as pods that have status.conditions item with type=“Ready”,status=“True”.
Valid policies are IfHealthyBudget and AlwaysAllow. If no policy is specified, the default behavior will be used, which corresponds to the IfHealthyBudget policy.
IfHealthyBudget policy means that running pods (status.phase=“Running”), but not yet healthy can be evicted only if the guarded application is not disrupted (status.currentHealthy is at least equal to status.desiredHealthy). Healthy pods will be subject to the PDB for eviction.
AlwaysAllow policy means that all running pods (status.phase=“Running”), but not yet healthy are considered disrupted and can be evicted regardless of whether the criteria in a PDB is met. This means perspective running pods of a disrupted application might not get a chance to become healthy. Healthy pods will be subject to the PDB for eviction.
Additional policies may be added in the future. Clients making eviction decisions should disallow eviction of unhealthy pods if they encounter an unrecognized policy in this field.
This field is beta-level. The eviction API uses this field when the feature gate PDBUnhealthyPodEvictionPolicy is enabled (enabled by default).
Trait Implementations§
source§impl Clone for PodDisruptionBudgetSpec
impl Clone for PodDisruptionBudgetSpec
source§fn clone(&self) -> PodDisruptionBudgetSpec
fn clone(&self) -> PodDisruptionBudgetSpec
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PodDisruptionBudgetSpec
impl Debug for PodDisruptionBudgetSpec
source§impl DeepMerge for PodDisruptionBudgetSpec
impl DeepMerge for PodDisruptionBudgetSpec
source§fn merge_from(&mut self, other: Self)
fn merge_from(&mut self, other: Self)
other
into self
.source§impl Default for PodDisruptionBudgetSpec
impl Default for PodDisruptionBudgetSpec
source§fn default() -> PodDisruptionBudgetSpec
fn default() -> PodDisruptionBudgetSpec
source§impl<'de> Deserialize<'de> for PodDisruptionBudgetSpec
impl<'de> Deserialize<'de> for PodDisruptionBudgetSpec
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl PartialEq for PodDisruptionBudgetSpec
impl PartialEq for PodDisruptionBudgetSpec
source§fn eq(&self, other: &PodDisruptionBudgetSpec) -> bool
fn eq(&self, other: &PodDisruptionBudgetSpec) -> bool
self
and other
values to be equal, and is used
by ==
.