Three review changes to the freesailarr chart. Ingress: the chart no longer derives hosts as <app>.<ingress.domain> from one Ingress object. The global ingress.domain is gone; every app carries its own <app>.ingress.host and renders its own Ingress <release>-<chart>-<app>-ingress with its own TLS secret tls-<release>-<chart>-<app>-ingress. The hosts are therefore independent and may live in unrelated domains. The host is required, but the required() call sits inside the loop over the *enabled* app ingresses, so switching an app's ingress off must not make the chart demand a host for it. clusterIssuer, className and annotations stay global defaults and are overridable per app; an explicitly set per-app value wins (nil check instead of "default", so an empty override is honoured). Media: media.<category>.subPath mounts a sub-directory of the claim instead of its root, default null (claim root = previous behaviour). The same existingClaim may back all three categories with different subPaths. That is the point rather than cosmetics: Radarr and Sonarr import by moving, and a move within one filesystem can be a hardlink instead of a copy - across volume boundaries every import duplicates the file. Services: the collective Service with named ports is replaced by one ClusterIP Service <release>-<chart>-<app>-service per enabled app that listens on a port, flaresolverr included; recyclarr serves no port in daemon mode and gets none. Each ingress points at its own app's service. All containers share gluetun's network namespace, so the services differ only in their port - they provide stable per-app DNS names, not network separation. The StatefulSet's governing serviceName no longer names a removed object.
52 lines
2.2 KiB
YAML
52 lines
2.2 KiB
YAML
{{/*
|
|
One Ingress object per app whose ingress is enabled, each with its own host and
|
|
its own TLS secret. The hosts are independent values - they do not have to
|
|
share a domain - and each ingress points at its own app's service.
|
|
|
|
<app>.ingress.host is required, but only for an app whose ingress is actually
|
|
enabled: the required call sits inside the loop over the enabled apps, so
|
|
turning an app's ingress off must never make the chart demand a host for it.
|
|
*/}}
|
|
{{- if .Values.ingress.enabled }}
|
|
{{- range $app := include "freesailarr.ingressApps" $ | fromJsonArray }}
|
|
{{- $config := (index $.Values $app.name).ingress }}
|
|
{{- /* clusterIssuer, className and annotations default to the global ingress
|
|
block and are overridable per app; an explicitly set per-app value wins
|
|
even when it is empty, hence the nil check instead of "default". */}}
|
|
{{- $clusterIssuer := $.Values.ingress.clusterIssuer }}
|
|
{{- if not (kindIs "invalid" $config.clusterIssuer) }}{{- $clusterIssuer = $config.clusterIssuer }}{{- end }}
|
|
{{- $className := $.Values.ingress.className }}
|
|
{{- if not (kindIs "invalid" $config.className) }}{{- $className = $config.className }}{{- end }}
|
|
{{- $annotations := $.Values.ingress.annotations }}
|
|
{{- if not (kindIs "invalid" $config.annotations) }}{{- $annotations = $config.annotations }}{{- end }}
|
|
{{- $host := required (printf "%s.ingress.host must be provided while %s.ingress.enabled is true" $app.name $app.name) $config.host }}
|
|
---
|
|
apiVersion: networking.k8s.io/v1
|
|
kind: Ingress
|
|
metadata:
|
|
name: {{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $app.name }}-ingress
|
|
annotations:
|
|
cert-manager.io/cluster-issuer: {{ required "A Cluster-Issuer must be provided" $clusterIssuer }}
|
|
{{- with $annotations }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
ingressClassName: {{ $className }}
|
|
rules:
|
|
- host: {{ $host | quote }}
|
|
http:
|
|
paths:
|
|
- backend:
|
|
service:
|
|
name: {{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $app.name }}-service
|
|
port:
|
|
name: {{ $app.name }}
|
|
path: /
|
|
pathType: Prefix
|
|
tls:
|
|
- hosts:
|
|
- {{ $host | quote }}
|
|
secretName: tls-{{ $.Release.Name }}-{{ $.Chart.Name }}-{{ $app.name }}-ingress
|
|
{{- end }}
|
|
{{- end }}
|