Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame^] | 1 | {{- if .Values.deployment.enabled }} |
| 2 | --- |
| 3 | apiVersion: v1 |
| 4 | kind: Service |
| 5 | metadata: |
| 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 }} |
| 29 | spec: |
| 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 }} |