diff --git a/apps/filehosting/jellyfin/app.yaml b/apps/filehosting/jellyfin/app.yaml index dd10a84..97564d4 100644 --- a/apps/filehosting/jellyfin/app.yaml +++ b/apps/filehosting/jellyfin/app.yaml @@ -11,7 +11,7 @@ spec: allowEmpty: false syncOptions: - CreateNamespace=true - project: default + project: "{{ .customer.name }}-{{ .customer.project }}" destination: server: https://kubernetes.default.svc namespace: "{{ .customer.name }}-jellyfin-{{ .customer.stage }}" @@ -22,7 +22,7 @@ spec: helm: valuesObject: service: - type: LoadBalancer + type: ClusterIP ingress: enabled: false jellyfin: @@ -40,9 +40,12 @@ spec: config: enabled: true accessMode: ReadWriteOnce - size: 500Gi + size: 5Gi storageClass: "{{ .cluster.defaultStorageClass }}" media: - enabled: false + enabled: true + accessMode: ReadWriteOnce + size: 5Gi + storageClass: "{{ .cluster.defaultStorageClass }}" cache: enabled: false diff --git a/apps/filehosting/pinchflat/app.yaml b/apps/filehosting/pinchflat/app.yaml new file mode 100644 index 0000000..b342572 --- /dev/null +++ b/apps/filehosting/pinchflat/app.yaml @@ -0,0 +1,91 @@ +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + name: pinchflat + namespace: "{{ .customer.name }}-reserved" +spec: + syncPolicy: + automated: + prune: true + selfHeal: false + allowEmpty: false + syncOptions: + - CreateNamespace=true + project: "{{ .customer.name }}-{{ .customer.project }}" + destination: + server: https://kubernetes.default.svc + namespace: "{{ .customer.name }}-jellyfin-{{ .customer.stage }}" + source: + repoURL: https://bedag.github.io/helm-charts + targetRevision: 2.0.0 + chart: raw + helm: + valuesObject: + resources: + - apiVersion: apps/v1 + kind: Deployment + metadata: + name: pinchflat + labels: + app: pinchflat + spec: + replicas: 1 + selector: + matchLabels: + app: pinchflat + template: + metadata: + labels: + app: pinchflat + spec: + affinity: + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - jellyfin + topologyKey: kubernetes.io/hostname + containers: + - name: pinchflat + image: ghcr.io/kieraneglin/pinchflat:latest + ports: + - name: http + containerPort: 8945 + env: + - name: TZ + value: Europe/Zurich + - name: LOG_LEVEL + value: info + resources: + requests: + cpu: 100m + memory: 256Mi + limits: + cpu: 1000m + memory: 2Gi + volumeMounts: + - name: pinchflat-config + mountPath: /config + - name: media-library + mountPath: /downloads + volumes: + - name: pinchflat-config + emptyDir: {} + - name: media-library + persistentVolumeClaim: + claimName: "{{ .customer.name }}-jellyfin-{{ .customer.stage }}-media" + - apiVersion: v1 + kind: Service + metadata: + name: pinchflat + spec: + selector: + app: pinchflat + ports: + - name: http + port: 8945 + targetPort: http + type: ClusterIP diff --git a/apps/filehosting/pinchflat/kustomization.yaml b/apps/filehosting/pinchflat/kustomization.yaml new file mode 100644 index 0000000..30ecf93 --- /dev/null +++ b/apps/filehosting/pinchflat/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - app.yaml diff --git a/environments/customers/a01/overlays/prod/kustomization.yaml b/environments/customers/a01/overlays/prod/kustomization.yaml index 1684cff..54bc51f 100644 --- a/environments/customers/a01/overlays/prod/kustomization.yaml +++ b/environments/customers/a01/overlays/prod/kustomization.yaml @@ -8,6 +8,8 @@ resources: - ../../../../../apps/filehosting/nextcloud/ # - ../../../../../apps/productivity/overleaf/ - ../../../../../apps/productivity/jupyterhub/ + - ../../../../../apps/filehosting/jellyfin/ + - ../../../../../apps/filehosting/pinchflat/ patches: # - target: # kind: Application diff --git a/environments/customers/a01/overlays/prod/patches/jellyfin.yaml b/environments/customers/a01/overlays/prod/patches/jellyfin.yaml new file mode 100644 index 0000000..cc246b0 --- /dev/null +++ b/environments/customers/a01/overlays/prod/patches/jellyfin.yaml @@ -0,0 +1,19 @@ +- op: replace + path: /spec/source/helm/valuesObject/persistence/media/size + value: 100Gi +- op: replace + path: /spec/source/helm/valuesObject/ingress + value: + enabled: true + className: nginx + annotations: + cert-manager.io/cluster-issuer: letsencrypt-prod-nginx + hosts: + - host: jellyfin.{{ .customer.domain }} + paths: + - path: / + pathType: ImplementationSpecific + tls: + - hosts: + - jellyfin.{{ .customer.domain }} + secretName: jellyfin-tls \ No newline at end of file diff --git a/environments/customers/a01/overlays/prod/patches/pinchflat.yaml b/environments/customers/a01/overlays/prod/patches/pinchflat.yaml new file mode 100644 index 0000000..d54cea2 --- /dev/null +++ b/environments/customers/a01/overlays/prod/patches/pinchflat.yaml @@ -0,0 +1,20 @@ +- op: replace + path: /spec/source/helm/valuesObject/resources/0/spec/template/spec/volumes/0 + value: + name: pinchflat-config + persistentVolumeClaim: + claimName: pinchflat-config +- op: add + path: /spec/source/helm/valuesObject/resources/- + value: + apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: pinchflat-config + spec: + accessModes: + - ReadWriteMany + storageClassName: nfs + resources: + requests: + storage: 2Gi \ No newline at end of file diff --git a/environments/customers/a01/overlays/test/kustomization.yaml b/environments/customers/a01/overlays/test/kustomization.yaml index 1420c2f..23327a8 100644 --- a/environments/customers/a01/overlays/test/kustomization.yaml +++ b/environments/customers/a01/overlays/test/kustomization.yaml @@ -5,8 +5,13 @@ nameSuffix: "-test" resources: - placeholder-configmap.yaml - ../../../../../apps/filehosting/jellyfin/ + - ../../../../../apps/filehosting/pinchflat/ patches: - target: kind: Application name: jellyfin path: patches/jellyfin.yaml + - target: + kind: Application + name: pinchflat + path: patches/pinchflat.yaml diff --git a/environments/customers/a01/overlays/test/patches/ghost.yaml b/environments/customers/a01/overlays/test/patches/ghost.yaml deleted file mode 100644 index 5806863..0000000 --- a/environments/customers/a01/overlays/test/patches/ghost.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: patch -spec: - destination: - namespace: a01-ghost \ No newline at end of file diff --git a/environments/customers/a01/overlays/test/patches/jellyfin.yaml b/environments/customers/a01/overlays/test/patches/jellyfin.yaml index 2f671eb..23fe745 100644 --- a/environments/customers/a01/overlays/test/patches/jellyfin.yaml +++ b/environments/customers/a01/overlays/test/patches/jellyfin.yaml @@ -1,11 +1,3 @@ -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: patch -spec: - source: - helm: - valuesObject: - persistence: - config: - size: 10Gi +- op: replace + path: /spec/source/helm/valuesObject/persistence/media/size + value: 10Gi diff --git a/environments/customers/a01/overlays/test/patches/pinchflat.yaml b/environments/customers/a01/overlays/test/patches/pinchflat.yaml new file mode 100644 index 0000000..2b07dc3 --- /dev/null +++ b/environments/customers/a01/overlays/test/patches/pinchflat.yaml @@ -0,0 +1,23 @@ +- op: replace + path: /spec/source/helm/valuesObject/resources/1/spec/type + value: LoadBalancer +- op: replace + path: /spec/source/helm/valuesObject/resources/0/spec/template/spec/volumes/0 + value: + name: pinchflat-config + persistentVolumeClaim: + claimName: pinchflat-config +- op: add + path: /spec/source/helm/valuesObject/resources/- + value: + apiVersion: v1 + kind: PersistentVolumeClaim + metadata: + name: pinchflat-config + spec: + accessModes: + - ReadWriteMany + storageClassName: nfs + resources: + requests: + storage: 2Gi