blob: 088eaf4516f9c7e6a511752c98b47033b28422bd [file] [log] [blame]
gio07eb1082024-10-25 14:35:56 +04001{{- /*
2Copyright Broadcom, Inc. All Rights Reserved.
3SPDX-License-Identifier: APACHE-2.0
4*/}}
5
6{{- if (include "mongodb.arbiter.enabled" .) }}
7apiVersion: v1
8kind: Service
9metadata:
10 name: {{ include "mongodb.arbiter.service.nameOverride" . }}
11 namespace: {{ include "mongodb.namespace" . | quote }}
12 labels: {{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
13 app.kubernetes.io/component: arbiter
14 {{- if or .Values.arbiter.service.headless.annotations .Values.commonAnnotations }}
15 {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.arbiter.service.headless.annotations .Values.commonAnnotations ) "context" . ) }}
16 annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $) | nindent 4 }}
17 {{- end }}
18spec:
19 type: ClusterIP
20 clusterIP: None
21 ports:
22 - name: tcp-mongodb
23 port: {{ .Values.arbiter.service.ports.mongodb }}
24 targetPort: mongodb
25 {{- if .Values.arbiter.service.extraPorts }}
26 {{- include "common.tplvalues.render" (dict "value" .Values.arbiter.service.extraPorts "context" $) | nindent 4 }}
27 {{- end }}
28 {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.arbiter.podLabels .Values.commonLabels ) "context" . ) }}
29 selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
30 app.kubernetes.io/component: arbiter
31{{- end }}