blob: e9c5b967514e4b77734882972710aed4a241555b [file] [log] [blame]
Mohammed Naser9ad0d462023-01-15 20:36:37 -05001{{- if .Values.deployment.enabled }}
2---
3apiVersion: v1
4kind: Service
5metadata:
6 name: {{ default (include "coredns.fullname" .) .Values.service.name }}
Mohammed Naser65cda132024-05-02 14:34:08 -04007 namespace: {{ .Release.Namespace }}
8 labels: {{- include "coredns.labels" . | nindent 4 }}
Mohammed Naser9ad0d462023-01-15 20:36:37 -05009{{- if .Values.customLabels }}
10{{ toYaml .Values.customLabels | indent 4 }}
11{{- end }}
12 {{- if or .Values.service.annotations .Values.customAnnotations }}
13 annotations:
14 {{- if .Values.service.annotations }}
15 {{- toYaml .Values.service.annotations | nindent 4 }}
16 {{- end }}
17 {{- if .Values.customAnnotations }}
18 {{- toYaml .Values.customAnnotations | nindent 4 }}
19 {{- end }}
20 {{- end }}
21spec:
22 selector:
23 app.kubernetes.io/instance: {{ .Release.Name | quote }}
24 {{- if .Values.isClusterService }}
Mohammed Naser65cda132024-05-02 14:34:08 -040025 k8s-app: {{ template "coredns.k8sapplabel" . }}
Mohammed Naser9ad0d462023-01-15 20:36:37 -050026 {{- end }}
27 app.kubernetes.io/name: {{ template "coredns.name" . }}
28 {{- if .Values.service.clusterIP }}
29 clusterIP: {{ .Values.service.clusterIP }}
30 {{- end }}
Mohammed Naser65cda132024-05-02 14:34:08 -040031 {{- if .Values.service.clusterIPs }}
32 clusterIPs:
33 {{ toYaml .Values.service.clusterIPs | nindent 4 }}
34 {{- end }}
Mohammed Naser9ad0d462023-01-15 20:36:37 -050035 {{- if .Values.service.externalIPs }}
36 externalIPs:
Mohammed Naser65cda132024-05-02 14:34:08 -040037 {{- toYaml .Values.service.externalIPs | nindent 4 }}
Mohammed Naser9ad0d462023-01-15 20:36:37 -050038 {{- end }}
39 {{- if .Values.service.externalTrafficPolicy }}
40 externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
41 {{- end }}
42 {{- if .Values.service.loadBalancerIP }}
43 loadBalancerIP: {{ .Values.service.loadBalancerIP }}
44 {{- end }}
45 ports:
46{{ include "coredns.servicePorts" . | indent 2 -}}
47 type: {{ default "ClusterIP" .Values.serviceType }}
Mohammed Naser65cda132024-05-02 14:34:08 -040048 {{- if .Values.service.ipFamilyPolicy }}
49 ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
50 {{- end }}
Mohammed Naser9ad0d462023-01-15 20:36:37 -050051{{- end }}