[stable/coredns] use .name in app label, not fullname (#6093)

* coredns: use .name in app label, not fullname

Follow conventions in other charts, where the deployment name is not part of app label. Result: `app: coredns`, not `app: mydeploy-coredns`

Signed-off-by: Min RK <benjaminrk@gmail.com>

* coredns: bump chart version

Signed-off-by: Min RK <benjaminrk@gmail.com>

* coredns: apply labels consistently

Signed-off-by: Min RK <benjaminrk@gmail.com>

* coredns: always define app label

not just when it's not a cluster service

Signed-off-by: Min RK <benjaminrk@gmail.com>
This commit is contained in:
Min RK
2018-09-14 04:25:48 -07:00
committed by k8s-ci-robot
parent 625969a6f9
commit 6aac85d50e
5 changed files with 23 additions and 19 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
name: coredns
version: 1.0.0
version: 1.0.1
appVersion: 1.2.0
description: CoreDNS is a DNS server that chains plugins and provides Kubernetes DNS Services
keywords:
+10
View File
@@ -2,6 +2,16 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "coredns.fullname" . }}
labels:
heritage: {{ .Release.Service | quote }}
release: {{ .Release.Name | quote }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
{{- if .Values.isClusterService }}
k8s-app: {{ .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- end }}
app: {{ template "coredns.name" . }}
data:
Corefile: |-
{{ range .Values.servers }}
+4 -6
View File
@@ -10,26 +10,24 @@ metadata:
k8s-app: {{ .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
app: {{ template "coredns.name" . }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
release: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
k8s-app: {{ .Chart.Name | quote }}
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
app: {{ template "coredns.name" . }}
template:
metadata:
labels:
{{- if .Values.isClusterService }}
k8s-app: {{ .Chart.Name | quote }}
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
app: {{ template "coredns.fullname" . }}
release: {{ .Release.Name | quote }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
+3 -6
View File
@@ -11,9 +11,8 @@ metadata:
k8s-app: {{ .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
app: {{ template "coredns.name" . }}
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
@@ -27,9 +26,8 @@ metadata:
k8s-app: {{ .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
app: {{ template "coredns.name" . }}
rules:
- apiGroups:
- ""
@@ -54,9 +52,8 @@ metadata:
k8s-app: {{ .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
app: {{ template "coredns.name" . }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
+5 -6
View File
@@ -10,18 +10,17 @@ metadata:
k8s-app: {{ .Chart.Name | quote }}
kubernetes.io/cluster-service: "true"
kubernetes.io/name: "CoreDNS"
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
app: {{ template "coredns.name" . }}
annotations:
{{ toYaml .Values.service.annotations | indent 4 }}
spec:
selector:
{{- if .Values.isClusterService }}
release: {{ .Release.Name | quote }}
{{- if .Values.isClusterService }}
k8s-app: {{ .Chart.Name | quote }}
{{- else }}
app: {{ template "coredns.fullname" . }}
{{- end }}
{{- end }}
app: {{ template "coredns.name" . }}
{{- if .Values.service.clusterIP }}
clusterIP: {{ .Values.service.clusterIP }}
{{- end }}