Merge pull request #95 from lexfrei/feature/add-envfrom-support
This commit is contained in:
5 files changed
+155
No files matched your search
@@ -8,6 +8,7 @@ keywords:
|
|||||||
- jellyfin
|
- jellyfin
|
||||||
- media
|
- media
|
||||||
- self-hosted
|
- self-hosted
|
||||||
|
version: 2.6.0
|
||||||
version: 3.0.0
|
version: 3.0.0
|
||||||
appVersion: 10.11.2
|
appVersion: 10.11.2
|
||||||
annotations:
|
annotations:
|
||||||
@@ -16,6 +17,8 @@ annotations:
|
|||||||
description: Deprecate initContainers parameter in favor of extraInitContainers for consistency (will be removed after 2030)
|
description: Deprecate initContainers parameter in favor of extraInitContainers for consistency (will be removed after 2030)
|
||||||
- kind: fixed
|
- kind: fixed
|
||||||
description: Fix extraInitContainers not working (was using wrong parameter name in template)
|
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
|
- kind: added
|
||||||
description: Add NOTES.txt with helpful post-installation information and deprecation warnings
|
description: Add NOTES.txt with helpful post-installation information and deprecation warnings
|
||||||
- kind: added
|
- kind: added
|
||||||
|
|||||||
@@ -116,6 +116,19 @@ To access Jellyfin, you can use port-forwarding:
|
|||||||
Then visit http://localhost:{{ .Values.service.port }} in your browser.
|
Then visit http://localhost:{{ .Values.service.port }} in your browser.
|
||||||
{{- end }}
|
{{- 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 }}
|
{{- if .Values.startupProbe }}
|
||||||
{{- $startupTimeout := mul (default 10 .Values.startupProbe.periodSeconds) (default 30 .Values.startupProbe.failureThreshold) }}
|
{{- $startupTimeout := mul (default 10 .Values.startupProbe.periodSeconds) (default 30 .Values.startupProbe.failureThreshold) }}
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,10 @@ spec:
|
|||||||
args:
|
args:
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.jellyfin.envFrom }}
|
||||||
|
envFrom:
|
||||||
|
{{- toYaml . | nindent 12 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.jellyfin.env }}
|
{{- with .Values.jellyfin.env }}
|
||||||
env:
|
env:
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- toYaml . | nindent 12 }}
|
||||||
|
|||||||
@@ -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
|
||||||
@@ -224,7 +224,20 @@ jellyfin:
|
|||||||
command: []
|
command: []
|
||||||
# -- Additional arguments for the entrypoint command.
|
# -- Additional arguments for the entrypoint command.
|
||||||
args: []
|
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.
|
# -- Additional environment variables for the container.
|
||||||
|
# Example:
|
||||||
|
# env:
|
||||||
|
# - name: JELLYFIN_CACHE_DIR
|
||||||
|
# value: /cache
|
||||||
env: []
|
env: []
|
||||||
|
|
||||||
persistence:
|
persistence:
|
||||||
|
|||||||
Reference in new issue
Block a user