#
#  Author: Hari Sekhon
#  Date: [% DATE  # 2020-02-13 12:54:31 +0000 (Thu, 13 Feb 2020) %]
#
#  vim:ts=2:sts=2:sw=2:et
#
#  https://github.com/harisekhon/Kubernetes-configs
#
#  License: see accompanying Hari Sekhon LICENSE file
#
#  If you're using my code you're welcome to connect with me on LinkedIn
#  and optionally send me feedback to help improve or steer this or other code I publish
#
#  https://www.linkedin.com/in/HariSekhon
#

# ============================================================================ #
#                   P o d   D i s r u p t i o n   B u d g e t
# ============================================================================ #

# https://kubernetes.io/docs/tasks/run-application/configure-pdb/

# https://kubernetes.io/docs/concepts/workloads/pods/disruptions/

# https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/

---
#apiVersion: policy/v1beta1  # Kubernetes v1.5+
apiVersion: policy/v1      # Kubernetes v1.21+
kind: PodDisruptionBudget
metadata:
  name: zk-pdb
  namespace: NAMESPACE
spec:
  # minAvailable and maxUnavailable are mutually exclusive
  # minAvailable: 4    # < 1.7  - must calculate yourself, eg 2/3, or 4/5
  maxUnavailable: 25%  #   1.7+ - XXX: do not set to integers, you may cause outages if replicas <= maxUnavailable
  selector:
    matchLabels:
      app: zookeeper
