From 0eb04fc18b16f36fe944bc5702a2ef26fe974cd7 Mon Sep 17 00:00:00 2001 From: Lenin Mehedy Date: Fri, 22 Sep 2023 07:53:51 +1000 Subject: [PATCH] feat: add pod-disruption-budget config Signed-off-by: Lenin Mehedy --- charts/hedera-network/templates/pdb.yaml | 22 ++++++++++++++++++++++ charts/hedera-network/values.yaml | 12 +++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 charts/hedera-network/templates/pdb.yaml diff --git a/charts/hedera-network/templates/pdb.yaml b/charts/hedera-network/templates/pdb.yaml new file mode 100644 index 000000000..1707fad59 --- /dev/null +++ b/charts/hedera-network/templates/pdb.yaml @@ -0,0 +1,22 @@ +{{- if .Values.deployment.podDisruptionBudget.create }} +{{ range $index, $node := $.Values.hedera.nodes }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: network-{{ $node.name }}-pdb + namespace: {{ default $.Release.Namespace $.Values.global.namespaceOverride }} + labels: + fullstack.hedera.com/type: pod-disruption-budget + fullstack.hedera.com/node-name: {{ $node.name }} +spec: + selector: + matchLabels: + app: network-{{ $node.name }} + {{- if .Values.deployment.podDisruptionBudget.minAvailable }} + minAvailable: {{ .Values.deployment.podDisruptionBudget.minAvailable }} + {{- end }} + {{- if .Values.deployment.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.deployment.podDisruptionBudget.maxUnavailable }} + {{- end }} +{{- end }} +{{ end }} diff --git a/charts/hedera-network/values.yaml b/charts/hedera-network/values.yaml index 873c153d8..84fd1a6c4 100644 --- a/charts/hedera-network/values.yaml +++ b/charts/hedera-network/values.yaml @@ -290,7 +290,17 @@ deployment: # Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity affinity: {} priorityClassName: {} - podDisruptionBudget: {} + ## PodDisruptionBudget for fullstack testing pods + ## Default backend Pod Disruption Budget configuration + ## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ + ## @param deployment.podDisruptionBudget.create Enable Pod Disruption Budget configuration + ## @param deployment.podDisruptionBudget.minAvailable Minimum number/percentage of pods that should remain scheduled + ## @param deployment.podDisruptionBudget.maxUnavailable Maximum number/percentage of pods that should remain scheduled + ## + podDisruptionBudget: + create: false + minAvailable: 1 + maxUnavailable: "" # hedera node configuration # Only the name of the node is required. The rest of the configuration will be inherited from `defaults` section