# PodDisruptionBudget

PodDisruptionBudgetPodDisruptionBudget is an object to define the max disruption that can be caused to a collection of pods.apiVersion: policy/v1import "k8s.io/api/policy/v1"PodDisruptionBudgetPodDisruptionBudget is an object to define the max disruption that can be caused to a collection of podsapiVersion: policy/v1kind: PodDisruptionBudgetmetadata (ObjectMeta)Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataspec (PodDisruptionBudgetSpec)Specification of the desired behavior of the PodDisruptionBudget.status (PodDisruptionBudgetStatus)Most recently observed status of the PodDisruptionBudget.PodDisruptionBudgetSpecPodDisruptionBudgetSpec is a description of a PodDisruptionBudget.maxUnavailable (IntOrString)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".IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.minAvailable (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%".IntOrString is a type that can hold an int32 or a string. When used in JSON or YAML marshalling and unmarshalling, it produces or consumes the inner type. This allows you to have, for example, a JSON field that can accept a name or number.selector (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.unhealthyPodEvictionPolicy (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.PodDisruptionBudgetStatusPodDisruptionBudgetStatus represents information about the status of a PodDisruptionBudget. Status may trail the actual state of a system.currentHealthy (int32), requiredcurrent number of healthy podsdesiredHealthy (int32), requiredminimum desired number of healthy podsdisruptionsAllowed (int32), requiredNumber of pod disruptions that are currently allowed.expectedPods (int32), requiredtotal number of pods counted by this disruption budgetconditions ([]Condition)Patch strategy: merge on key typeMap: unique values on key type will be kept during a mergeConditions contain conditions for PDB. The disruption controller sets the DisruptionAllowed condition. The following are known values for the reason field (additional reasons could be added in the future): - SyncFailed: The controller encountered an error and wasn't able to compute the number of allowed disruptions. Therefore no disruptions are allowed and the status of the condition will be False.InsufficientPods: The number of pods are either at or below the number required by the PodDisruptionBudget. No disruptions are allowed and the status of the condition will be False.SufficientPods: There are more pods than required by the PodDisruptionBudget. The condition will be True, and the number of allowed disruptions are provided by the disruptionsAllowed property.Condition contains details for one aspect of the current state of this API Resource.conditions.lastTransitionTime (Time), requiredlastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.conditions.message (string), requiredmessage is a human readable message indicating details about the transition. This may be an empty string.conditions.reason (string), requiredreason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.conditions.status (string), requiredstatus of the condition, one of True, False, Unknown.conditions.type (string), requiredtype of condition in CamelCase or in foo.example.com/CamelCase.conditions.observedGeneration (int64)observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.disruptedPods (map[string]Time)DisruptedPods contains information about pods whose eviction was processed by the API server eviction subresource handler but has not yet been observed by the PodDisruptionBudget controller. A pod will be in this map from the time when the API server processed the eviction request to the time when the pod is seen by PDB controller as having been marked for deletion (or after a timeout). The key in the map is the name of the pod and the value is the time when the API server processed the eviction request. If the deletion didn't occur and a pod is still there it will be removed from the list automatically by PodDisruptionBudget controller after some time. If everything goes smooth this map should be empty for the most of the time. Large number of entries in the map may indicate problems with pod deletions.Time is a wrapper around time.Time which supports correct marshaling to YAML and JSON. Wrappers are provided for many of the factory methods that the time package offers.observedGeneration (int64)Most recent generation observed when updating this PDB status. DisruptionsAllowed and other status information is valid only if observedGeneration equals to PDB's object generation.PodDisruptionBudgetListPodDisruptionBudgetList is a collection of PodDisruptionBudgets.apiVersion: policy/v1kind: PodDisruptionBudgetListmetadata (ListMeta)Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadataitems ([]PodDisruptionBudget), requiredItems is a list of PodDisruptionBudgetsOperationsget read the specified PodDisruptionBudgetHTTP RequestGET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}Parametersname (in path): string, requiredname of the PodDisruptionBudgetnamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (PodDisruptionBudget): OK401: Unauthorizedget read status of the specified PodDisruptionBudgetHTTP RequestGET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/statusParametersname (in path): string, requiredname of the PodDisruptionBudgetnamespace (in path): string, requirednamespacepretty (in query): stringprettyResponse200 (PodDisruptionBudget): OK401: Unauthorizedlist list or watch objects of kind PodDisruptionBudgetHTTP RequestGET /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgetsParametersnamespace (in path): string, requirednamespaceallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (PodDisruptionBudgetList): OK401: Unauthorizedlist list or watch objects of kind PodDisruptionBudgetHTTP RequestGET /apis/policy/v1/poddisruptionbudgetsParametersallowWatchBookmarks (in query): booleanallowWatchBookmarkscontinue (in query): stringcontinuefieldSelector (in query): stringfieldSelectorlabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondswatch (in query): booleanwatchResponse200 (PodDisruptionBudgetList): OK401: Unauthorizedcreate create a PodDisruptionBudgetHTTP RequestPOST /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgetsParametersnamespace (in path): string, requirednamespacebody: PodDisruptionBudget, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (PodDisruptionBudget): OK201 (PodDisruptionBudget): Created202 (PodDisruptionBudget): Accepted401: Unauthorizedupdate replace the specified PodDisruptionBudgetHTTP RequestPUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}Parametersname (in path): string, requiredname of the PodDisruptionBudgetnamespace (in path): string, requirednamespacebody: PodDisruptionBudget, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (PodDisruptionBudget): OK201 (PodDisruptionBudget): Created401: Unauthorizedupdate replace status of the specified PodDisruptionBudgetHTTP RequestPUT /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/statusParametersname (in path): string, requiredname of the PodDisruptionBudgetnamespace (in path): string, requirednamespacebody: PodDisruptionBudget, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationpretty (in query): stringprettyResponse200 (PodDisruptionBudget): OK201 (PodDisruptionBudget): Created401: Unauthorizedpatch partially update the specified PodDisruptionBudgetHTTP RequestPATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}Parametersname (in path): string, requiredname of the PodDisruptionBudgetnamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (PodDisruptionBudget): OK201 (PodDisruptionBudget): Created401: Unauthorizedpatch partially update status of the specified PodDisruptionBudgetHTTP RequestPATCH /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}/statusParametersname (in path): string, requiredname of the PodDisruptionBudgetnamespace (in path): string, requirednamespacebody: Patch, requireddryRun (in query): stringdryRunfieldManager (in query): stringfieldManagerfieldValidation (in query): stringfieldValidationforce (in query): booleanforcepretty (in query): stringprettyResponse200 (PodDisruptionBudget): OK201 (PodDisruptionBudget): Created401: Unauthorizeddelete delete a PodDisruptionBudgetHTTP RequestDELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgets/{name}Parametersname (in path): string, requiredname of the PodDisruptionBudgetnamespace (in path): string, requirednamespacebody: DeleteOptionsdryRun (in query): stringdryRungracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentialpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyResponse200 (Status): OK202 (Status): Accepted401: Unauthorizeddeletecollection delete collection of PodDisruptionBudgetHTTP RequestDELETE /apis/policy/v1/namespaces/{namespace}/poddisruptionbudgetsParametersnamespace (in path): string, requirednamespacebody: DeleteOptionscontinue (in query): stringcontinuedryRun (in query): stringdryRunfieldSelector (in query): stringfieldSelectorgracePeriodSeconds (in query): integergracePeriodSecondsignoreStoreReadErrorWithClusterBreakingPotential (in query): booleanignoreStoreReadErrorWithClusterBreakingPotentiallabelSelector (in query): stringlabelSelectorlimit (in query): integerlimitpretty (in query): stringprettypropagationPolicy (in query): stringpropagationPolicyresourceVersion (in query): stringresourceVersionresourceVersionMatch (in query): stringresourceVersionMatchsendInitialEvents (in query): booleansendInitialEventstimeoutSeconds (in query): integertimeoutSecondsResponse200 (Status): OK401: UnauthorizedThis page is automatically generated.If you plan to report an issue with this page, mention that the page is auto-generated in your issue description. The fix may need to happen elsewhere in the Kubernetes project.