From 9ca7bb5a790c28f60206bf22cd185955563c6498 Mon Sep 17 00:00:00 2001 From: Angel Date: Mon, 6 Oct 2025 07:04:06 +0200 Subject: [PATCH] feat(helm): Add comprehensive configuration support for ImmuDB - Add environment variables configuration support - Add TOML configuration file support via ConfigMap - Add command line arguments support - Add S3 storage configuration capabilities - Add secure credential management via Kubernetes secrets - Bump chart version to 1.9.8 Resolves #2028 --- helm/Chart.yaml | 2 +- helm/templates/configmap.yaml | 11 ++++++ helm/templates/statefulset.yaml | 31 ++++++++++++++++- helm/values.yaml | 60 +++++++++++++++++++++++++++++++++ 4 files changed, 102 insertions(+), 2 deletions(-) create mode 100644 helm/templates/configmap.yaml diff --git a/helm/Chart.yaml b/helm/Chart.yaml index 1e841a17a4..36d166decf 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: immudb description: The immutable database type: application -version: 1.9.7 +version: 1.9.8 appVersion: "1.9.7" diff --git a/helm/templates/configmap.yaml b/helm/templates/configmap.yaml new file mode 100644 index 0000000000..527dac6743 --- /dev/null +++ b/helm/templates/configmap.yaml @@ -0,0 +1,11 @@ +{{- if .Values.config.enabled }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "immudb.fullname" . }}-config + labels: + {{- include "immudb.labels" . | nindent 4 }} +data: + immudb.toml: | +{{ .Values.config.data | indent 4 }} +{{- end }} \ No newline at end of file diff --git a/helm/templates/statefulset.yaml b/helm/templates/statefulset.yaml index 9e47a8a82d..4e359ec0e2 100644 --- a/helm/templates/statefulset.yaml +++ b/helm/templates/statefulset.yaml @@ -32,12 +32,27 @@ spec: - name: immudb-storage persistentVolumeClaim: claimName: {{ include "immudb.fullname" . }} + {{- if .Values.config.enabled }} + - name: immudb-config + configMap: + name: {{ include "immudb.fullname" . }}-config + {{- end }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if or .Values.args .Values.config.enabled }} + command: ["/usr/sbin/immudb"] + args: + {{- if .Values.config.enabled }} + - --config=/etc/immudb/immudb.toml + {{- end }} + {{- range .Values.args }} + - {{ . | quote }} + {{- end }} + {{- end }} ports: - name: http containerPort: 8080 @@ -57,14 +72,23 @@ spec: httpGet: path: /readyz port: metrics - {{- if $.Values.adminPassword }} env: + {{- if $.Values.adminPassword }} - name: IMMUDB_ADMIN_PASSWORD valueFrom: secretKeyRef: name: {{ include "immudb.fullname" . }}-credentials key: immudb-admin-password {{- end}} + {{- range .Values.env }} + - name: {{ .name }} + {{- if .value }} + value: {{ .value | quote }} + {{- else if .valueFrom }} + valueFrom: + {{- toYaml .valueFrom | nindent 14 }} + {{- end }} + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: @@ -73,6 +97,11 @@ spec: {{- if $.Values.volumeSubPath.enabled }} subPath: {{ $.Values.volumeSubPath.path | quote }} {{- end}} + {{- if .Values.config.enabled }} + - mountPath: /etc/immudb + name: immudb-config + readOnly: true + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/helm/values.yaml b/helm/values.yaml index 2f62b8ce53..13b5d45b23 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -18,6 +18,66 @@ volume: size: 5Gi adminPassword: "" +# ImmuDB Configuration Options +# You can configure immudb using three methods: +# 1. Environment variables (env) +# 2. Configuration file (config) +# 3. Command line arguments (args) + +# Environment variables for immudb +# All immudb configuration can be set via environment variables by prefixing with "IMMUDB_" +# Examples: +# - IMMUDB_PORT=3323 +# - IMMUDB_ADDRESS=0.0.0.0 +# - IMMUDB_DEVMODE=false +env: [] + # - name: IMMUDB_PORT + # value: "3323" + # - name: IMMUDB_DEVMODE + # value: "false" + # - name: IMMUDB_PGSQL_SERVER + # value: "true" + # - name: IMMUDB_S3_STORAGE + # value: "true" + # - name: IMMUDB_S3_BUCKET_NAME + # value: "my-immudb-bucket" + +# Configuration file for immudb +# If enabled, creates a ConfigMap with immudb.toml configuration file +# This will be mounted to /etc/immudb/immudb.toml +config: + enabled: false + # Configuration in TOML format + # See https://docs.immudb.io/master/running/configuration.html for all options + data: | + dir = "/var/lib/immudb" + network = "tcp" + address = "0.0.0.0" + port = 3322 + dbname = "immudb" + auth = true + devmode = false + pgsql-server = true + pgsql-server-port = 5432 + metrics-server = true + metrics-server-port = 9497 + web-server = true + web-server-port = 8080 + # S3 configuration example: + # s3-storage = true + # s3-bucket-name = "my-immudb-bucket" + # s3-endpoint = "s3.amazonaws.com" + # s3-location = "us-east-1" + +# Command line arguments for immudb +# These will be passed directly to the immudb command +# See `immudb --help` for all available options +args: [] + # - "--devmode" + # - "--pgsql-server=false" + # - "--s3-storage" + # - "--s3-bucket-name=my-immudb-bucket" + podAnnotations: {} podSecurityContext: