mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-10 15:38:00 -05:00
feat(helm): added pdb to helm (#1617)
* feat(helm): added pdb to helm * add additional config
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -122,8 +122,9 @@ autoscaling:
|
||||
|
||||
podDisruptionBudget:
|
||||
enabled: true
|
||||
minAvailable: 1
|
||||
|
||||
minAvailable: null
|
||||
maxUnavailable: 1
|
||||
unhealthyPodEvictionPolicy: AlwaysAllow
|
||||
monitoring:
|
||||
serviceMonitor:
|
||||
enabled: true
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
52
helm/sim/templates/poddisruptionbudget.yaml
Normal file
52
helm/sim/templates/poddisruptionbudget.yaml
Normal 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 }}
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user