blob: eb6337d42c90d478104e89db6ae376d229f77314 [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 eq .Values.architecture "replicaset" }}
7apiVersion: v1
8kind: Service
9metadata:
10 name: {{ include "mongodb.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: mongodb
14 {{- if or .Values.commonAnnotations .Values.service.headless.annotations }}
15 {{- $annotations := include "common.tplvalues.merge" ( dict "values" ( list .Values.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 publishNotReadyAddresses: true
22 ports:
23 - name: {{ .Values.service.portName | quote }}
24 port: {{ .Values.service.ports.mongodb }}
25 targetPort: mongodb
26 {{- if .Values.service.extraPorts }}
27 {{- include "common.tplvalues.render" (dict "value" .Values.service.extraPorts "context" $) | nindent 4 }}
28 {{- end }}
29 {{- $podLabels := include "common.tplvalues.merge" ( dict "values" ( list .Values.podLabels .Values.commonLabels ) "context" . ) }}
30 selector: {{- include "common.labels.matchLabels" ( dict "customLabels" $podLabels "context" $ ) | nindent 4 }}
31 app.kubernetes.io/component: mongodb
32{{- end }}