feat(helm): added pdb to helm (#1617)

* feat(helm): added pdb to helm

* add additional config
This commit is contained in:
Waleed
2025-10-13 12:06:30 -07:00
committed by GitHub
parent 1e81cd6850
commit 2da7a6755c
6 changed files with 76 additions and 8 deletions

View File

@@ -200,8 +200,9 @@ ingress:
# Pod disruption budget for high availability
podDisruptionBudget:
enabled: true
minAvailable: 1
minAvailable: null
maxUnavailable: 1
unhealthyPodEvictionPolicy: AlwaysAllow
# Network policies
networkPolicy:
enabled: true

View File

@@ -122,8 +122,9 @@ autoscaling:
podDisruptionBudget:
enabled: true
minAvailable: 1
minAvailable: null
maxUnavailable: 1
unhealthyPodEvictionPolicy: AlwaysAllow
monitoring:
serviceMonitor:
enabled: true

View File

@@ -201,8 +201,9 @@ ingress:
# Pod disruption budget for high availability
podDisruptionBudget:
enabled: true
minAvailable: 1
minAvailable: null
maxUnavailable: 1
unhealthyPodEvictionPolicy: AlwaysAllow
# Network policies
networkPolicy:
enabled: true

View File

@@ -165,7 +165,9 @@ autoscaling:
# Pod disruption budget (ensures minimum availability during cluster maintenance)
podDisruptionBudget:
enabled: true
minAvailable: 1
minAvailable: null
maxUnavailable: 1
unhealthyPodEvictionPolicy: AlwaysAllow
# Monitoring integration with Prometheus
monitoring:

View File

@@ -0,0 +1,52 @@
{{- if and .Values.podDisruptionBudget.enabled .Values.app.enabled }}
{{- with .Values.podDisruptionBudget }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "sim.fullname" $ }}-app-pdb
namespace: {{ $.Release.Namespace }}
labels:
{{- include "sim.app.labels" $ | nindent 4 }}
spec:
{{- if .minAvailable }}
minAvailable: {{ .minAvailable }}
{{- else if .maxUnavailable }}
maxUnavailable: {{ .maxUnavailable }}
{{- else }}
maxUnavailable: 1
{{- end }}
{{- if .unhealthyPodEvictionPolicy }}
unhealthyPodEvictionPolicy: {{ .unhealthyPodEvictionPolicy }}
{{- end }}
selector:
matchLabels:
{{- include "sim.app.selectorLabels" $ | nindent 6 }}
{{- end }}
{{- end }}
{{- if and .Values.podDisruptionBudget.enabled .Values.realtime.enabled }}
{{- with .Values.podDisruptionBudget }}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "sim.fullname" $ }}-realtime-pdb
namespace: {{ $.Release.Namespace }}
labels:
{{- include "sim.realtime.labels" $ | nindent 4 }}
spec:
{{- if .minAvailable }}
minAvailable: {{ .minAvailable }}
{{- else if .maxUnavailable }}
maxUnavailable: {{ .maxUnavailable }}
{{- else }}
maxUnavailable: 1
{{- end }}
{{- if .unhealthyPodEvictionPolicy }}
unhealthyPodEvictionPolicy: {{ .unhealthyPodEvictionPolicy }}
{{- end }}
selector:
matchLabels:
{{- include "sim.realtime.selectorLabels" $ | nindent 6 }}
{{- end }}
{{- end }}

View File

@@ -495,9 +495,20 @@ autoscaling:
behavior: {}
# Pod disruption budget
# Note: PDBs only protect against voluntary disruptions (node drains, autoscaler)
# They do NOT affect rolling updates - use deployment.strategy.rollingUpdate for that
podDisruptionBudget:
enabled: false
minAvailable: 1
# Use either minAvailable or maxUnavailable (not both)
# Recommendation: Use maxUnavailable as it scales better with HPA
# - minAvailable: minimum pods that must remain available (e.g., 1, "50%")
# - maxUnavailable: maximum pods that can be unavailable (e.g., 1, "25%")
minAvailable: null
maxUnavailable: 1
# unhealthyPodEvictionPolicy: allows eviction of unhealthy pods during node drains
# Options: IfHealthyBudget (default) | AlwaysAllow (recommended for production)
# Set to null to use K8s default (IfHealthyBudget)
unhealthyPodEvictionPolicy: null
# Monitoring configuration
monitoring: