Add media-apps stack to ArgoCD
Why: The media stack (jellyfin plus the sonarr/radarr/prowlarr/bazarr/nzbget/ jellyseerr apps) runs in the media-apps namespace but is deployed out-of-band by terraform-k8s rather than GitOps. Bringing it under ArgoCD makes the stack declarative, self-healing, and consistent with every other cluster workload, and prepares terraform-k8s to drop the media-apps config. How: - Add a media AppProject scoped to the media-apps namespace and a media-apps ApplicationSet that renders one Application per app plus a shared foundation. - Add a shared media-apps foundation (namespace, media-apps-vault-reader ServiceAccount, default VaultAuth on k8s/au/syd1, and the RWX movies/tvseries library PVCs) that the whole stack mounts. - Add per-app kustomize base and au-syd1 overlay for jellyfin and the six *arr apps, using plain resource names (jellyfin, sonarr, ...) with fresh PVCs. - Deploy jellyfin from the jellyfin-ha fork (Redis transcode store, RWX transcode scratch) wired to the shared movies/tvseries library PVCs, keeping the intel iGPU nodeSelector and gpu.intel.com/i915 request. - Source API keys and nzbget credentials through VSO VaultStaticSecrets from kv/service/media-apps/<app>; expose each app via a traefik-internal Gateway and HTTPRoute at <app>.k8s.syd1.au.unkin.net. - Register the media project and applicationset in the argocd bootstrap kustomizations.
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: nzbget
|
||||
namespace: media-apps
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nzbget
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: nzbget
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1000
|
||||
containers:
|
||||
- name: nzbget
|
||||
image: ghcr.io/home-operations/nzbget:rolling
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
containerPort: 6789
|
||||
protocol: TCP
|
||||
env:
|
||||
- name: TZ
|
||||
value: Australia/Sydney
|
||||
- name: PUID
|
||||
value: "1000"
|
||||
- name: PGID
|
||||
value: "1000"
|
||||
- name: NZBGET_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: nzbget-secrets
|
||||
key: NZBGET_USER
|
||||
- name: NZBGET_PASS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: nzbget-secrets
|
||||
key: NZBGET_PASS
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 512Mi
|
||||
limits:
|
||||
cpu: "4"
|
||||
memory: 8Gi
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 30
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: http
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /config
|
||||
- name: movies
|
||||
mountPath: /mnt/movies
|
||||
- name: tvseries
|
||||
mountPath: /mnt/tvseries
|
||||
volumes:
|
||||
- name: config
|
||||
persistentVolumeClaim:
|
||||
claimName: nzbget-config
|
||||
- name: movies
|
||||
persistentVolumeClaim:
|
||||
claimName: movies
|
||||
- name: tvseries
|
||||
persistentVolumeClaim:
|
||||
claimName: tvseries
|
||||
@@ -0,0 +1,37 @@
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: Gateway
|
||||
metadata:
|
||||
labels:
|
||||
traefik.io/instance: internal
|
||||
annotations:
|
||||
cert-manager.io/cluster-issuer: vault-issuer
|
||||
cert-manager.io/common-name: nzbget.k8s.syd1.au.unkin.net
|
||||
cert-manager.io/private-key-size: "4096"
|
||||
external-dns.alpha.kubernetes.io/hostname: nzbget.k8s.syd1.au.unkin.net
|
||||
external-dns.alpha.kubernetes.io/target: 198.18.200.4
|
||||
name: nzbget
|
||||
namespace: media-apps
|
||||
spec:
|
||||
gatewayClassName: traefik-internal
|
||||
listeners:
|
||||
- allowedRoutes:
|
||||
namespaces:
|
||||
from: Same
|
||||
hostname: nzbget.k8s.syd1.au.unkin.net
|
||||
name: http
|
||||
port: 80
|
||||
protocol: HTTP
|
||||
- allowedRoutes:
|
||||
namespaces:
|
||||
from: Same
|
||||
hostname: nzbget.k8s.syd1.au.unkin.net
|
||||
name: https
|
||||
port: 443
|
||||
protocol: HTTPS
|
||||
tls:
|
||||
certificateRefs:
|
||||
- group: ""
|
||||
kind: Secret
|
||||
name: nzbget-tls
|
||||
mode: Terminate
|
||||
@@ -0,0 +1,49 @@
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: http-redirect
|
||||
namespace: media-apps
|
||||
spec:
|
||||
hostnames:
|
||||
- nzbget.k8s.syd1.au.unkin.net
|
||||
parentRefs:
|
||||
- group: gateway.networking.k8s.io
|
||||
kind: Gateway
|
||||
name: nzbget
|
||||
sectionName: http
|
||||
rules:
|
||||
- filters:
|
||||
- type: RequestRedirect
|
||||
requestRedirect:
|
||||
scheme: https
|
||||
statusCode: 301
|
||||
matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: nzbget
|
||||
namespace: media-apps
|
||||
spec:
|
||||
hostnames:
|
||||
- nzbget.k8s.syd1.au.unkin.net
|
||||
parentRefs:
|
||||
- group: gateway.networking.k8s.io
|
||||
kind: Gateway
|
||||
name: nzbget
|
||||
sectionName: https
|
||||
rules:
|
||||
- backendRefs:
|
||||
- group: ""
|
||||
kind: Service
|
||||
name: nzbget
|
||||
port: 6789
|
||||
weight: 1
|
||||
matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /
|
||||
@@ -0,0 +1,11 @@
|
||||
---
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- pvc.yaml
|
||||
- vaultstaticsecret.yaml
|
||||
- deployment.yaml
|
||||
- service.yaml
|
||||
- gateway.yaml
|
||||
- httproute.yaml
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: nzbget-config
|
||||
namespace: media-apps
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storageClassName: cephrbd-fast-delete
|
||||
volumeMode: Filesystem
|
||||
@@ -0,0 +1,15 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: nzbget
|
||||
namespace: media-apps
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: nzbget
|
||||
ports:
|
||||
- name: http
|
||||
port: 6789
|
||||
targetPort: http
|
||||
protocol: TCP
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
apiVersion: secrets.hashicorp.com/v1beta1
|
||||
kind: VaultStaticSecret
|
||||
metadata:
|
||||
name: nzbget
|
||||
namespace: media-apps
|
||||
spec:
|
||||
destination:
|
||||
create: true
|
||||
name: nzbget-secrets
|
||||
mount: kv
|
||||
path: service/media-apps/nzbget
|
||||
refreshAfter: 30s
|
||||
type: kv-v2
|
||||
vaultAuthRef: default
|
||||
rolloutRestartTargets:
|
||||
- kind: Deployment
|
||||
name: nzbget
|
||||
Reference in New Issue
Block a user