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: |
| 23 | app.kubernetes.io/instance: {{ .Release.Name | quote }} |
| 24 | {{- if .Values.isClusterService }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame^] | 25 | k8s-app: {{ template "coredns.k8sapplabel" . }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 26 | {{- end }} |
| 27 | app.kubernetes.io/name: {{ template "coredns.name" . }} |
| 28 | {{- if .Values.service.clusterIP }} |
| 29 | clusterIP: {{ .Values.service.clusterIP }} |
| 30 | {{- end }} |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame^] | 31 | {{- if .Values.service.clusterIPs }} |
| 32 | clusterIPs: |
| 33 | {{ toYaml .Values.service.clusterIPs | nindent 4 }} |
| 34 | {{- end }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 35 | {{- if .Values.service.externalIPs }} |
| 36 | externalIPs: |
Mohammed Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame^] | 37 | {{- toYaml .Values.service.externalIPs | nindent 4 }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 38 | {{- 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 Naser | 65cda13 | 2024-05-02 14:34:08 -0400 | [diff] [blame^] | 48 | {{- if .Values.service.ipFamilyPolicy }} |
| 49 | ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }} |
| 50 | {{- end }} |
Mohammed Naser | 9ad0d46 | 2023-01-15 20:36:37 -0500 | [diff] [blame] | 51 | {{- end }} |