gitdataai/deploy/templates/pdb.yaml
ZhenYi 88f58a65c0
Some checks reported errors
continuous-integration/drone/push Build encountered an error
chore(project): Initialize project basic configuration and deployment template
2026-04-14 23:39:42 +08:00

49 lines
1.6 KiB
YAML

{{- /* PodDisruptionBudgets for high-availability services */ -}}
{{- if and .Values.app.enabled .Values.app.pdb.enabled -}}
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "gitdata.fullname" . }}-app
namespace: {{ include "gitdata.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-app
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- if .Values.app.pdb.minAvailable }}
minAvailable: {{ .Values.app.pdb.minAvailable }}
{{- else if .Values.app.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.app.pdb.maxUnavailable }}
{{- else }}
minAvailable: 1
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-app
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- if and .Values.gitHook.enabled .Values.gitHook.pdb.enabled -}}
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: {{ include "gitdata.fullname" . }}-git-hook
namespace: {{ include "gitdata.namespace" . }}
labels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-git-hook
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- if .Values.gitHook.pdb.minAvailable }}
minAvailable: {{ .Values.gitHook.pdb.minAvailable }}
{{- else if .Values.gitHook.pdb.maxUnavailable }}
maxUnavailable: {{ .Values.gitHook.pdb.maxUnavailable }}
{{- else }}
minAvailable: 1
{{- end }}
selector:
matchLabels:
app.kubernetes.io/name: {{ include "gitdata.fullname" . }}-git-hook
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}