Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions helm/sim/examples/values-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions helm/sim/examples/values-external-db.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ autoscaling:

podDisruptionBudget:
enabled: true
minAvailable: 1

minAvailable: null
maxUnavailable: 1
unhealthyPodEvictionPolicy: AlwaysAllow
monitoring:
serviceMonitor:
enabled: true
Expand Down
5 changes: 3 additions & 2 deletions helm/sim/examples/values-gcp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion helm/sim/examples/values-production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
52 changes: 52 additions & 0 deletions helm/sim/templates/poddisruptionbudget.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
13 changes: 12 additions & 1 deletion helm/sim/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down