From fac977c2659083203627faaa9f25bcc994dfbf34 Mon Sep 17 00:00:00 2001 From: Jason Gwartz Date: Sun, 2 Jun 2019 18:06:13 +0200 Subject: [PATCH 1/2] Clarifies how to set `minAvailable` using a percentage --- content/en/docs/tasks/run-application/configure-pdb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/run-application/configure-pdb.md b/content/en/docs/tasks/run-application/configure-pdb.md index acc0fcc652e14..8efe3679ca66e 100644 --- a/content/en/docs/tasks/run-application/configure-pdb.md +++ b/content/en/docs/tasks/run-application/configure-pdb.md @@ -84,7 +84,7 @@ Values for `minAvailable` or `maxUnavailable` can be expressed as integers or as - When you specify an integer, it represents a number of Pods. For instance, if you set `minAvailable` to 10, then 10 Pods must always be available, even during a disruption. - When you specify a percentage by setting the value to a floating-point value between 0 and 1, it represents a percentage of - total Pods. For instance, if you set `minUnavailable` to `.5`, then only 50% of the Pods can be unavailable during a + total Pods. For instance, if you set `minUnavailable` to `"50%"`, then only 50% of the Pods can be unavailable during a disruption. When you specify the value as a percentage, it may not map to an exact number of Pods. For example, if you have 7 Pods and From d75ca58be9d40858435a0e3176984741f41d0b55 Mon Sep 17 00:00:00 2001 From: Jason Gwartz Date: Sat, 8 Jun 2019 10:31:40 +0200 Subject: [PATCH 2/2] Fixes other references to percentages --- content/en/docs/tasks/run-application/configure-pdb.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/run-application/configure-pdb.md b/content/en/docs/tasks/run-application/configure-pdb.md index 8efe3679ca66e..1ad39467f8242 100644 --- a/content/en/docs/tasks/run-application/configure-pdb.md +++ b/content/en/docs/tasks/run-application/configure-pdb.md @@ -83,12 +83,12 @@ Values for `minAvailable` or `maxUnavailable` can be expressed as integers or as - When you specify an integer, it represents a number of Pods. For instance, if you set `minAvailable` to 10, then 10 Pods must always be available, even during a disruption. -- When you specify a percentage by setting the value to a floating-point value between 0 and 1, it represents a percentage of +- When you specify a percentage by setting the value to a string representation of a percentage (eg. `"50%"`), it represents a percentage of total Pods. For instance, if you set `minUnavailable` to `"50%"`, then only 50% of the Pods can be unavailable during a disruption. When you specify the value as a percentage, it may not map to an exact number of Pods. For example, if you have 7 Pods and -you set `minAvailable` to `.5`, it's not immediately obvious whether that means 3 Pods or 4 Pods must be available. +you set `minAvailable` to `"50%"`, it's not immediately obvious whether that means 3 Pods or 4 Pods must be available. Kubernetes rounds up to the nearest integer, so in this case, 4 Pods must be available. You can examine the [code](https://github.com/kubernetes/kubernetes/blob/23be9587a0f8677eb8091464098881df939c44a9/pkg/controller/disruption/disruption.go#L539) that controls this behavior.