|
| 1 | +{{- if and .Values.podDisruptionBudget.enabled .Values.app.enabled }} |
| 2 | +{{- with .Values.podDisruptionBudget }} |
| 3 | +--- |
| 4 | +apiVersion: policy/v1 |
| 5 | +kind: PodDisruptionBudget |
| 6 | +metadata: |
| 7 | + name: {{ include "sim.fullname" $ }}-app-pdb |
| 8 | + namespace: {{ $.Release.Namespace }} |
| 9 | + labels: |
| 10 | + {{- include "sim.app.labels" $ | nindent 4 }} |
| 11 | +spec: |
| 12 | + {{- if .minAvailable }} |
| 13 | + minAvailable: {{ .minAvailable }} |
| 14 | + {{- else if .maxUnavailable }} |
| 15 | + maxUnavailable: {{ .maxUnavailable }} |
| 16 | + {{- else }} |
| 17 | + maxUnavailable: 1 |
| 18 | + {{- end }} |
| 19 | + {{- if .unhealthyPodEvictionPolicy }} |
| 20 | + unhealthyPodEvictionPolicy: {{ .unhealthyPodEvictionPolicy }} |
| 21 | + {{- end }} |
| 22 | + selector: |
| 23 | + matchLabels: |
| 24 | + {{- include "sim.app.selectorLabels" $ | nindent 6 }} |
| 25 | +{{- end }} |
| 26 | +{{- end }} |
| 27 | +{{- if and .Values.podDisruptionBudget.enabled .Values.realtime.enabled }} |
| 28 | +{{- with .Values.podDisruptionBudget }} |
| 29 | +--- |
| 30 | +apiVersion: policy/v1 |
| 31 | +kind: PodDisruptionBudget |
| 32 | +metadata: |
| 33 | + name: {{ include "sim.fullname" $ }}-realtime-pdb |
| 34 | + namespace: {{ $.Release.Namespace }} |
| 35 | + labels: |
| 36 | + {{- include "sim.realtime.labels" $ | nindent 4 }} |
| 37 | +spec: |
| 38 | + {{- if .minAvailable }} |
| 39 | + minAvailable: {{ .minAvailable }} |
| 40 | + {{- else if .maxUnavailable }} |
| 41 | + maxUnavailable: {{ .maxUnavailable }} |
| 42 | + {{- else }} |
| 43 | + maxUnavailable: 1 |
| 44 | + {{- end }} |
| 45 | + {{- if .unhealthyPodEvictionPolicy }} |
| 46 | + unhealthyPodEvictionPolicy: {{ .unhealthyPodEvictionPolicy }} |
| 47 | + {{- end }} |
| 48 | + selector: |
| 49 | + matchLabels: |
| 50 | + {{- include "sim.realtime.selectorLabels" $ | nindent 6 }} |
| 51 | +{{- end }} |
| 52 | +{{- end }} |
0 commit comments