diff --git a/charts/coredns/Chart.yaml b/charts/coredns/Chart.yaml index 8396a7893..44bbe1498 100644 --- a/charts/coredns/Chart.yaml +++ b/charts/coredns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: coredns -version: 1.45.2 +version: 1.45.3 appVersion: 1.13.1 home: https://coredns.io icon: https://coredns.io/images/CoreDNS_Colour_Horizontal.png @@ -20,4 +20,4 @@ type: application annotations: artifacthub.io/changes: | - kind: added - description: Add configurable dnsPolicy for deployment + description: Support for service labels diff --git a/charts/coredns/README.md b/charts/coredns/README.md index c7443747e..5d39600b8 100644 --- a/charts/coredns/README.md +++ b/charts/coredns/README.md @@ -134,6 +134,7 @@ The command removes all the Kubernetes components associated with the chart and | `service.externalTrafficPolicy` | Enable client source IP preservation | [] | | `service.ipFamilyPolicy` | Service dual-stack policy | `""` | | `service.annotations` | Annotations to add to service | {} | +| `service.labels` | Labels to add to service | {} | | `service.selector` | Pod selector | `{}` | | `service.trafficDistribution` | Service traffic routing strategy | | | `serviceAccount.create` | If true, create & use serviceAccount | false | diff --git a/charts/coredns/templates/_helpers.tpl b/charts/coredns/templates/_helpers.tpl index 2c2a9d61f..057f823a9 100644 --- a/charts/coredns/templates/_helpers.tpl +++ b/charts/coredns/templates/_helpers.tpl @@ -234,3 +234,13 @@ Create the name of the service account to use {{ template "coredns.fullname" . }} {{- end -}} {{- end -}} + +{{/* +Generate the service labels +*/}} +{{- define "coredns.service.labels" -}} +{{- $labels := merge (.Values.service.labels | default dict) (.Values.customLabels | default dict) }} +{{- with $labels }} +{{ toYaml . }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/coredns/templates/service.yaml b/charts/coredns/templates/service.yaml index 1247d09b8..366f42380 100644 --- a/charts/coredns/templates/service.yaml +++ b/charts/coredns/templates/service.yaml @@ -6,9 +6,7 @@ metadata: name: {{ default (include "coredns.fullname" .) .Values.service.name }} namespace: {{ .Release.Namespace }} labels: {{- include "coredns.labels" . | nindent 4 }} -{{- if .Values.customLabels }} -{{ toYaml .Values.customLabels | indent 4 }} -{{- end }} +{{- include "coredns.service.labels" . | indent 4 }} {{- if or .Values.service.annotations .Values.customAnnotations }} annotations: {{- if .Values.service.annotations }} diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index 5f49cb330..762627128 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -65,6 +65,7 @@ service: # If not set, a name is generated using the fullname template name: "" annotations: {} + labels: {} # Pod selector selector: {}