Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/691 Add Bucket and Task Creation Support to Helm Chart #692

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions charts/influxdb2/templates/create-buckets-and-task-job.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{{- if .Values.createBucketsAndTask.enabled }}
apiVersion: batch/v1
kind: Job
metadata:
name: {{ .Release.Name }}-create-buckets-and-task
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
template:
spec:
containers:
- name: create-buckets-and-task
image: quay.io/influxdb/influxdb:2.7.4
command: ["/bin/sh", "-c"]
args:
- |
# Create buckets
{{- range .Values.createBucketsAndTask.buckets }}
influx bucket create --name "{{ .name }}" --retention "{{ .retentionPolicy }}" --org {{ $.Values.adminUser.organization }}
{{- end }}
# Create task
influx task create --name {{ .Values.createBucketsAndTask.task.name }} --org {{ .Values.adminUser.organization }} --file /etc/influxdb/task.flux
env:
- name: INFLUX_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Release.Name }}-auth
key: admin-token
- name: INFLUX_ORG
value: {{ .Values.adminUser.organization }}
volumeMounts:
- name: task-config
mountPath: /etc/influxdb
restartPolicy: OnFailure
volumes:
- name: task-config
configMap:
name: {{ .Release.Name }}-task-config
{{- end }}
12 changes: 12 additions & 0 deletions charts/influxdb2/templates/task-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.createBucketsAndTask.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-task-config
labels:
app.kubernetes.io/name: {{ .Chart.Name }}
app.kubernetes.io/instance: {{ .Release.Name }}
data:
task.flux: |+
{{ .Values.createBucketsAndTask.task.script | nindent 4 }}
{{- end }}
Loading