Class PodDisruptionBudgetSpec
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.policy.v1.PodDisruptionBudgetSpec
-
- All Implemented Interfaces:
com.marcnuri.yakc.model.Model
public class PodDisruptionBudgetSpec extends java.lang.Object implements com.marcnuri.yakc.model.Model
PodDisruptionBudgetSpec is a description of a PodDisruptionBudget.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PodDisruptionBudgetSpec.Builder
-
Constructor Summary
Constructors Constructor Description PodDisruptionBudgetSpec()
PodDisruptionBudgetSpec(java.lang.String maxUnavailable, java.lang.String minAvailable, LabelSelector selector, java.lang.String unhealthyPodEvictionPolicy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PodDisruptionBudgetSpec.Builder
builder()
protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
java.lang.String
getMaxUnavailable()
java.lang.String
getMinAvailable()
LabelSelector
getSelector()
java.lang.String
getUnhealthyPodEvictionPolicy()
UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction.int
hashCode()
void
setMaxUnavailable(java.lang.String maxUnavailable)
void
setMinAvailable(java.lang.String minAvailable)
void
setSelector(LabelSelector selector)
void
setUnhealthyPodEvictionPolicy(java.lang.String unhealthyPodEvictionPolicy)
UnhealthyPodEvictionPolicy defines the criteria for when unhealthy pods should be considered for eviction.PodDisruptionBudgetSpec.Builder
toBuilder()
java.lang.String
toString()
-
-
-
Constructor Detail
-
PodDisruptionBudgetSpec
public PodDisruptionBudgetSpec(java.lang.String maxUnavailable, java.lang.String minAvailable, LabelSelector selector, java.lang.String unhealthyPodEvictionPolicy)
-
PodDisruptionBudgetSpec
public PodDisruptionBudgetSpec()
-
-
Method Detail
-
builder
public static PodDisruptionBudgetSpec.Builder builder()
-
toBuilder
public PodDisruptionBudgetSpec.Builder toBuilder()
-
getMaxUnavailable
public java.lang.String getMaxUnavailable()
-
getMinAvailable
public java.lang.String getMinAvailable()
-
getSelector
public LabelSelector getSelector()
-
getUnhealthyPodEvictionPolicy
public java.lang.String getUnhealthyPodEvictionPolicy()
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).
-
setMaxUnavailable
public void setMaxUnavailable(java.lang.String maxUnavailable)
-
setMinAvailable
public void setMinAvailable(java.lang.String minAvailable)
-
setSelector
public void setSelector(LabelSelector selector)
-
setUnhealthyPodEvictionPolicy
public void setUnhealthyPodEvictionPolicy(java.lang.String unhealthyPodEvictionPolicy)
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).
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-