blob: 94d6055bf28c08dee7a14e8928c806f41a48c270 [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 }}
7 labels:
8 app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
9 app.kubernetes.io/instance: {{ .Release.Name | quote }}
10 helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
11 {{- if .Values.isClusterService }}
12 k8s-app: {{ .Chart.Name | quote }}
13 kubernetes.io/cluster-service: "true"
14 kubernetes.io/name: "CoreDNS"
15 {{- end }}
16 app.kubernetes.io/name: {{ template "coredns.name" . }}
17{{- if .Values.customLabels }}
18{{ toYaml .Values.customLabels | indent 4 }}
19{{- end }}
20 {{- if or .Values.service.annotations .Values.customAnnotations }}
21 annotations:
22 {{- if .Values.service.annotations }}
23 {{- toYaml .Values.service.annotations | nindent 4 }}
24 {{- end }}
25 {{- if .Values.customAnnotations }}
26 {{- toYaml .Values.customAnnotations | nindent 4 }}
27 {{- end }}
28 {{- end }}
29spec:
30 selector:
31 app.kubernetes.io/instance: {{ .Release.Name | quote }}
32 {{- if .Values.isClusterService }}
33 k8s-app: {{ .Chart.Name | quote }}
34 {{- end }}
35 app.kubernetes.io/name: {{ template "coredns.name" . }}
36 {{- if .Values.service.clusterIP }}
37 clusterIP: {{ .Values.service.clusterIP }}
38 {{- end }}
39 {{- if .Values.service.externalIPs }}
40 externalIPs:
41 {{ toYaml .Values.service.externalIPs | indent 4 }}
42 {{- end }}
43 {{- if .Values.service.externalTrafficPolicy }}
44 externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}
45 {{- end }}
46 {{- if .Values.service.loadBalancerIP }}
47 loadBalancerIP: {{ .Values.service.loadBalancerIP }}
48 {{- end }}
49 ports:
50{{ include "coredns.servicePorts" . | indent 2 -}}
51 type: {{ default "ClusterIP" .Values.serviceType }}
52{{- end }}