diff --git a/stable/influxdb/Chart.yaml b/stable/influxdb/Chart.yaml index 0e86a17a95..fda2b71295 100755 --- a/stable/influxdb/Chart.yaml +++ b/stable/influxdb/Chart.yaml @@ -1,5 +1,5 @@ name: influxdb -version: 1.1.3 +version: 1.1.4 appVersion: 1.7.3 description: Scalable datastore for metrics, events, and real-time analytics. keywords: diff --git a/stable/influxdb/templates/deployment.yaml b/stable/influxdb/templates/deployment.yaml index 50f62306e7..2d4ea7e256 100644 --- a/stable/influxdb/templates/deployment.yaml +++ b/stable/influxdb/templates/deployment.yaml @@ -65,6 +65,10 @@ spec: mountPath: {{ .Values.config.storage_directory }} - name: config mountPath: /etc/influxdb + {{- if .Values.initScripts.enabled }} + - name: init + mountPath: /docker-entrypoint-initdb.d + {{- end }} volumes: - name: data {{- if .Values.persistence.enabled }} @@ -81,6 +85,11 @@ spec: - name: config configMap: name: {{ template "influxdb.fullname" . }} + {{- if .Values.initScripts.enabled }} + - name: init + configMap: + name: {{ template "influxdb.fullname" . }}-init + {{- end }} {{- if .Values.schedulerName }} schedulerName: "{{ .Values.schedulerName }}" {{- end }} diff --git a/stable/influxdb/templates/init-config.yaml b/stable/influxdb/templates/init-config.yaml new file mode 100644 index 0000000000..8f611fb11d --- /dev/null +++ b/stable/influxdb/templates/init-config.yaml @@ -0,0 +1,13 @@ +{{- if .Values.initScripts.enabled -}} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "influxdb.fullname" . }}-init + labels: + app: {{ template "influxdb.fullname" . }} + chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + release: "{{ .Release.Name }}" + heritage: "{{ .Release.Service }}" +data: +{{ toYaml .Values.initScripts.scripts | indent 2 }} +{{- end -}} diff --git a/stable/influxdb/values.yaml b/stable/influxdb/values.yaml index 82d169ff39..245191fb12 100644 --- a/stable/influxdb/values.yaml +++ b/stable/influxdb/values.yaml @@ -251,3 +251,14 @@ config: format: auto level: info supress_logo: false + +# Allow executing custom init scripts +# +# If the container finds any files with the extensions .sh or .iql inside of the +# /docker-entrypoint-initdb.d folder, it will execute them. The order they are +# executed in is determined by the shell. This is usually alphabetical order. +initScripts: + enabled: false + scripts: + init.iql: |+ + CREATE DATABASE "telegraf" WITH DURATION 30d REPLICATION 1 NAME "rp_30d"