updating helm/docker files and database config files
[it/otf.git] / otf-helm / otf / charts / databases / mongodb / templates / poddisruptionbudget-secondary-rs.yaml
diff --git a/otf-helm/otf/charts/databases/mongodb/templates/poddisruptionbudget-secondary-rs.yaml b/otf-helm/otf/charts/databases/mongodb/templates/poddisruptionbudget-secondary-rs.yaml
new file mode 100644 (file)
index 0000000..6cadc60
--- /dev/null
@@ -0,0 +1,28 @@
+{{- if and .Values.replicaSet.enabled .Values.replicaSet.pdb.enabled }}
+apiVersion: policy/v1beta1
+kind: PodDisruptionBudget
+metadata:
+  labels:
+    app: {{ template "mongodb.name" . }}
+    chart: {{ template "mongodb.chart" . }}
+    heritage: {{ .Release.Service }}
+    release: {{ .Release.Name }}
+  name: {{ template "mongodb.fullname" . }}-secondary
+  namespace: {{.Values.namespace }}
+spec:
+  {{- if .Values.replicaSet.pdb.minAvailable }}
+  {{- if .Values.replicaSet.pdb.minAvailable.secondary }}
+  minAvailable: {{ .Values.replicaSet.pdb.minAvailable.secondary }}
+  {{- end }}
+  {{- end }}
+  {{- if .Values.replicaSet.pdb.maxUnavailable }}
+  {{- if .Values.replicaSet.pdb.maxUnavailable.secondary }}
+  maxUnavailable: {{ .Values.replicaSet.pdb.maxUnavailable.secondary }}
+  {{- end }}
+  {{- end }}
+  selector:
+    matchLabels:
+      app: {{ template "mongodb.name" . }}
+      release: {{ .Release.Name }}
+      component: secondary
+{{- end }}