updating helm/docker files and database config files
[it/otf.git] / otf-helm / otf / charts / databases / mongodb / templates / svc-headless-rs.yaml
diff --git a/otf-helm/otf/charts/databases/mongodb/templates/svc-headless-rs.yaml b/otf-helm/otf/charts/databases/mongodb/templates/svc-headless-rs.yaml
new file mode 100644 (file)
index 0000000..a850752
--- /dev/null
@@ -0,0 +1,24 @@
+{{- if .Values.replicaSet.enabled }}
+apiVersion: v1
+kind: Service
+metadata:
+  name: {{ template "mongodb.fullname" . }}-headless
+  namespace: {{.Values.namespace }}
+  labels:
+    app: {{ template "mongodb.name" . }}
+    chart: {{ template "mongodb.chart" . }}
+    release: "{{ .Release.Name }}"
+    heritage: "{{ .Release.Service }}"
+{{- with .Values.service.annotations }}
+  annotations: {{ tpl (toYaml .) $ | nindent 4 }}
+{{- end }}
+spec:
+  type: ClusterIP
+  clusterIP: None
+  ports:
+  - name: mongodb
+    port: {{ .Values.service.port }}
+  selector:
+    app: {{ template "mongodb.name" . }}
+    release: {{ .Release.Name }}
+{{- end }}