From 4e2416ec56e4fe653aa17814b2d0c3df12a953a9 Mon Sep 17 00:00:00 2001 From: kevinschumacher Date: Sun, 10 Sep 2017 12:49:26 -0400 Subject: [PATCH] [stable/coredns] #1785 namespace defined templates with chart name (#1986) --- stable/coredns/Chart.yaml | 5 +++-- stable/coredns/templates/NOTES.txt | 8 ++++---- stable/coredns/templates/_helpers.tpl | 4 ++-- stable/coredns/templates/configmap.yaml | 2 +- stable/coredns/templates/deployment.yaml | 10 +++++----- stable/coredns/templates/service.yaml | 6 +++--- 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/stable/coredns/Chart.yaml b/stable/coredns/Chart.yaml index 26e74c420e..5c2dd2e304 100644 --- a/stable/coredns/Chart.yaml +++ b/stable/coredns/Chart.yaml @@ -1,6 +1,7 @@ name: coredns -version: 0.4.0 -description: CoreDNS is a DNS server that chains middleware and provides Kubernetes DNS Services +version: 0.5.0 +description: CoreDNS is a DNS server that chains middleware and provides Kubernetes + DNS Services keywords: - coredns - dns diff --git a/stable/coredns/templates/NOTES.txt b/stable/coredns/templates/NOTES.txt index 07fde9d8da..7343972f87 100644 --- a/stable/coredns/templates/NOTES.txt +++ b/stable/coredns/templates/NOTES.txt @@ -4,22 +4,22 @@ CoreDNS is now running in the cluster as a cluster-service. CoreDNS is now running in the cluster. It can be accessed using the below endpoint {{- if contains "NodePort" .Values.serviceType }} - export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "fullname" . }}) + export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "coredns.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo "$NODE_IP:$NODE_PORT" {{- else if contains "LoadBalancer" .Values.serviceType }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. - You can watch the status by running 'kubectl get svc -w {{ template "fullname" . }}' + You can watch the status by running 'kubectl get svc -w {{ template "coredns.fullname" . }}' {{- if contains "UDPNTCP" .Values.serviceProtocol }} NOTE: Some cloud environments cannot create external loadbalancers with both "TCP" and "UDP" protocols. So in case of error, use either "UDP" or "TCP" protocol by setting `serviceProtocol` parameter. {{- end }} - export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') + export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "coredns.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}') echo $SERVICE_IP {{- else if contains "ClusterIP" .Values.serviceType }} - "{{ template "fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local" + "{{ template "coredns.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local" from within the cluster {{- end }} {{- end }} diff --git a/stable/coredns/templates/_helpers.tpl b/stable/coredns/templates/_helpers.tpl index f0d83d2edb..b95b731cdc 100644 --- a/stable/coredns/templates/_helpers.tpl +++ b/stable/coredns/templates/_helpers.tpl @@ -2,7 +2,7 @@ {{/* Expand the name of the chart. */}} -{{- define "name" -}} +{{- define "coredns.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} @@ -10,7 +10,7 @@ Expand the name of the chart. Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} -{{- define "fullname" -}} +{{- define "coredns.fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/stable/coredns/templates/configmap.yaml b/stable/coredns/templates/configmap.yaml index a0cc63400a..3cbf9aee0a 100644 --- a/stable/coredns/templates/configmap.yaml +++ b/stable/coredns/templates/configmap.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ template "fullname" . }} + name: {{ template "coredns.fullname" . }} data: Corefile: |- .:53 { diff --git a/stable/coredns/templates/deployment.yaml b/stable/coredns/templates/deployment.yaml index ea90fee872..61154a67e3 100644 --- a/stable/coredns/templates/deployment.yaml +++ b/stable/coredns/templates/deployment.yaml @@ -1,7 +1,7 @@ apiVersion: extensions/v1beta1 kind: Deployment metadata: - name: {{ template "fullname" . }} + name: {{ template "coredns.fullname" . }} labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -11,7 +11,7 @@ metadata: kubernetes.io/cluster-service: "true" kubernetes.io/name: "CoreDNS" {{- else }} - app: {{ template "fullname" . }} + app: {{ template "coredns.fullname" . }} {{- end }} spec: replicas: {{ .Values.replicaCount }} @@ -20,7 +20,7 @@ spec: {{- if .Values.isClusterService }} k8s-app: {{ .Chart.Name | quote }} {{- else }} - app: {{ template "fullname" . }} + app: {{ template "coredns.fullname" . }} {{- end }} template: metadata: @@ -28,7 +28,7 @@ spec: {{- if .Values.isClusterService }} k8s-app: {{ .Chart.Name | quote }} {{- else }} - app: {{ template "fullname" . }} + app: {{ template "coredns.fullname" . }} {{- end }} release: {{ .Release.Name | quote }} annotations: @@ -78,7 +78,7 @@ spec: volumes: - name: config-volume configMap: - name: {{ template "fullname" . }} + name: {{ template "coredns.fullname" . }} items: - key: Corefile path: Corefile diff --git a/stable/coredns/templates/service.yaml b/stable/coredns/templates/service.yaml index 6e107e3095..e33f57145d 100644 --- a/stable/coredns/templates/service.yaml +++ b/stable/coredns/templates/service.yaml @@ -1,7 +1,7 @@ apiVersion: v1 kind: Service metadata: - name: {{ template "fullname" . }} + name: {{ template "coredns.fullname" . }} labels: heritage: {{ .Release.Service | quote }} release: {{ .Release.Name | quote }} @@ -11,7 +11,7 @@ metadata: kubernetes.io/cluster-service: "true" kubernetes.io/name: "CoreDNS" {{- else }} - app: {{ template "fullname" . }} + app: {{ template "coredns.fullname" . }} {{- end }} annotations: {{- if .Values.middleware.prometheus.enabled }} @@ -23,7 +23,7 @@ spec: {{- if .Values.isClusterService }} k8s-app: {{ .Chart.Name | quote }} {{- else }} - app: {{ template "fullname" . }} + app: {{ template "coredns.fullname" . }} {{- end }} {{- if .Values.isClusterService }} clusterIP: {{ .Values.middleware.kubernetes.clusterIP }}