Skip to content

Commit c20fc6b

Browse files
authored
Update k8s-best-practices-platform-upgrade.adoc
1 parent 4b19cbd commit c20fc6b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

modules/k8s-best-practices-platform-upgrade.adoc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,19 @@ For an application to stay healthy during this process, if they are stateful at
3737
Applications may not set the pod disruption budget to minUnavailable equal to the number of pods in the deployment/replicaset or maxUnavailable pods to zero, operations will change your pod disruption budget to proceed with an upgrade at the risk of your application.
3838
====
3939

40+
Additionally pod disruption budgets must not be set to very low numbers of unavailable; doing so prevents system patching from completing in a timely manner. Statefulsets/Replicasets/Deployments that have a requirement for pod antiaffinity spread to greater than 20% of the nodes in a given cluster must set the pod disruption budget to 20% for the set of pods.
41+
42+
.Example
43+
[source,terminal]
44+
----
45+
100 node cluster
46+
20% of nodes would be 20 nodes
47+
Any D/S 20 nodes or more would require 20% PDB
48+
49+
20 node deployment would have 4 pod PDB
50+
40 node deployment would have 8 pod PDB
51+
----
52+
4053
A corollary to the pod disruption budget is a strong readiness and health check. A well implemented readiness check is key for surviving these upgrades in that a pod should not report itself ready to kubernetes until it is actually ready to take over the load from another pod of the example set. An example of this being implemented poorly would be for a pod to report itself ready but it is not in sync with the other DB pods in the example above. Kubernetes could see that three of the pods are "ready" and destroy a second pod and cause disruption to the DB leading to failure of the application served by said DB.
4154

4255
See link:https://kubernetes.io/docs/tasks/run-application/configure-pdb/[pod disruption budget reference], link:https://docs.openshift.com/container-platform/latest/rest_api/policy_apis/poddisruptionbudget-policy-v1.html[pod disruption budget policy & API].

0 commit comments

Comments
 (0)