summaryrefslogtreecommitdiff
path: root/f3s/jellyfin/helm-chart/templates/deployment.yaml
blob: 3da0348b79c9fcfbd0b9bc53cf4eecff4b3fd756 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jellyfin-server
  namespace: services
spec:
  replicas: 1
  # Recreate so the old pod fully terminates before the new one starts —
  # avoids NFS-lock races on the hostPath-backed PVC during rolling updates.
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app: jellyfin-server
  template:
    metadata:
      labels:
        app: jellyfin-server
    spec:
      initContainers:
        - name: nfs-check-config
          image: busybox:stable
          command:
            - sh
            - -c
            - |
              test -f /mnt/.nfs-sentinel || (
                echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel"
                echo "refusing to start; node likely has NFS unmounted"
                echo "pod would otherwise bind-mount the local-XFS shadow"
                exit 1
              )
          volumeMounts:
            - name: jellyfin-config
              mountPath: /mnt
              readOnly: true
        - name: nfs-check-libraries
          image: busybox:stable
          command:
            - sh
            - -c
            - |
              test -f /mnt/.nfs-sentinel || (
                echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel"
                echo "refusing to start; node likely has NFS unmounted"
                echo "pod would otherwise bind-mount the local-XFS shadow"
                exit 1
              )
          volumeMounts:
            - name: jellyfin-libraries
              mountPath: /mnt
              readOnly: true
        - name: nfs-check-data
          image: busybox:stable
          command:
            - sh
            - -c
            - |
              test -f /mnt/.nfs-sentinel || (
                echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel"
                echo "refusing to start; node likely has NFS unmounted"
                echo "pod would otherwise bind-mount the local-XFS shadow"
                exit 1
              )
          volumeMounts:
            - name: jellyfin-data
              mountPath: /mnt
              readOnly: true
      containers:
        - name: jellyfin
          image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
          ports:
            - containerPort: 8096
              name: http
          resources:
            requests:
              cpu: 500m
              memory: 512Mi
            limits:
              cpu: 4000m
              memory: 4Gi
          volumeMounts:
            - name: jellyfin-config
              mountPath: /config
            - name: jellyfin-libraries
              mountPath: /media/libraries
            - name: jellyfin-data
              mountPath: /data
      volumes:
        - name: jellyfin-config
          persistentVolumeClaim:
            claimName: jellyfin-config-pvc
        - name: jellyfin-libraries
          persistentVolumeClaim:
            claimName: jellyfin-libraries-pvc
        - name: jellyfin-data
          persistentVolumeClaim:
            claimName: jellyfin-data-pvc
---
apiVersion: v1
kind: Service
metadata:
  labels:
    app: jellyfin-server
  name: jellyfin-server
  namespace: services
spec:
  type: NodePort
  ports:
    - name: http
      port: 8096
      protocol: TCP
      targetPort: 8096
      nodePort: 30096
    - name: https
      port: 8920
      protocol: TCP
      targetPort: 8096
      nodePort: 30920
  selector:
    app: jellyfin-server