Skip to content

Commit

Permalink
feat: add pod-disruption-budget config
Browse files Browse the repository at this point in the history
Signed-off-by: Lenin Mehedy <lenin.mehedy@swirldslabs.com>
  • Loading branch information
leninmehedy committed Sep 21, 2023
1 parent 1f7d68e commit 0eb04fc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
22 changes: 22 additions & 0 deletions charts/hedera-network/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
12 changes: 11 additions & 1 deletion charts/hedera-network/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0eb04fc

Please sign in to comment.