add headless service for statefulset (#17747)

Signed-off-by: afirth <afirth@users.noreply.github.com>
This commit is contained in:
Alastair Firth
2019-10-07 19:29:11 -07:00
committed by Kubernetes Prow Robot
parent 8f5ba028dd
commit d79753641e
3 changed files with 25 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: grafana
version: 3.8.18
version: 3.8.19
appVersion: 6.3.5
kubeVersion: "^1.8.0-0"
description: The leading tool for querying and visualizing time series and metrics.
@@ -0,0 +1,22 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) (eq .Values.persistence.type "statefulset")}}
apiVersion: v1
kind: Service
metadata:
name: {{ template "grafana.fullname" . }}-headless
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "grafana.name" . }}
chart: {{ template "grafana.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
clusterIP: None
selector:
app: {{ template "grafana.name" . }}
release: {{ .Release.Name }}
type: ClusterIP
{{- end }}
+2 -1
View File
@@ -19,6 +19,7 @@ spec:
matchLabels:
app: {{ template "grafana.name" . }}
release: {{ .Release.Name }}
serviceName: {{ template "grafana.fullname" . }}-headless
template:
metadata:
labels:
@@ -45,4 +46,4 @@ spec:
resources:
requests:
storage: {{ .Values.persistence.size }}
{{- end }}
{{- end }}