Merge pull request #86 from lexfrei/feature/add-httproute-support
This commit is contained in:
7 files changed
+337
No files matched your search
@@ -17,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 support for Gateway API HTTPRoute resource
|
||||||
- kind: added
|
- kind: added
|
||||||
description: Add envFrom support to load environment variables from ConfigMap or Secret
|
description: Add envFrom support to load environment variables from ConfigMap or Secret
|
||||||
- kind: added
|
- kind: added
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
# jellyfin
|
# jellyfin
|
||||||
|
|
||||||
|
  
|
||||||
  
|
  
|
||||||
|
|
||||||
A Helm chart for Jellyfin Media Server
|
A Helm chart for Jellyfin Media Server
|
||||||
@@ -60,6 +61,10 @@ helm install my-jellyfin jellyfin/jellyfin -f values.yaml
|
|||||||
| extraContainers | list | `[]` | additional sidecar containers to run inside the pod. |
|
| extraContainers | list | `[]` | additional sidecar containers to run inside the pod. |
|
||||||
| extraInitContainers | list | `[]` | additional init containers to run inside the pod. |
|
| extraInitContainers | list | `[]` | additional init containers to run inside the pod. |
|
||||||
| fullnameOverride | string | `""` | Override the default full name of the chart. |
|
| fullnameOverride | string | `""` | Override the default full name of the chart. |
|
||||||
|
| httpRoute | object | `{"annotations":{},"enabled":false,"hostnames":[],"parentRefs":[],"rules":[{"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}]}` | HTTPRoute configuration for Gateway API. See: https://gateway-api.sigs.k8s.io/ |
|
||||||
|
| httpRoute.hostnames | list | `[]` | Hostnames to match for this HTTPRoute |
|
||||||
|
| httpRoute.parentRefs | list | `[]` | Gateway references to attach this HTTPRoute to |
|
||||||
|
| httpRoute.rules | list | `[{"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}]` | Rules for routing traffic |
|
||||||
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy (Always, IfNotPresent, or Never). |
|
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy (Always, IfNotPresent, or Never). |
|
||||||
| image.repository | string | `"docker.io/jellyfin/jellyfin"` | Container image repository for Jellyfin. |
|
| image.repository | string | `"docker.io/jellyfin/jellyfin"` | Container image repository for Jellyfin. |
|
||||||
| image.tag | string | `""` | Jellyfin container image tag. Leave empty to automatically use the Chart's app version. |
|
| image.tag | string | `""` | Jellyfin container image tag. Leave empty to automatically use the Chart's app version. |
|
||||||
@@ -141,6 +146,33 @@ helm install my-jellyfin jellyfin/jellyfin -f values.yaml
|
|||||||
----------------------------------------------
|
----------------------------------------------
|
||||||
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
|
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
|
||||||
|
|
||||||
|
## Gateway API HTTPRoute
|
||||||
|
|
||||||
|
This chart supports the Kubernetes Gateway API HTTPRoute resource as a modern alternative to Ingress.
|
||||||
|
|
||||||
|
To use HTTPRoute, you need to have Gateway API CRDs installed in your cluster and a Gateway resource configured.
|
||||||
|
|
||||||
|
Example configuration:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
httpRoute:
|
||||||
|
enabled: true
|
||||||
|
annotations: {}
|
||||||
|
parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
namespace: gateway-system
|
||||||
|
sectionName: https
|
||||||
|
hostnames:
|
||||||
|
- jellyfin.example.com
|
||||||
|
rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information about Gateway API, see: <https://gateway-api.sigs.k8s.io/>
|
||||||
|
|
||||||
## Hardware acceleration
|
## Hardware acceleration
|
||||||
|
|
||||||
Out of the box the pod does not have the necessary permissions to enable hardware acceleration (HWA) in Jellyfin.
|
Out of the box the pod does not have the necessary permissions to enable hardware acceleration (HWA) in Jellyfin.
|
||||||
|
|||||||
@@ -59,6 +59,33 @@ helm install my-jellyfin jellyfin/jellyfin -f values.yaml
|
|||||||
|
|
||||||
{{ template "helm-docs.versionFooter" . }}
|
{{ template "helm-docs.versionFooter" . }}
|
||||||
|
|
||||||
|
## Gateway API HTTPRoute
|
||||||
|
|
||||||
|
This chart supports the Kubernetes Gateway API HTTPRoute resource as a modern alternative to Ingress.
|
||||||
|
|
||||||
|
To use HTTPRoute, you need to have Gateway API CRDs installed in your cluster and a Gateway resource configured.
|
||||||
|
|
||||||
|
Example configuration:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
httpRoute:
|
||||||
|
enabled: true
|
||||||
|
annotations: {}
|
||||||
|
parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
namespace: gateway-system
|
||||||
|
sectionName: https
|
||||||
|
hostnames:
|
||||||
|
- jellyfin.example.com
|
||||||
|
rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
```
|
||||||
|
|
||||||
|
For more information about Gateway API, see: <https://gateway-api.sigs.k8s.io/>
|
||||||
|
|
||||||
## Hardware acceleration
|
## Hardware acceleration
|
||||||
|
|
||||||
Out of the box the pod does not have the necessary permissions to enable hardware acceleration (HWA) in Jellyfin.
|
Out of the box the pod does not have the necessary permissions to enable hardware acceleration (HWA) in Jellyfin.
|
||||||
|
|||||||
@@ -101,6 +101,37 @@ For more information and documentation:
|
|||||||
$ helm status {{ .Release.Name }}
|
$ helm status {{ .Release.Name }}
|
||||||
$ helm get all {{ .Release.Name }}
|
$ helm get all {{ .Release.Name }}
|
||||||
|
|
||||||
|
{{- if .Values.httpRoute.enabled }}
|
||||||
|
|
||||||
|
HTTPRoute (Gateway API) is ENABLED:
|
||||||
|
{{- if .Values.httpRoute.parentRefs }}
|
||||||
|
Gateway References:
|
||||||
|
{{- range .Values.httpRoute.parentRefs }}
|
||||||
|
- {{ .name }}{{ if .namespace }} (namespace: {{ .namespace }}){{ end }}{{ if .sectionName }} [{{ .sectionName }}]{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
⚠ WARNING: No parentRefs defined - HTTPRoute will not attach to any Gateway!
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.httpRoute.hostnames }}
|
||||||
|
Hostnames:
|
||||||
|
{{- range .Values.httpRoute.hostnames }}
|
||||||
|
- {{ . }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
Rules: {{ len .Values.httpRoute.rules }} route(s) configured
|
||||||
|
Backend: {{ include "jellyfin.fullname" . }}:{{ .Values.service.port }}
|
||||||
|
|
||||||
|
Access Jellyfin via Gateway API at:
|
||||||
|
{{- if .Values.httpRoute.hostnames }}
|
||||||
|
{{- range .Values.httpRoute.hostnames }}
|
||||||
|
https://{{ . }}{{ (index $.Values.httpRoute.rules 0).matches 0 .path.value }}
|
||||||
|
{{- end }}
|
||||||
|
{{- else }}
|
||||||
|
(Configure httpRoute.hostnames for external access)
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
Note: Ensure your Gateway API CRDs are installed and Gateway is configured.
|
||||||
|
{{- else if .Values.ingress.enabled }}
|
||||||
{{- if .Values.ingress.enabled }}
|
{{- if .Values.ingress.enabled }}
|
||||||
|
|
||||||
Jellyfin is available via Ingress at:
|
Jellyfin is available via Ingress at:
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
{{- if .Values.httpRoute.enabled }}
|
||||||
|
apiVersion: gateway.networking.k8s.io/v1
|
||||||
|
kind: HTTPRoute
|
||||||
|
metadata:
|
||||||
|
name: {{ include "jellyfin.fullname" . }}
|
||||||
|
labels:
|
||||||
|
{{- include "jellyfin.labels" . | nindent 4 }}
|
||||||
|
{{- with .Values.httpRoute.annotations }}
|
||||||
|
annotations:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
{{- with .Values.httpRoute.parentRefs }}
|
||||||
|
parentRefs:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- with .Values.httpRoute.hostnames }}
|
||||||
|
hostnames:
|
||||||
|
{{- toYaml . | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
rules:
|
||||||
|
{{- range .Values.httpRoute.rules }}
|
||||||
|
- matches:
|
||||||
|
{{- range .matches }}
|
||||||
|
- path:
|
||||||
|
type: {{ .path.type }}
|
||||||
|
value: {{ .path.value }}
|
||||||
|
{{- end }}
|
||||||
|
backendRefs:
|
||||||
|
- name: {{ include "jellyfin.fullname" $ }}
|
||||||
|
port: {{ $.Values.service.port }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
@@ -0,0 +1,193 @@
|
|||||||
|
suite: test httproute
|
||||||
|
templates:
|
||||||
|
- httproute.yaml
|
||||||
|
tests:
|
||||||
|
- it: should not create HTTPRoute by default
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 0
|
||||||
|
|
||||||
|
- it: should create HTTPRoute when enabled
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
namespace: gateway-system
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
asserts:
|
||||||
|
- hasDocuments:
|
||||||
|
count: 1
|
||||||
|
- isKind:
|
||||||
|
of: HTTPRoute
|
||||||
|
- isAPIVersion:
|
||||||
|
of: gateway.networking.k8s.io/v1
|
||||||
|
- equal:
|
||||||
|
path: metadata.name
|
||||||
|
value: RELEASE-NAME-jellyfin
|
||||||
|
|
||||||
|
- it: should add annotations when specified
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
httpRoute.annotations:
|
||||||
|
my-annotation: my-value
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: metadata.annotations.my-annotation
|
||||||
|
value: my-value
|
||||||
|
|
||||||
|
- it: should set parentRefs correctly
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
namespace: gateway-system
|
||||||
|
sectionName: https
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.parentRefs[0].name
|
||||||
|
value: my-gateway
|
||||||
|
- equal:
|
||||||
|
path: spec.parentRefs[0].namespace
|
||||||
|
value: gateway-system
|
||||||
|
- equal:
|
||||||
|
path: spec.parentRefs[0].sectionName
|
||||||
|
value: https
|
||||||
|
|
||||||
|
- it: should set hostnames when specified
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
httpRoute.hostnames:
|
||||||
|
- jellyfin.example.com
|
||||||
|
- media.example.com
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.hostnames[0]
|
||||||
|
value: jellyfin.example.com
|
||||||
|
- equal:
|
||||||
|
path: spec.hostnames[1]
|
||||||
|
value: media.example.com
|
||||||
|
|
||||||
|
- it: should create rules with path matches
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /jellyfin
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].matches[0].path.type
|
||||||
|
value: PathPrefix
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].matches[0].path.value
|
||||||
|
value: /jellyfin
|
||||||
|
|
||||||
|
- it: should set backendRefs to jellyfin service
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
service.port: 8096
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].backendRefs[0].name
|
||||||
|
value: RELEASE-NAME-jellyfin
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].backendRefs[0].port
|
||||||
|
value: 8096
|
||||||
|
|
||||||
|
- it: should support multiple rules
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: Exact
|
||||||
|
value: /api
|
||||||
|
asserts:
|
||||||
|
- lengthEqual:
|
||||||
|
path: spec.rules
|
||||||
|
count: 2
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].matches[0].path.value
|
||||||
|
value: /
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[1].matches[0].path.value
|
||||||
|
value: /api
|
||||||
|
|
||||||
|
- it: should support multiple matches in single rule
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /api
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /web
|
||||||
|
asserts:
|
||||||
|
- lengthEqual:
|
||||||
|
path: spec.rules[0].matches
|
||||||
|
count: 2
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].matches[0].path.value
|
||||||
|
value: /api
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].matches[1].path.value
|
||||||
|
value: /web
|
||||||
|
|
||||||
|
- it: should use custom service port
|
||||||
|
set:
|
||||||
|
httpRoute.enabled: true
|
||||||
|
service.port: 9000
|
||||||
|
httpRoute.parentRefs:
|
||||||
|
- name: my-gateway
|
||||||
|
httpRoute.rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
asserts:
|
||||||
|
- equal:
|
||||||
|
path: spec.rules[0].backendRefs[0].port
|
||||||
|
value: 9000
|
||||||
@@ -139,6 +139,25 @@ ingress:
|
|||||||
# hosts:
|
# hosts:
|
||||||
# - chart-example.local
|
# - chart-example.local
|
||||||
|
|
||||||
|
# -- HTTPRoute configuration for Gateway API. See: https://gateway-api.sigs.k8s.io/
|
||||||
|
httpRoute:
|
||||||
|
enabled: false
|
||||||
|
annotations: {}
|
||||||
|
# -- Gateway references to attach this HTTPRoute to
|
||||||
|
parentRefs: []
|
||||||
|
# - name: my-gateway
|
||||||
|
# namespace: gateway-system
|
||||||
|
# sectionName: https
|
||||||
|
# -- Hostnames to match for this HTTPRoute
|
||||||
|
hostnames: []
|
||||||
|
# - jellyfin.example.com
|
||||||
|
# -- Rules for routing traffic
|
||||||
|
rules:
|
||||||
|
- matches:
|
||||||
|
- path:
|
||||||
|
type: PathPrefix
|
||||||
|
value: /
|
||||||
|
|
||||||
# -- Resource requests and limits for the Jellyfin container.
|
# -- Resource requests and limits for the Jellyfin container.
|
||||||
resources: {}
|
resources: {}
|
||||||
# limits:
|
# limits:
|
||||||
|
|||||||
Reference in new issue
Block a user