From 07aaa131e51686de379e9bcb353e829b9acd0310 Mon Sep 17 00:00:00 2001 From: Amanda Cameron Date: Fri, 27 Jan 2017 20:46:48 -0500 Subject: [PATCH] [stable/kapacitor] Update to the recommended pvc patterns. (#450) * Convert chart kapacitor to use the recommended pvc patterns * Update pvc.yaml * Update Chart.yaml * Update _helpers.tpl --- stable/kapacitor/Chart.yaml | 4 ++-- stable/kapacitor/templates/_helpers.tpl | 6 +++--- stable/kapacitor/templates/pvc.yaml | 6 +++++- stable/kapacitor/values.yaml | 5 ++++- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/stable/kapacitor/Chart.yaml b/stable/kapacitor/Chart.yaml index 503df12f51..b39111d201 100755 --- a/stable/kapacitor/Chart.yaml +++ b/stable/kapacitor/Chart.yaml @@ -1,5 +1,5 @@ name: kapacitor -version: 0.1.0 +version: 0.1.1 description: Chart for Chronograf keywords: - kapacitor @@ -10,4 +10,4 @@ home: https://www.influxdata.com/time-series-platform/kapacitor/ maintainers: - name: Jack Zampolin email: jack@influxdb.com -engine: gotpl \ No newline at end of file +engine: gotpl diff --git a/stable/kapacitor/templates/_helpers.tpl b/stable/kapacitor/templates/_helpers.tpl index 234480de71..f0d83d2edb 100644 --- a/stable/kapacitor/templates/_helpers.tpl +++ b/stable/kapacitor/templates/_helpers.tpl @@ -3,14 +3,14 @@ Expand the name of the chart. */}} {{- define "name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 24 -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- end -}} {{/* Create a default fully qualified app name. -We truncate at 24 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). */}} {{- define "fullname" -}} {{- $name := default .Chart.Name .Values.nameOverride -}} -{{- printf "%s-%s" .Release.Name $name | trunc 24 -}} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} diff --git a/stable/kapacitor/templates/pvc.yaml b/stable/kapacitor/templates/pvc.yaml index a50862753d..2f595c85cd 100644 --- a/stable/kapacitor/templates/pvc.yaml +++ b/stable/kapacitor/templates/pvc.yaml @@ -9,7 +9,11 @@ metadata: app: {{ template "fullname" . }} name: {{ template "fullname" . }} annotations: - volume.alpha.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- if .Values.persistence.storageClass }} + volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }} + {{- else }} + volume.alpha.kubernetes.io/storage-class: default + {{- end }} spec: accessModes: - {{ .Values.persistence.accessMode | quote }} diff --git a/stable/kapacitor/values.yaml b/stable/kapacitor/values.yaml index 517ab92b15..15a356048e 100644 --- a/stable/kapacitor/values.yaml +++ b/stable/kapacitor/values.yaml @@ -17,7 +17,10 @@ service: ## persistence: enabled: false - storageClass: generic + ## If defined, volume.beta.kubernetes.io/storage-class: + ## Default: volume.alpha.kubernetes.io/storage-class: default + ## + # storageClass: accessMode: ReadWriteOnce size: 8Gi