From 4ff4713cad20a9cf59e0832855212a6300c6749e Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Sun, 16 Apr 2023 19:00:46 +0000 Subject: [PATCH] video hosting --- .../apps}/videohosting/Chart.yaml | 0 .../templates/sts-linuxservices.yaml | 24 ++++++- .../videohosting/templates/sts-plex.yaml | 4 +- .../apps}/videohosting/values-dev.yaml | 0 .../apps}/videohosting/values-prod.yaml | 0 .../apps}/videohosting/values.yaml | 62 ++++--------------- k8s/argoapps/values-prod.yaml | 3 + k8s/argoapps/values.yaml | 55 +++++++++++++++- 8 files changed, 92 insertions(+), 56 deletions(-) rename {legacy/k8s/applications => k8s/apps}/videohosting/Chart.yaml (100%) rename {legacy/k8s/applications => k8s/apps}/videohosting/templates/sts-linuxservices.yaml (70%) rename {legacy/k8s/applications => k8s/apps}/videohosting/templates/sts-plex.yaml (95%) rename {legacy/k8s/applications => k8s/apps}/videohosting/values-dev.yaml (100%) rename {legacy/k8s/applications => k8s/apps}/videohosting/values-prod.yaml (100%) rename {legacy/k8s/applications => k8s/apps}/videohosting/values.yaml (53%) diff --git a/legacy/k8s/applications/videohosting/Chart.yaml b/k8s/apps/videohosting/Chart.yaml similarity index 100% rename from legacy/k8s/applications/videohosting/Chart.yaml rename to k8s/apps/videohosting/Chart.yaml diff --git a/legacy/k8s/applications/videohosting/templates/sts-linuxservices.yaml b/k8s/apps/videohosting/templates/sts-linuxservices.yaml similarity index 70% rename from legacy/k8s/applications/videohosting/templates/sts-linuxservices.yaml rename to k8s/apps/videohosting/templates/sts-linuxservices.yaml index a802d81..53b6b00 100644 --- a/legacy/k8s/applications/videohosting/templates/sts-linuxservices.yaml +++ b/k8s/apps/videohosting/templates/sts-linuxservices.yaml @@ -22,7 +22,18 @@ spec: app: {{ $k }} type: ClusterIP ports: - {{- $v.ports | toYaml | nindent 4 }} + {{ range $portName, $portValue := $v.ports.tcp }} + - port: {{ $portValue }} + targetPort: {{ $portValue }} + name: "{{ $portName }}" + protocol: TCP + {{ end }} + {{ range $portName, $portValue := $v.ports.udp }} + - port: {{ $portValue }} + targetPort: {{ $portValue }} + name: "{{ $portName }}" + protocol: UDP + {{ end }} --- apiVersion: apps/v1 kind: StatefulSet @@ -66,6 +77,15 @@ spec: - containerPort: {{ $port.targetPort }} protocol: {{ $port.protocol | default "TCP" }} {{ end }} + + {{ range $portName, $portValue := $v.ports.tcp }} + - containerPort: {{ $portValue }} + protocol: TCP + {{ end }} + {{ range $portName, $portValue := $v.ports.udp }} + - containerPort: {{ $portValue }} + protocol: UDP + {{ end }} volumeMounts: - name: config mountPath: /config @@ -75,6 +95,6 @@ spec: - name: torrents nfs: server: "{{ $.Values.global.nfs.server }}" - path: "{{ $.Values.nfs.shares.torrents }}" + path: "{{ $.Values.global.nfs.additionalShares.torrents }}" readOnly: false {{ end }} \ No newline at end of file diff --git a/legacy/k8s/applications/videohosting/templates/sts-plex.yaml b/k8s/apps/videohosting/templates/sts-plex.yaml similarity index 95% rename from legacy/k8s/applications/videohosting/templates/sts-plex.yaml rename to k8s/apps/videohosting/templates/sts-plex.yaml index e28a85c..03be1e5 100644 --- a/legacy/k8s/applications/videohosting/templates/sts-plex.yaml +++ b/k8s/apps/videohosting/templates/sts-plex.yaml @@ -149,10 +149,10 @@ spec: - name: torrents nfs: server: "{{ $.Values.global.nfs.server }}" - path: "{{ $.Values.nfs.shares.torrents }}" + path: "{{ $.Values.global.nfs.additionalShares.torrents }}" readOnly: true - name: family-videos nfs: server: "{{ $.Values.global.nfs.server }}" - path: "{{ .Values.nfs.shares.familyvideos }}" + path: "{{ .Values.global.nfs.additionalShares.familyvideos }}" readOnly: true \ No newline at end of file diff --git a/legacy/k8s/applications/videohosting/values-dev.yaml b/k8s/apps/videohosting/values-dev.yaml similarity index 100% rename from legacy/k8s/applications/videohosting/values-dev.yaml rename to k8s/apps/videohosting/values-dev.yaml diff --git a/legacy/k8s/applications/videohosting/values-prod.yaml b/k8s/apps/videohosting/values-prod.yaml similarity index 100% rename from legacy/k8s/applications/videohosting/values-prod.yaml rename to k8s/apps/videohosting/values-prod.yaml diff --git a/legacy/k8s/applications/videohosting/values.yaml b/k8s/apps/videohosting/values.yaml similarity index 53% rename from legacy/k8s/applications/videohosting/values.yaml rename to k8s/apps/videohosting/values.yaml index f77cadd..2290d12 100644 --- a/legacy/k8s/applications/videohosting/values.yaml +++ b/k8s/apps/videohosting/values.yaml @@ -1,7 +1,3 @@ -nfs: - shares: - torrents: "/mnt/EightTerra/DownloadedTorrents" - familyvideos: "/mnt/EightTerra/FamilyStorage/Video" plex: repo: "plexinc/pms-docker" tag: "1.31.3.6868-28fc46b27" @@ -11,16 +7,11 @@ linuxserverServices: repo: lscr.io/linuxserver/transmission tag: "4.0.2" ports: - - port: 9091 - targetPort: 9091 - name: "web" - - port: 51413 - targetPort: 51413 - name: "51413" - - port: 51413 - targetPort: 51413 - protocol: UDP - name: "51413-udp" + tcp: + web: 9091 + 51413: 51413 + udp: + 51413: 51413 podResources: limits: cpu: 1 @@ -49,9 +40,8 @@ linuxserverServices: limits: storage: 100Gi ports: - - port: 8989 - targetPort: 8989 - name: "web" + tcp: + web: 8989 radarr: repo: lscr.io/linuxserver/radarr tag: "4.3.2" @@ -68,9 +58,8 @@ linuxserverServices: limits: storage: 100Gi ports: - - port: 7878 - targetPort: 7878 - name: "web" + tcp: + web: 7878 jackett: repo: lscr.io/linuxserver/jackett tag: "0.20.3772" @@ -89,34 +78,5 @@ linuxserverServices: limits: storage: 100Gi ports: - - port: 9117 - targetPort: 9117 - name: "web" - # qbittorrent: - # repo: lscr.io/linuxserver/qbittorrent - # tag: "4.5.2" - # envVars: - # AUTO_UPDATE: "true" - # podResources: - # limits: - # cpu: 2 - # memory: "2Gi" - # requests: - # cpu: 1 - # memory: "500M" - # configVolumesResources: - # requests: - # storage: 10Gi - # limits: - # storage: 100Gi - # ports: - # - port: 8080 - # targetPort: 8080 - # name: "web" - # - port: 6881 - # targetPort: 6881 - # name: "6881" - # - port: 6881 - # targetPort: 6881 - # protocol: UDP - # name: "6881-udp" + tcp: + web: 9117 diff --git a/k8s/argoapps/values-prod.yaml b/k8s/argoapps/values-prod.yaml index 56aec65..9e553e7 100644 --- a/k8s/argoapps/values-prod.yaml +++ b/k8s/argoapps/values-prod.yaml @@ -9,3 +9,6 @@ global: nfs: server: "192.168.8.107" share: "/mnt/EightTerra/k3s-cluster" + additionalShares: + torrents: "/mnt/EightTerra/DownloadedTorrents" + familyvideos: "/mnt/EightTerra/FamilyStorage/Video" diff --git a/k8s/argoapps/values.yaml b/k8s/argoapps/values.yaml index 8afce19..d365286 100644 --- a/k8s/argoapps/values.yaml +++ b/k8s/argoapps/values.yaml @@ -15,8 +15,36 @@ global: storageClass: "nfs-generic" server: "changme" share: "changeme" + additionalShares: + torrents: "changeme" + familyvideos: "changeme" + +videohosting: + linuxserverServices: + transmission: + ports: + tcp: + web: 9091 + 51413: 51413 + udp: + 51413: 51413 + sonarr: + ports: + tcp: + web: 8989 + radarr: + ports: + tcp: + web: 7878 + jackett: + ports: + tcp: + web: 9117 apps: + videohosting: + values: |- + {{ .Values.videohosting | toYaml }} nextcloud: values: |- nextcloud: @@ -30,7 +58,32 @@ apps: nextcloudData: storageClass: {{ .Values.global.nfs.storageClass }} existingClaim: {{ .Values.storage.nextcloudData.name }} - ingresses: {} + ingresses: + values: |- + services: + - prefix: "argocd.core" + service: "argocd-server" + namespace: "argocd" + - prefix: "demo" + service: "dummy-app" + namespace: "apps-ingresses" + - prefix: "nextcloud" + service: "nextcloud" + namespace: "apps-nextcloud" + port: 8080 + middleware: "apps-nextcloud-nextcloud" + {{ range $name, $data := .Values.videohosting.linuxserverServices }} + - prefix: "{{ $name }}.vh" + service: {{ $name }} + namespace: "apps-videohosting" + port: {{ $data.tcp.web }} + middleware: "ingresses-chain-authelia" + {{ end }} + - prefix: "plex" + service: "plex" + namespace: "apps-videohosting" + port: 32400 + db-users: namespace: chart-database values: |-