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 }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 7 | namespace: {{ .Release.Namespace }} |
| 8 | labels: {{- include "coredns.labels" . | nindent 4 }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 9 | {{- 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 }} |
| 21 | spec: |
| 22 | selector: |
Mohammed Naser | 7d1623e | 2024-06-17 09:12:39 -0400 | [diff] [blame] | 23 | {{- if .Values.service.selector }} |
| 24 | {{- toYaml .Values.service.selector | nindent 4 }} |
| 25 | {{- else }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 26 | app.kubernetes.io/instance: {{ .Release.Name | quote }} |
| 27 | {{- if .Values.isClusterService }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 28 | k8s-app: {{ template "coredns.k8sapplabel" . }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 29 | {{- end }} |
| 30 | app.kubernetes.io/name: {{ template "coredns.name" . }} |
Mohammed Naser | 7d1623e | 2024-06-17 09:12:39 -0400 | [diff] [blame] | 31 | {{- end }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 32 | {{- if .Values.service.clusterIP }} |
| 33 | clusterIP: {{ .Values.service.clusterIP }} |
| 34 | {{- end }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 35 | {{- if .Values.service.clusterIPs }} |
| 36 | clusterIPs: |
| 37 | {{ toYaml .Values.service.clusterIPs | nindent 4 }} |
| 38 | {{- end }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 39 | {{- if .Values.service.externalIPs }} |
| 40 | externalIPs: |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 41 | {{- toYaml .Values.service.externalIPs | nindent 4 }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 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 }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame] | 52 | {{- if .Values.service.ipFamilyPolicy }} |
| 53 | ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} |
| 54 | {{- end }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 55 | {{- end }} |