blob: 7bd5c806f48448c35264e4346988b939dce226d6 [file] [log] [blame]
Giorgi Lekveishviliec6b3cc2023-12-01 16:30:04 +04001{{- if .Values.deployment.enabled }}
2---
3apiVersion: v1
4kind: Service
5metadata:
6 name: {{ default (include "coredns.fullname" .) .Values.service.name }}
7 labels: {{- include "coredns.labels" . | nindent 4 }}
8{{- if .Values.customLabels }}
9{{ toYaml .Values.customLabels | indent 4 }}
10{{- end }}
11 {{- if or .Values.service.annotations .Values.customAnnotations }}
12 annotations:
13 {{- if .Values.service.annotations }}
14 {{- toYaml .Values.service.annotations | nindent 4 }}
15 {{- end }}
16 {{- if .Values.customAnnotations }}
17 {{- toYaml .Values.customAnnotations | nindent 4 }}
18 {{- end }}
19 {{- end }}
20spec:
21 selector:
22 app.kubernetes.io/instance: {{ .Release.Name | quote }}
23 {{- if .Values.isClusterService }}
24 k8s-app: {{ template "coredns.k8sapplabel" . }}
25 {{- end }}
26 app.kubernetes.io/name: {{ template "coredns.name" . }}
27 {{- if .Values.service.clusterIP }}
28 clusterIP: {{ .Values.service.clusterIP }}
29 {{- end }}
30 {{- if .Values.service.clusterIPs }}
31 clusterIPs:
32 {{ toYaml .Values.service.clusterIPs | nindent 4 }}
33 {{- end }}
34 {{- if .Values.service.externalIPs }}
35 externalIPs:
36 {{- toYaml .Values.service.externalIPs | nindent 4 }}
37 {{- end }}
38 {{- if .Values.service.externalTrafficPolicy }}
39 externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
40 {{- end }}
41 {{- if .Values.service.loadBalancerIP }}
42 loadBalancerIP: {{ .Values.service.loadBalancerIP }}
43 {{- end }}
44 ports:
45{{ include "coredns.servicePorts" . | indent 2 -}}
46 type: {{ default "ClusterIP" .Values.serviceType }}
47 {{- if .Values.service.ipFamilyPolicy }}
48 ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
49 {{- end }}
50{{- end }}