[stable/coredns] #1785 namespace defined templates with chart name (#1986)

This commit is contained in:
kevinschumacher
2017-09-10 11:49:26 -05:00
committed by Michael Goodness
parent 9cdd7bddc3
commit 4e2416ec56
6 changed files with 18 additions and 17 deletions
+3 -2
View File
@@ -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
+4 -4
View File
@@ -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 }}
+2 -2
View File
@@ -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 -}}
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "fullname" . }}
name: {{ template "coredns.fullname" . }}
data:
Corefile: |-
.:53 {
+5 -5
View File
@@ -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
+3 -3
View File
@@ -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 }}