From 10e4dc57b4207e9017deb2aeab9434a0c4719ef4 Mon Sep 17 00:00:00 2001 From: jmarchel Date: Mon, 15 Jan 2024 15:55:18 +0100 Subject: [PATCH] Add user to configuration Change-Id: I2608a50c095334f8e6e46502bba1f5995c0f7a2a --- .../templates/deployment.yaml | 20 +++++++++++++++++++ .../templates/influxdb-secrets.yaml | 10 ++++++++++ charts/nebulous-influxdb/values.yaml | 10 ++++++++++ 3 files changed, 40 insertions(+) create mode 100644 charts/nebulous-influxdb/templates/influxdb-secrets.yaml diff --git a/charts/nebulous-influxdb/templates/deployment.yaml b/charts/nebulous-influxdb/templates/deployment.yaml index a89af03..74df5b0 100644 --- a/charts/nebulous-influxdb/templates/deployment.yaml +++ b/charts/nebulous-influxdb/templates/deployment.yaml @@ -40,6 +40,26 @@ spec: env: - name: INFLUXDB_HTTP_AUTH_ENABLED value: "{{ .Values.config.httpAuthEnabled }}" + - name: DOCKER_INFLUXDB_INIT_MODE + value: "{{ .Values.influxdbSetup.DOCKER_INFLUXDB_INIT_MODE }}" + - name: DOCKER_INFLUXDB_INIT_USERNAME + value: "{{ .Values.influxdbSetup.DOCKER_INFLUXDB_INIT_USERNAME }}" + - name: DOCKER_INFLUXDB_INIT_ORG + value: "{{ .Values.influxdbSetup.DOCKER_INFLUXDB_INIT_ORG }}" + - name: DOCKER_INFLUXDB_INIT_BUCKET + value: "{{ .Values.influxdbSetup.DOCKER_INFLUXDB_INIT_BUCKET }}" + - name: DOCKER_INFLUXDB_INIT_RETENTION + value: "{{ .Values.influxdbSetup.DOCKER_INFLUXDB_INIT_RETENTION }}" + - name: DOCKER_INFLUXDB_INIT_PASSWORD + valueFrom: + secretKeyRef: + name: {{ include "nebulous-influxdb.fullname" . }}-secrets + key: DOCKER_INFLUXDB_INIT_PASSWORD + - name: DOCKER_INFLUXDB_INIT_ADMIN_TOKEN + valueFrom: + secretKeyRef: + name: {{ include "nebulous-influxdb.fullname" . }}-secrets + key: DOCKER_INFLUXDB_INIT_ADMIN_TOKEN livenessProbe: httpGet: path: /health diff --git a/charts/nebulous-influxdb/templates/influxdb-secrets.yaml b/charts/nebulous-influxdb/templates/influxdb-secrets.yaml new file mode 100644 index 0000000..091cb95 --- /dev/null +++ b/charts/nebulous-influxdb/templates/influxdb-secrets.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "nebulous-influxdb.fullname" . }}-secrets + labels: + {{- include "nebulous-influxdb.labels" . | nindent 4 }} +type: Opaque +data: + DOCKER_INFLUXDB_INIT_PASSWORD: {{ .Values.secrets.DOCKER_INFLUXDB_INIT_PASSWORD | b64enc | quote }} + DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: {{ .Values.secrets.DOCKER_INFLUXDB_INIT_ADMIN_TOKEN | b64enc | quote }} \ No newline at end of file diff --git a/charts/nebulous-influxdb/values.yaml b/charts/nebulous-influxdb/values.yaml index 3512256..f1093d6 100644 --- a/charts/nebulous-influxdb/values.yaml +++ b/charts/nebulous-influxdb/values.yaml @@ -89,3 +89,13 @@ nodeSelector: {} tolerations: [] affinity: {} +influxdbSetup: + DOCKER_INFLUXDB_INIT_MODE: "setup" + DOCKER_INFLUXDB_INIT_USERNAME: "my-user" + DOCKER_INFLUXDB_INIT_ORG: "my-org" + DOCKER_INFLUXDB_INIT_BUCKET: "my-bucket" + DOCKER_INFLUXDB_INIT_RETENTION: "1w" + +secrets: + DOCKER_INFLUXDB_INIT_PASSWORD: "my-password" + DOCKER_INFLUXDB_INIT_ADMIN_TOKEN: "my-super-secret-auth-token" \ No newline at end of file