allow using custom init scripts (#11728)

Signed-off-by: Rafael Matias <rafael@skyle.net>
This commit is contained in:
Rafael Matias
2019-04-22 09:11:44 -07:00
committed by Kubernetes Prow Robot
parent d00bdb5baa
commit 393de1b729
4 changed files with 34 additions and 1 deletions
+1 -1
View File
@@ -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:
@@ -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 }}
@@ -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 -}}
+11
View File
@@ -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"