-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #58642 from bergerhoffer/pr-57505-cp-413
OSDOCS-5336: Adding PDBUnhealthyPodEvictionPolicy as tech preview fea…
- Loading branch information
Showing
6 changed files
with
84 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
// Module included in the following assemblies: | ||
// | ||
// * nodes/nodes-pods-configuring.adoc | ||
// * nodes/nodes-cluster-pods-configuring | ||
// * post_installation_configuration/cluster-tasks.adoc | ||
|
||
:_content-type: PROCEDURE | ||
[id="pod-disruption-eviction-policy_{context}"] | ||
= Specifying the eviction policy for unhealthy pods | ||
|
||
When you use pod disruption budgets (PDBs) to specify how many pods must be available simultaneously, you can also define the criteria for how unhealthy pods are considered for eviction. | ||
|
||
You can choose one of the following policies: | ||
|
||
IfHealthyBudget:: Running pods that are not yet healthy can be evicted only if the guarded application is not disrupted. | ||
|
||
AlwaysAllow:: Running pods that are not yet healthy can be evicted regardless of whether the criteria in the pod disruption budget is met. This policy can help evict malfunctioning applications, such as ones with pods stuck in the `CrashLoopBackOff` state or failing to report the `Ready` status. | ||
|
||
:FeatureName: Specifying the unhealthy pod eviction policy for pod disruption budgets | ||
include::snippets/technology-preview.adoc[] | ||
|
||
To use this Technology Preview feature, you must have enabled the `TechPreviewNoUpgrade` feature set. | ||
|
||
[WARNING] | ||
==== | ||
Enabling the `TechPreviewNoUpgrade` feature set on your cluster cannot be undone and prevents minor version updates. You should not enable this feature set on production clusters. | ||
==== | ||
|
||
.Procedure | ||
|
||
. Create a YAML file that defines a `PodDisruptionBudget` object and specify the unhealthy pod eviction policy: | ||
+ | ||
.Example `pod-disruption-budget.yaml` file | ||
[source,yaml] | ||
---- | ||
apiVersion: policy/v1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: my-pdb | ||
spec: | ||
minAvailable: 2 | ||
selector: | ||
matchLabels: | ||
foo: bar | ||
unhealthyPodEvictionPolicy: AlwaysAllow <1> | ||
---- | ||
<1> Choose either `IfHealthyBudget` or `AlwaysAllow` as the unhealthy pod eviction policy. The default is `IfHealthyBudget` when the `unhealthyPodEvictionPolicy` field is empty. | ||
|
||
. Create the `PodDisruptionBudget` object by running the following command: | ||
+ | ||
[source,terminal] | ||
---- | ||
$ oc create -f pod-disruption-budget.yaml | ||
---- | ||
|
||
With a PDB that has the `AlwaysAllow` unhealthy pod eviction policy set, you can now drain nodes and evict the pods for a malfunctioning application guarded by this PDB. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters