Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(kubernetes): install jellyfin #913

Merged
merged 1 commit into from
Jun 3, 2024
Merged

feat(kubernetes): install jellyfin #913

merged 1 commit into from
Jun 3, 2024

Conversation

martinohmann
Copy link
Owner

No description provided.

@github-actions github-actions bot added area/kubernetes Changes made in the kubernetes directory cluster/main labels Jun 3, 2024
Copy link

github-actions bot commented Jun 3, 2024

kustomization changes in kubernetes/main

--- kubernetes/main/apps/default/homepage/app Kustomization: flux-system/homepage ConfigMap: default/homepage

+++ kubernetes/main/apps/default/homepage/app Kustomization: flux-system/homepage ConfigMap: default/homepage

@@ -41,13 +41,13 @@

             href: https://registry.18b.haus
             icon: https://zotregistry.dev/v2.0.4/assets/images/logo.svg
   settings.yaml: |
     background:
       image: https://static.18b.haus/img/wooden-floor.jpg
       opacity: 10
-    fiveColumns: true
+    fiveColumns: false
     headerStyle: clean
     hideErrors: true
     hideVersion: true
     iconStyle: theme
     layout:
       Automation:
@@ -56,12 +56,14 @@

         style: column
       Observability:
         style: column
       Storage:
         style: column
       Tools:
+        style: column
+      Media:
         style: column
     showStats: false
     statusStyle: dot
     target: _self
     title: Home
   widgets.yaml: |
--- kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/jellyfin

+++ kubernetes/main/apps Kustomization: flux-system/cluster-apps Kustomization: flux-system/jellyfin

@@ -0,0 +1,41 @@

+---
+apiVersion: kustomize.toolkit.fluxcd.io/v1
+kind: Kustomization
+metadata:
+  labels:
+    kustomize.toolkit.fluxcd.io/name: cluster-apps
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: jellyfin
+  namespace: flux-system
+spec:
+  commonMetadata:
+    labels:
+      app.kubernetes.io/name: jellyfin
+  decryption:
+    provider: sops
+    secretRef:
+      name: sops-age
+  interval: 2h
+  path: ./kubernetes/main/apps/default/jellyfin/app
+  postBuild:
+    substitute:
+      APP: jellyfin
+      VOLSYNC_ACCESSMODES: ReadWriteOnce
+      VOLSYNC_CAPACITY: 1Gi
+      VOLSYNC_MOVER_FS_GROUP: '10000'
+      VOLSYNC_MOVER_GROUP: '10000'
+      VOLSYNC_MOVER_USER: '10000'
+      VOLSYNC_SCHEDULE_B2: 45 1 * * 0
+      VOLSYNC_SCHEDULE_MINIO: 45 1 * * *
+    substituteFrom:
+    - kind: Secret
+      name: cluster-secrets
+  prune: true
+  retryInterval: 1m
+  sourceRef:
+    kind: GitRepository
+    name: home-kubernetes
+  targetNamespace: default
+  timeout: 5m
+  wait: false
+
--- kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin HelmRelease: default/jellyfin

+++ kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin HelmRelease: default/jellyfin

@@ -0,0 +1,144 @@

+---
+apiVersion: helm.toolkit.fluxcd.io/v2
+kind: HelmRelease
+metadata:
+  labels:
+    app.kubernetes.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: jellyfin
+  namespace: default
+spec:
+  chart:
+    spec:
+      chart: app-template
+      sourceRef:
+        kind: HelmRepository
+        name: bjw-s
+        namespace: flux-system
+      version: 3.2.1
+  dependsOn:
+  - name: longhorn
+    namespace: longhorn-system
+  - name: volsync
+    namespace: volsync-system
+  install:
+    remediation:
+      retries: 3
+  interval: 2h
+  maxHistory: 2
+  uninstall:
+    keepHistory: false
+  upgrade:
+    cleanupOnFail: true
+    remediation:
+      retries: 3
+  values:
+    controllers:
+      jellyfin:
+        containers:
+          app:
+            env:
+              DOTNET_SYSTEM_IO_DISABLEFILELOCKING: 'true'
+              JELLYFIN_PublishedServerUrl: 192.168.40.247
+            image:
+              repository: ghcr.io/jellyfin/jellyfin
+              tag: 10.9.4
+            probes:
+              liveness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 3
+                  httpGet:
+                    path: /health
+                    port: 8096
+                  initialDelaySeconds: 0
+                  periodSeconds: 10
+                  timeoutSeconds: 1
+              readiness:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 3
+                  httpGet:
+                    path: /health
+                    port: 8096
+                  initialDelaySeconds: 0
+                  periodSeconds: 10
+                  timeoutSeconds: 1
+              startup:
+                custom: true
+                enabled: true
+                spec:
+                  failureThreshold: 30
+                  httpGet:
+                    path: /health
+                    port: 8096
+                  initialDelaySeconds: 0
+                  periodSeconds: 10
+                  timeoutSeconds: 1
+            resources:
+              limits:
+                memory: 2Gi
+              requests:
+                cpu: 10m
+                memory: 512Mi
+    defaultPodOptions:
+      securityContext:
+        fsGroup: 10000
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 10000
+        runAsUser: 10000
+    ingress:
+      app:
+        annotations:
+          gethomepage.dev/enabled: 'true'
+          gethomepage.dev/group: Media
+          gethomepage.dev/icon: jellyfin.png
+          gethomepage.dev/name: Jellyfin
+        className: internal
+        enabled: true
+        hosts:
+        - host: jellyfin.18b.haus
+          paths:
+          - path: /
+            service:
+              identifier: app
+              port: http
+        tls:
+        - hosts:
+          - jellyfin.18b.haus
+    persistence:
+      cache:
+        advancedMounts:
+          jellyfin:
+            main:
+            - path: /config/cache
+        enabled: true
+        type: emptyDir
+      config:
+        enabled: true
+        existingClaim: jellyfin
+        globalMounts:
+        - path: /config
+      media:
+        enabled: true
+        globalMounts:
+        - path: /media
+        path: /io/media
+        server: storage.svc.18b.lan
+        type: nfs
+      transcode:
+        enabled: true
+        type: emptyDir
+    service:
+      app:
+        annotations:
+          io.cilium/lb-ipam-ips: 192.168.40.247
+        controller: jellyfin
+        ports:
+          http:
+            port: 8096
+        type: LoadBalancer
+
--- kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin PersistentVolumeClaim: default/jellyfin

+++ kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin PersistentVolumeClaim: default/jellyfin

@@ -0,0 +1,22 @@

+---
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  labels:
+    app.kubernetes.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: jellyfin
+  namespace: default
+spec:
+  accessModes:
+  - ReadWriteOnce
+  dataSourceRef:
+    apiGroup: volsync.backube
+    kind: ReplicationDestination
+    name: jellyfin-dst
+  resources:
+    requests:
+      storage: 1Gi
+  storageClassName: longhorn
+
--- kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin ReplicationSource: default/jellyfin

+++ kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin ReplicationSource: default/jellyfin

@@ -0,0 +1,36 @@

+---
+apiVersion: volsync.backube/v1alpha1
+kind: ReplicationSource
+metadata:
+  labels:
+    app.kubernetes.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: jellyfin
+  namespace: default
+spec:
+  restic:
+    accessModes:
+    - ReadWriteOnce
+    cacheAccessModes:
+    - ReadWriteOnce
+    cacheCapacity: 1Gi
+    cacheStorageClassName: openebs-hostpath
+    copyMethod: Snapshot
+    moverSecurityContext:
+      fsGroup: 10000
+      runAsGroup: 10000
+      runAsUser: 10000
+    pruneIntervalDays: 7
+    repository: jellyfin-volsync
+    retain:
+      daily: 7
+      hourly: 24
+      monthly: 6
+      weekly: 4
+    storageClassName: longhorn
+    volumeSnapshotClassName: longhorn
+  sourcePVC: jellyfin
+  trigger:
+    schedule: 45 1 * * *
+
--- kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin ReplicationDestination: default/jellyfin-dst

+++ kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin ReplicationDestination: default/jellyfin-dst

@@ -0,0 +1,30 @@

+---
+apiVersion: volsync.backube/v1alpha1
+kind: ReplicationDestination
+metadata:
+  labels:
+    app.kubernetes.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: jellyfin-dst
+  namespace: default
+spec:
+  restic:
+    accessModes:
+    - ReadWriteOnce
+    cacheAccessModes:
+    - ReadWriteOnce
+    cacheCapacity: 1Gi
+    cacheStorageClassName: openebs-hostpath
+    capacity: 1Gi
+    copyMethod: Snapshot
+    moverSecurityContext:
+      fsGroup: 10000
+      runAsGroup: 10000
+      runAsUser: 10000
+    repository: jellyfin-volsync
+    storageClassName: longhorn
+    volumeSnapshotClassName: longhorn
+  trigger:
+    manual: restore-once
+
--- kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin ReplicationSource: default/jellyfin-b2

+++ kubernetes/main/apps/default/jellyfin/app Kustomization: flux-system/jellyfin ReplicationSource: default/jellyfin-b2

@@ -0,0 +1,34 @@

+---
+apiVersion: volsync.backube/v1alpha1
+kind: ReplicationSource
+metadata:
+  labels:
+    app.kubernetes.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/name: jellyfin
+    kustomize.toolkit.fluxcd.io/namespace: flux-system
+  name: jellyfin-b2
+  namespace: default
+spec:
+  restic:
+    accessModes:
+    - ReadWriteOnce
+    cacheAccessModes:
+    - ReadWriteOnce
+    cacheCapacity: 1Gi
+    cacheStorageClassName: openebs-hostpath
+    copyMethod: Snapshot
+    moverSecurityContext:
+      fsGroup: 10000
+      runAsGroup: 10000
+      runAsUser: 10000
+    pruneIntervalDays: 7
+    repository: jellyfin-b2-volsync
+    retain:
+      daily: 7
+      weekly: 4
+    storageClassName: longhorn
+    volumeSnapshotClassName: longhorn
+  sourcePVC: jellyfin
+  trigger:
+    schedule: 45 1 * * 0
+

Copy link

github-actions bot commented Jun 3, 2024

helmrelease changes in kubernetes/main

--- HelmRelease: default/jellyfin Service: default/jellyfin

+++ HelmRelease: default/jellyfin Service: default/jellyfin

@@ -0,0 +1,24 @@

+---
+apiVersion: v1
+kind: Service
+metadata:
+  name: jellyfin
+  labels:
+    app.kubernetes.io/instance: jellyfin
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: jellyfin
+    app.kubernetes.io/service: jellyfin
+  annotations:
+    io.cilium/lb-ipam-ips: 192.168.40.247
+spec:
+  type: LoadBalancer
+  ports:
+  - port: 8096
+    targetPort: 8096
+    protocol: TCP
+    name: http
+  selector:
+    app.kubernetes.io/component: jellyfin
+    app.kubernetes.io/instance: jellyfin
+    app.kubernetes.io/name: jellyfin
+
--- HelmRelease: default/jellyfin Deployment: default/jellyfin

+++ HelmRelease: default/jellyfin Deployment: default/jellyfin

@@ -0,0 +1,97 @@

+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: jellyfin
+  labels:
+    app.kubernetes.io/component: jellyfin
+    app.kubernetes.io/instance: jellyfin
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: jellyfin
+spec:
+  revisionHistoryLimit: 3
+  replicas: 1
+  strategy:
+    type: Recreate
+  selector:
+    matchLabels:
+      app.kubernetes.io/component: jellyfin
+      app.kubernetes.io/name: jellyfin
+      app.kubernetes.io/instance: jellyfin
+  template:
+    metadata:
+      labels:
+        app.kubernetes.io/component: jellyfin
+        app.kubernetes.io/instance: jellyfin
+        app.kubernetes.io/name: jellyfin
+    spec:
+      enableServiceLinks: false
+      serviceAccountName: default
+      automountServiceAccountToken: true
+      securityContext:
+        fsGroup: 10000
+        fsGroupChangePolicy: OnRootMismatch
+        runAsGroup: 10000
+        runAsUser: 10000
+      hostIPC: false
+      hostNetwork: false
+      hostPID: false
+      dnsPolicy: ClusterFirst
+      containers:
+      - env:
+        - name: DOTNET_SYSTEM_IO_DISABLEFILELOCKING
+          value: 'true'
+        - name: JELLYFIN_PublishedServerUrl
+          value: 192.168.40.247
+        image: ghcr.io/jellyfin/jellyfin:10.9.4
+        livenessProbe:
+          failureThreshold: 3
+          httpGet:
+            path: /health
+            port: 8096
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          timeoutSeconds: 1
+        name: app
+        readinessProbe:
+          failureThreshold: 3
+          httpGet:
+            path: /health
+            port: 8096
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          timeoutSeconds: 1
+        resources:
+          limits:
+            memory: 2Gi
+          requests:
+            cpu: 10m
+            memory: 512Mi
+        startupProbe:
+          failureThreshold: 30
+          httpGet:
+            path: /health
+            port: 8096
+          initialDelaySeconds: 0
+          periodSeconds: 10
+          timeoutSeconds: 1
+        volumeMounts:
+        - mountPath: /config
+          name: config
+        - mountPath: /media
+          name: media
+        - mountPath: /transcode
+          name: transcode
+      volumes:
+      - emptyDir: {}
+        name: cache
+      - name: config
+        persistentVolumeClaim:
+          claimName: jellyfin
+      - name: media
+        nfs:
+          path: /io/media
+          server: storage.svc.18b.lan
+      - emptyDir: {}
+        name: transcode
+
--- HelmRelease: default/jellyfin Ingress: default/jellyfin

+++ HelmRelease: default/jellyfin Ingress: default/jellyfin

@@ -0,0 +1,31 @@

+---
+apiVersion: networking.k8s.io/v1
+kind: Ingress
+metadata:
+  name: jellyfin
+  labels:
+    app.kubernetes.io/instance: jellyfin
+    app.kubernetes.io/managed-by: Helm
+    app.kubernetes.io/name: jellyfin
+  annotations:
+    gethomepage.dev/enabled: 'true'
+    gethomepage.dev/group: Media
+    gethomepage.dev/icon: jellyfin.png
+    gethomepage.dev/name: Jellyfin
+spec:
+  ingressClassName: internal
+  tls:
+  - hosts:
+    - jellyfin.18b.haus
+  rules:
+  - host: jellyfin.18b.haus
+    http:
+      paths:
+      - path: /
+        pathType: Prefix
+        backend:
+          service:
+            name: jellyfin
+            port:
+              number: 8096
+

@martinohmann martinohmann force-pushed the jellyfin/install branch 3 times, most recently from f30de10 to 9304bf1 Compare June 3, 2024 17:43
@martinohmann martinohmann merged commit bf827e2 into main Jun 3, 2024
7 checks passed
@martinohmann martinohmann deleted the jellyfin/install branch July 2, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes Changes made in the kubernetes directory cluster/main
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant