Merge pull request #95 from lexfrei/feature/add-envfrom-support

This commit is contained in:
Cody Robibero authored and GitHub committed 2025-11-07 18:24:22 -07:00 Unverified
commit bc0948a43f
5 files changed
+155

No files matched your search

+3
View File
@@ -8,6 +8,7 @@ keywords:
- jellyfin
- media
- self-hosted
version: 2.6.0
version: 3.0.0
appVersion: 10.11.2
annotations:
@@ -16,6 +17,8 @@ annotations:
description: Deprecate initContainers parameter in favor of extraInitContainers for consistency (will be removed after 2030)
- kind: fixed
description: Fix extraInitContainers not working (was using wrong parameter name in template)
- kind: added
description: Add envFrom support to load environment variables from ConfigMap or Secret
- kind: added
description: Add NOTES.txt with helpful post-installation information and deprecation warnings
- kind: added
+13
View File
@@ -116,6 +116,19 @@ To access Jellyfin, you can use port-forwarding:
Then visit http://localhost:{{ .Values.service.port }} in your browser.
{{- end }}
{{- if .Values.jellyfin.envFrom }}
Environment Configuration:
Loading environment variables from {{ len .Values.jellyfin.envFrom }} source(s):
{{- range .Values.jellyfin.envFrom }}
{{- if .configMapRef }}
- ConfigMap: {{ .configMapRef.name }}{{ if .configMapRef.optional }} (optional){{ end }}{{ if .prefix }} with prefix: {{ .prefix }}{{ end }}
{{- else if .secretRef }}
- Secret: {{ .secretRef.name }}{{ if .secretRef.optional }} (optional){{ end }}{{ if .prefix }} with prefix: {{ .prefix }}{{ end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.startupProbe }}
{{- $startupTimeout := mul (default 10 .Values.startupProbe.periodSeconds) (default 30 .Values.startupProbe.failureThreshold) }}
@@ -62,6 +62,10 @@ spec:
args:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.jellyfin.envFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.jellyfin.env }}
env:
{{- toYaml . | nindent 12 }}
+122
View File
@@ -0,0 +1,122 @@
suite: test envFrom
templates:
- deployment.yaml
tests:
- it: should not have envFrom by default
asserts:
- isNull:
path: spec.template.spec.containers[0].envFrom
- it: should add envFrom from ConfigMap
set:
jellyfin.envFrom:
- configMapRef:
name: jellyfin-config
asserts:
- isNotNull:
path: spec.template.spec.containers[0].envFrom
- lengthEqual:
path: spec.template.spec.containers[0].envFrom
count: 1
- equal:
path: spec.template.spec.containers[0].envFrom[0].configMapRef.name
value: jellyfin-config
- it: should add envFrom from Secret
set:
jellyfin.envFrom:
- secretRef:
name: jellyfin-secrets
asserts:
- equal:
path: spec.template.spec.containers[0].envFrom[0].secretRef.name
value: jellyfin-secrets
- it: should support multiple envFrom sources
set:
jellyfin.envFrom:
- configMapRef:
name: jellyfin-config
- secretRef:
name: jellyfin-secrets
- configMapRef:
name: jellyfin-extra-config
asserts:
- lengthEqual:
path: spec.template.spec.containers[0].envFrom
count: 3
- equal:
path: spec.template.spec.containers[0].envFrom[0].configMapRef.name
value: jellyfin-config
- equal:
path: spec.template.spec.containers[0].envFrom[1].secretRef.name
value: jellyfin-secrets
- equal:
path: spec.template.spec.containers[0].envFrom[2].configMapRef.name
value: jellyfin-extra-config
- it: should support optional ConfigMap
set:
jellyfin.envFrom:
- configMapRef:
name: optional-config
optional: true
asserts:
- equal:
path: spec.template.spec.containers[0].envFrom[0].configMapRef.optional
value: true
- it: should support optional Secret
set:
jellyfin.envFrom:
- secretRef:
name: optional-secret
optional: true
asserts:
- equal:
path: spec.template.spec.containers[0].envFrom[0].secretRef.optional
value: true
- it: should support prefix for ConfigMap
set:
jellyfin.envFrom:
- configMapRef:
name: my-config
prefix: CONFIG_
asserts:
- equal:
path: spec.template.spec.containers[0].envFrom[0].prefix
value: CONFIG_
- it: should support prefix for Secret
set:
jellyfin.envFrom:
- secretRef:
name: my-secret
prefix: SECRET_
asserts:
- equal:
path: spec.template.spec.containers[0].envFrom[0].prefix
value: SECRET_
- it: should work alongside regular env variables
set:
jellyfin.env:
- name: CUSTOM_VAR
value: custom-value
jellyfin.envFrom:
- configMapRef:
name: jellyfin-config
asserts:
- isNotNull:
path: spec.template.spec.containers[0].env
- isNotNull:
path: spec.template.spec.containers[0].envFrom
- contains:
path: spec.template.spec.containers[0].env
content:
name: CUSTOM_VAR
value: custom-value
- equal:
path: spec.template.spec.containers[0].envFrom[0].configMapRef.name
value: jellyfin-config
+13
View File
@@ -224,7 +224,20 @@ jellyfin:
command: []
# -- Additional arguments for the entrypoint command.
args: []
# -- Load environment variables from ConfigMap or Secret.
# See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables
# Example:
# envFrom:
# - configMapRef:
# name: jellyfin-config
# - secretRef:
# name: jellyfin-secrets
envFrom: []
# -- Additional environment variables for the container.
# Example:
# env:
# - name: JELLYFIN_CACHE_DIR
# value: /cache
env: []
persistence: