From 9a290527ba5a26af8f0c84af63d42769ad23bf4d Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 5 Aug 2024 00:10:14 +1000 Subject: [PATCH 1/3] add app jellyfin --- apps/jellyfin/base/kustomization.yaml | 8 + apps/jellyfin/base/values.yaml | 148 ++++++++++++++++++ apps/jellyfin/env/k3s-cluster/config.json | 12 ++ apps/jellyfin/env/k3s-cluster/ingress.yaml | 31 ++++ .../env/k3s-cluster/kustomization.yaml | 5 + .../elasticsearch/base/kustomization.yaml | 12 ++ .../elasticsearch/base/values.yaml | 55 +++++++ .../elasticsearch/env/k3s-cluster/config.json | 12 ++ .../env/k3s-cluster/kustomization.yaml | 4 + .../k3s-cluster/templates/elasticsearch.yaml | 13 ++ .../templates/jellyfin-config-pv.yaml | 25 +++ .../templates/jellyfin-data-pv.yaml | 25 +++ .../env/k3s-cluster/templates/jellyfin.yaml | 9 ++ 13 files changed, 359 insertions(+) create mode 100644 apps/jellyfin/base/kustomization.yaml create mode 100644 apps/jellyfin/base/values.yaml create mode 100644 apps/jellyfin/env/k3s-cluster/config.json create mode 100644 apps/jellyfin/env/k3s-cluster/ingress.yaml create mode 100644 apps/jellyfin/env/k3s-cluster/kustomization.yaml create mode 100644 infrastructures/elasticsearch/base/kustomization.yaml create mode 100644 infrastructures/elasticsearch/base/values.yaml create mode 100644 infrastructures/elasticsearch/env/k3s-cluster/config.json create mode 100644 infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml create mode 100644 resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml create mode 100644 resources/app-volumes/env/k3s-cluster/templates/jellyfin-config-pv.yaml create mode 100644 resources/app-volumes/env/k3s-cluster/templates/jellyfin-data-pv.yaml create mode 100644 resources/namespaces/env/k3s-cluster/templates/jellyfin.yaml diff --git a/apps/jellyfin/base/kustomization.yaml b/apps/jellyfin/base/kustomization.yaml new file mode 100644 index 0000000..bef5627 --- /dev/null +++ b/apps/jellyfin/base/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +helmCharts: + - name: jellyfin + repo: https://beluga-cloud.github.io/charts + version: 2.3.0 + releaseName: jellyfin + valuesFile: values.yaml \ No newline at end of file diff --git a/apps/jellyfin/base/values.yaml b/apps/jellyfin/base/values.yaml new file mode 100644 index 0000000..9a96575 --- /dev/null +++ b/apps/jellyfin/base/values.yaml @@ -0,0 +1,148 @@ +persistence: + config: + enabled: true + volumeClaimSpec: + accessModes: + - ReadWriteOnce + volumeName: jellyfin-config + storageClassName: local-path + data: + enabled: true + volumeClaimSpec: + accessModes: + - ReadWriteOnce + volumeName: jellyfin-data + storageClassName: local-path +jellyfin: + mediaVolumes: + - name: movies + readOnly: false + volumeSpec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 256Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + claimRef: + apiVersion: v1 + kind: PersistentVolumeClaim + name: jellyfin-mediavol-movies + namespace: jellyfin + hostPath: + path: "/mnt/nfs/AppData/jellyfin/media/movies" + type: "Directory" + - name: series + readOnly: false + volumeSpec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 256Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + claimRef: + apiVersion: v1 + kind: PersistentVolumeClaim + name: jellyfin-mediavol-series + namespace: jellyfin + hostPath: + path: "/mnt/nfs/AppData/jellyfin/media/series" + type: "Directory" + - name: music-videos + readOnly: false + volumeSpec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 128Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + claimRef: + apiVersion: v1 + kind: PersistentVolumeClaim + name: jellyfin-mediavol-music-videos + namespace: jellyfin + hostPath: + path: "/mnt/nfs/AppData/jellyfin/media/music-videos" + type: "Directory" + - name: short-videos + readOnly: false + volumeSpec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 32Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + claimRef: + apiVersion: v1 + kind: PersistentVolumeClaim + name: jellyfin-mediavol-short-videos + namespace: jellyfin + hostPath: + path: "/mnt/nfs/AppData/jellyfin/media/short-videos" + type: "Directory" + - name: gv + readOnly: false + volumeSpec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 64Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux + claimRef: + apiVersion: v1 + kind: PersistentVolumeClaim + name: jellyfin-mediavol-gv + namespace: jellyfin + hostPath: + path: "/mnt/nfs/AppData/jellyfin/media/gv" + type: "Directory" + persistentTranscodes: true \ No newline at end of file diff --git a/apps/jellyfin/env/k3s-cluster/config.json b/apps/jellyfin/env/k3s-cluster/config.json new file mode 100644 index 0000000..cf1f2c3 --- /dev/null +++ b/apps/jellyfin/env/k3s-cluster/config.json @@ -0,0 +1,12 @@ +{ + "appName": "jellyfin", + "userGivenName": "jellyfin", + "namespace": "jellyfin", + "destNamespace": "jellyfin", + "destServer": "https://kubernetes.default.svc", + "srcPath": "apps/jellyfin/env/k3s-cluster", + "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", + "srcTargetRevision": "", + "labels": null, + "annotations": null +} \ No newline at end of file diff --git a/apps/jellyfin/env/k3s-cluster/ingress.yaml b/apps/jellyfin/env/k3s-cluster/ingress.yaml new file mode 100644 index 0000000..a14ec80 --- /dev/null +++ b/apps/jellyfin/env/k3s-cluster/ingress.yaml @@ -0,0 +1,31 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: jellyfin-ingress + namespace: jellyfin + annotations: + nginx.ingress.kubernetes.io/ssl-redirect: "false" + nginx.ingress.kubernetes.io/use-regex: "true" +spec: + ingressClassName: nginx + rules: + - host: "jellyfin.cluster.local" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: jellyfin + port: + number: 8096 + - host: "jellyfin.cluster.edward.sydney" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: jellyfin + port: + number: 8096 \ No newline at end of file diff --git a/apps/jellyfin/env/k3s-cluster/kustomization.yaml b/apps/jellyfin/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..3ea3085 --- /dev/null +++ b/apps/jellyfin/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base + - ./ingress.yaml \ No newline at end of file diff --git a/infrastructures/elasticsearch/base/kustomization.yaml b/infrastructures/elasticsearch/base/kustomization.yaml new file mode 100644 index 0000000..801015a --- /dev/null +++ b/infrastructures/elasticsearch/base/kustomization.yaml @@ -0,0 +1,12 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: [] +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +helmCharts: + - name: XXX + repo: https://raw.githubusercontent.com/plexinc/pms-docker/gh-pages + version: 0.0.0 + releaseName: XXX + valuesFile: values.yaml \ No newline at end of file diff --git a/infrastructures/elasticsearch/base/values.yaml b/infrastructures/elasticsearch/base/values.yaml new file mode 100644 index 0000000..7d8ba80 --- /dev/null +++ b/infrastructures/elasticsearch/base/values.yaml @@ -0,0 +1,55 @@ +namespaceOverride: elasticsearch +clusterDomain: elasticsearch.cluster.edward.sydney +clusterName: k3s-cluster +security: + enabled: true + existingSecret: elasticsearch-secrets +service: + type: LoadBalancer +ingress: + enabled: true + hostname: elasticsearch.cluster.edward.sydney + ingressClassName: nginx +master: + podSecurityContext: + fsGroup: 1000 + containerSecurityContext: + runAsUser: 1000 + runAsGroup: 1000 + persistent: + existingClaim: "" + existingVolume: "" + size: 32Gi + persistentVolumeClaimRetentionPolicy: + enabled: true +data: + podSecurityContext: + fsGroup: 1000 + containerSecurityContext: + runAsUser: 1000 + runAsGroup: 1000 + persistent: + existingClaim: "" + existingVolume: "" + size: 32Gi + persistentVolumeClaimRetentionPolicy: + enabled: true +coordinating: + podSecurityContext: + fsGroup: 1000 + containerSecurityContext: + runAsUser: 1000 + runAsGroup: 1000 +injest: + podSecurityContext: + fsGroup: 1000 + containerSecurityContext: + runAsUser: 1000 + runAsGroup: 1000 + service: + type: LoadBalancer + ports: + restAPI: 19200 + transport: 19300 + ingress: + diff --git a/infrastructures/elasticsearch/env/k3s-cluster/config.json b/infrastructures/elasticsearch/env/k3s-cluster/config.json new file mode 100644 index 0000000..dc1ebfd --- /dev/null +++ b/infrastructures/elasticsearch/env/k3s-cluster/config.json @@ -0,0 +1,12 @@ +{ + "appName": "XXX", + "userGivenName": "XXX", + "namespace": "XXX", + "destNamespace": "XXX", + "destServer": "https://kubernetes.default.svc", + "srcPath": "XXX/XXX/env/k3s-cluster", + "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", + "srcTargetRevision": "", + "labels": null, + "annotations": null +} \ No newline at end of file diff --git a/infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml b/infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml new file mode 100644 index 0000000..a227ac4 --- /dev/null +++ b/infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base \ No newline at end of file diff --git a/resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml b/resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml new file mode 100644 index 0000000..5dccf33 --- /dev/null +++ b/resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + annotations: + argocd.argoproj.io/sync-options: Prune=false + sealedsecrets.bitnami.com/cluster-wide: "true" + sealedsecrets.bitnami.com/managed: "true" + creationTimestamp: null + name: elasticsearch-secrets + namespace: elasticsearch +type: Opaque +stringData: + elasticsearch-password: "" \ No newline at end of file diff --git a/resources/app-volumes/env/k3s-cluster/templates/jellyfin-config-pv.yaml b/resources/app-volumes/env/k3s-cluster/templates/jellyfin-config-pv.yaml new file mode 100644 index 0000000..7584d77 --- /dev/null +++ b/resources/app-volumes/env/k3s-cluster/templates/jellyfin-config-pv.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: jellyfin-config + namespace: jellyfin + labels: + type: local +spec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 250Mi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + local: + path: "/mnt/nfs/AppData/jellyfin/config" + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux \ No newline at end of file diff --git a/resources/app-volumes/env/k3s-cluster/templates/jellyfin-data-pv.yaml b/resources/app-volumes/env/k3s-cluster/templates/jellyfin-data-pv.yaml new file mode 100644 index 0000000..d4659a7 --- /dev/null +++ b/resources/app-volumes/env/k3s-cluster/templates/jellyfin-data-pv.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: jellyfin-data + namespace: jellyfin + labels: + type: local +spec: + storageClassName: local-path + volumeMode: Filesystem + capacity: + storage: 2Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + local: + path: "/mnt/nfs/AppData/jellyfin/data" + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: In + values: + - linux \ No newline at end of file diff --git a/resources/namespaces/env/k3s-cluster/templates/jellyfin.yaml b/resources/namespaces/env/k3s-cluster/templates/jellyfin.yaml new file mode 100644 index 0000000..6329022 --- /dev/null +++ b/resources/namespaces/env/k3s-cluster/templates/jellyfin.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Namespace +metadata: + annotations: + argocd.argoproj.io/sync-options: Prune=false + creationTimestamp: null + name: jellyfin +spec: {} +status: {} From eb8cedda06dae2704229f688cf61e7c873dcc7bc Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 5 Aug 2024 00:11:01 +1000 Subject: [PATCH 2/3] add app jellyfin --- .../elasticsearch/base/kustomization.yaml | 12 ---- .../elasticsearch/base/values.yaml | 55 ------------------- .../elasticsearch/env/k3s-cluster/config.json | 12 ---- .../env/k3s-cluster/kustomization.yaml | 4 -- 4 files changed, 83 deletions(-) delete mode 100644 infrastructures/elasticsearch/base/kustomization.yaml delete mode 100644 infrastructures/elasticsearch/base/values.yaml delete mode 100644 infrastructures/elasticsearch/env/k3s-cluster/config.json delete mode 100644 infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml diff --git a/infrastructures/elasticsearch/base/kustomization.yaml b/infrastructures/elasticsearch/base/kustomization.yaml deleted file mode 100644 index 801015a..0000000 --- a/infrastructures/elasticsearch/base/kustomization.yaml +++ /dev/null @@ -1,12 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: [] ---- -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -helmCharts: - - name: XXX - repo: https://raw.githubusercontent.com/plexinc/pms-docker/gh-pages - version: 0.0.0 - releaseName: XXX - valuesFile: values.yaml \ No newline at end of file diff --git a/infrastructures/elasticsearch/base/values.yaml b/infrastructures/elasticsearch/base/values.yaml deleted file mode 100644 index 7d8ba80..0000000 --- a/infrastructures/elasticsearch/base/values.yaml +++ /dev/null @@ -1,55 +0,0 @@ -namespaceOverride: elasticsearch -clusterDomain: elasticsearch.cluster.edward.sydney -clusterName: k3s-cluster -security: - enabled: true - existingSecret: elasticsearch-secrets -service: - type: LoadBalancer -ingress: - enabled: true - hostname: elasticsearch.cluster.edward.sydney - ingressClassName: nginx -master: - podSecurityContext: - fsGroup: 1000 - containerSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - persistent: - existingClaim: "" - existingVolume: "" - size: 32Gi - persistentVolumeClaimRetentionPolicy: - enabled: true -data: - podSecurityContext: - fsGroup: 1000 - containerSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - persistent: - existingClaim: "" - existingVolume: "" - size: 32Gi - persistentVolumeClaimRetentionPolicy: - enabled: true -coordinating: - podSecurityContext: - fsGroup: 1000 - containerSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 -injest: - podSecurityContext: - fsGroup: 1000 - containerSecurityContext: - runAsUser: 1000 - runAsGroup: 1000 - service: - type: LoadBalancer - ports: - restAPI: 19200 - transport: 19300 - ingress: - diff --git a/infrastructures/elasticsearch/env/k3s-cluster/config.json b/infrastructures/elasticsearch/env/k3s-cluster/config.json deleted file mode 100644 index dc1ebfd..0000000 --- a/infrastructures/elasticsearch/env/k3s-cluster/config.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "appName": "XXX", - "userGivenName": "XXX", - "namespace": "XXX", - "destNamespace": "XXX", - "destServer": "https://kubernetes.default.svc", - "srcPath": "XXX/XXX/env/k3s-cluster", - "srcRepoURL": "https://github.com/3dwardch3ng/home-cluster-ops.git", - "srcTargetRevision": "", - "labels": null, - "annotations": null -} \ No newline at end of file diff --git a/infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml b/infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml deleted file mode 100644 index a227ac4..0000000 --- a/infrastructures/elasticsearch/env/k3s-cluster/kustomization.yaml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - ../../base \ No newline at end of file From 07d63f54ebbf7e12f8ad34fef09d6caf98baa53f Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Mon, 5 Aug 2024 00:11:35 +1000 Subject: [PATCH 3/3] add app jellyfin --- .../env/k3s-cluster/templates/elasticsearch.yaml | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100644 resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml diff --git a/resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml b/resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml deleted file mode 100644 index 5dccf33..0000000 --- a/resources/app-secrets/env/k3s-cluster/templates/elasticsearch.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Secret -metadata: - annotations: - argocd.argoproj.io/sync-options: Prune=false - sealedsecrets.bitnami.com/cluster-wide: "true" - sealedsecrets.bitnami.com/managed: "true" - creationTimestamp: null - name: elasticsearch-secrets - namespace: elasticsearch -type: Opaque -stringData: - elasticsearch-password: "" \ No newline at end of file