Skip to content

PostgreSQL backup tool with Point-In-Time-Recovery and restore verification

FEATURE (helm): Add extraEnv and extraEnvFrom for arbitrary env injection

Stanislawcbde0c9f360c
diff --git a/deploy/helm/README.md b/deploy/helm/README.md
index 24c106cd..4fe882c1 100644
--- a/deploy/helm/README.md
+++ b/deploy/helm/README.md
@@ -56,6 +56,47 @@ customRootCA: my-root-ca
The certificate will be mounted to `/etc/ssl/certs/custom-root-ca.crt` and the `SSL_CERT_FILE` environment variable will be set automatically.
+### Extra Environment Variables
+
+| Parameter | Description | Default Value |
+| --------------- | --------------------------------------------------------------------------------- | ------------- |
+| `extraEnv` | Extra env vars on the container; standard Kubernetes EnvVar shape. | `[]` |
+| `extraEnvFrom` | Extra envFrom sources; standard Kubernetes EnvFromSource (secretRef/configMapRef).| `[]` |
+
+Use `extraEnv` for arbitrary container env injection — for example, disabling anonymous telemetry in air-gapped or compliance-restricted clusters:
+
+```yaml
+extraEnv:
+ - name: IS_DISABLE_ANONYMOUS_TELEMETRY
+ value: "true"
+```
+
+Or pull a secret value into the container:
+
+```yaml
+extraEnv:
+ - name: SOME_TOKEN
+ valueFrom:
+ secretKeyRef:
+ name: databasus-extras
+ key: token
+```
+
+Use `extraEnvFrom` to mount entire Secrets/ConfigMaps as env (handy with External Secrets Operator or the secrets-store-csi-driver):
+
+```yaml
+extraEnvFrom:
+ - secretRef:
+ name: databasus-extras
+ - configMapRef:
+ name: databasus-extras-cm
+```
+
+Notes:
+
+- Env values must be strings. Use quoted `"true"` / `"false"` rather than bare booleans, and pass `--set-string` on the CLI (e.g. `--set-string 'extraEnv[0].value=true'`) to avoid Kubernetes rejecting non-string values.
+- `extraEnv` is appended after `SSL_CERT_FILE` (when `customRootCA` is set), so an entry with the same name will override `SSL_CERT_FILE`. Avoid duplicate `name` entries unless that override is intentional.
+
### Service
| Parameter | Description | Default Value |
diff --git a/deploy/helm/templates/statefulset.yaml b/deploy/helm/templates/statefulset.yaml
index 7e73a0c3..594405d4 100644
--- a/deploy/helm/templates/statefulset.yaml
+++ b/deploy/helm/templates/statefulset.yaml
@@ -43,10 +43,19 @@ spec:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
- {{- if .Values.customRootCA }}
+ {{- if or .Values.customRootCA .Values.extraEnv }}
env:
+ {{- if .Values.customRootCA }}
- name: SSL_CERT_FILE
value: /etc/ssl/certs/custom-root-ca.crt
+ {{- end }}
+ {{- with .Values.extraEnv }}
+ {{- toYaml . | nindent 12 }}
+ {{- end }}
+ {{- end }}
+ {{- with .Values.extraEnvFrom }}
+ envFrom:
+ {{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
diff --git a/deploy/helm/values.yaml b/deploy/helm/values.yaml
index a0ae702e..8a4bf38b 100644
--- a/deploy/helm/values.yaml
+++ b/deploy/helm/values.yaml
@@ -14,6 +14,28 @@ replicaCount: 1
# RootCA setup, need name of secret in same namespace
customRootCA: ""
+# Extra environment variables to inject into the databasus container.
+# Accepts the standard Kubernetes EnvVar shape (value or valueFrom).
+# Note: env values must be strings — use quoted "true"/"false" rather than bare
+# booleans, and pass `--set-string` on the CLI to avoid Kubernetes rejecting
+# non-string values.
+extraEnv: []
+# - name: IS_DISABLE_ANONYMOUS_TELEMETRY
+# value: "true"
+# - name: SOME_TOKEN
+# valueFrom:
+# secretKeyRef:
+# name: databasus-extras
+# key: token
+
+# Extra envFrom sources mounted into the databasus container.
+# Accepts the standard Kubernetes EnvFromSource shape.
+extraEnvFrom: []
+# - secretRef:
+# name: databasus-extras
+# - configMapRef:
+# name: databasus-extras-cm
+
# Service configuration
service:
type: ClusterIP