diff --git a/charts/incubator/invidious/Chart.yaml b/charts/incubator/invidious/Chart.yaml index 2b5780b3e7a..59d9c8b6962 100644 --- a/charts/incubator/invidious/Chart.yaml +++ b/charts/incubator/invidious/Chart.yaml @@ -3,11 +3,7 @@ appVersion: "latest" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 11.1.2 - - condition: postgresql.enabled - name: postgresql - repository: https://deps.truecharts.org/ - version: 11.0.31 + version: 12.10.4 description: Open source alternative front-end to YouTube. home: https://truecharts.org/charts/incubator/invidious icon: https://truecharts.org/img/hotlink-ok/chart-icons/invidious.png @@ -25,7 +21,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/invidious - https://github.com/iv-org/invidious - https://docs.invidious.io/installation/#docker -version: 3.0.0 +version: 4.0.0 annotations: truecharts.org/catagories: | - media diff --git a/charts/incubator/invidious/templates/_config.tpl b/charts/incubator/invidious/templates/_config.tpl index f93f15a0249..77632e1fe14 100644 --- a/charts/incubator/invidious/templates/_config.tpl +++ b/charts/incubator/invidious/templates/_config.tpl @@ -1,7 +1,6 @@ {{/* Define the configmap */}} {{- define "invidious.config" -}} -{{- $configName := printf "%s-invidious-config" (include "tc.common.names.fullname" .) }} {{- $vNet := .Values.invidious.network }} {{- $vLog := .Values.invidious.logging }} {{- $vFeat := .Values.invidious.features }} @@ -16,22 +15,16 @@ {{- $vVidPlay := .Values.invidious.default_user_preferences.video_playback_settings }} {{- $vSubFeed := .Values.invidious.default_user_preferences.subscription_feed }} {{- $vUserMisc := .Values.invidious.default_user_preferences.miscellaneous }} ---- -apiVersion: v1 -kind: Secret -metadata: - name: {{ $configName }} - labels: - {{- include "tc.common.labels" . | nindent 4 }} -stringData: +enabled: true +data: INVIDIOUS_CONFIG: | # Database check_tables: true db: - user: {{ .Values.postgresql.postgresqlUsername }} - dbname: {{ .Values.postgresql.postgresqlDatabase }} - password: {{ .Values.postgresql.postgresqlPassword | trimAll "\"" }} - host: {{ .Values.postgresql.url.plain | trimAll "\"" }} + user: {{ .Values.cnpg.main.user }} + dbname: {{ .Values.cnpg.main.database }} + password: {{ .Values.cnpg.main.creds.password }} + host: {{ .Values.cnpg.main.creds.host }} port: 5432 # Network diff --git a/charts/incubator/invidious/templates/_dbseed.tpl b/charts/incubator/invidious/templates/_dbseed.tpl deleted file mode 100644 index 8c96bc4238c..00000000000 --- a/charts/incubator/invidious/templates/_dbseed.tpl +++ /dev/null @@ -1,42 +0,0 @@ -{{- define "invidious.dbseed" -}} -image: "{{ .Values.ubuntuImage.repository }}:{{ .Values.ubuntuImage.tag }}" -env: - - name: POSTGRES_DB - value: {{ .Values.postgresql.postgresqlDatabase }} - - name: POSTGRES_USER - value: {{ .Values.postgresql.postgresqlUsername }} -{{/* PG* variables are for the psql client */}} - - name: PGPORT - value: "5432" - - name: PGHOST - valueFrom: - secretKeyRef: - name: dbcreds - key: plainhost - - name: PGPASSWORD - valueFrom: - secretKeyRef: - name: dbcreds - key: postgresql-password -command: - - /bin/sh - - -c - - | - echo "Starting DB Seed..." - mkdir -p invidious && cd invidious - - echo "Fetching seed files..." - git init && \ - git remote add invidious https://github.com/iv-org/invidious.git && \ - git fetch invidious && \ - # Fetch config and docker dirs - git checkout invidious/master -- docker config - - # Move config into docker dir - echo "Preparing directory structure..." - mv -fv config docker - - echo "Performing the seed..." - cd docker - ./init-invidious-db.sh -{{- end -}} diff --git a/charts/incubator/invidious/templates/common.yaml b/charts/incubator/invidious/templates/common.yaml index 83290053c0d..572b59322e4 100644 --- a/charts/incubator/invidious/templates/common.yaml +++ b/charts/incubator/invidious/templates/common.yaml @@ -1,9 +1,11 @@ {{/* Make sure all variables are set properly */}} -{{- include "tc.common.loader.init" . }} +{{- include "tc.v1.common.loader.init" . }} -{{- include "invidious.config" . }} - -{{- $_ := set .Values.installContainers "dbseed" (include "invidious.dbseed" . | fromYaml) -}} +{{/* Render configmap for invidious */}} +{{- $configmapFile := include "invidious.config" . | fromYaml -}} +{{- if $configmapFile -}} + {{- $_ := set .Values.configmap "invidious-config" $configmapFile -}} +{{- end -}} {{/* Render the templates */}} -{{ include "tc.common.loader.apply" . }} +{{ include "tc.v1.common.loader.apply" . }} diff --git a/charts/incubator/invidious/values.yaml b/charts/incubator/invidious/values.yaml index af330208516..531f4d12a33 100644 --- a/charts/incubator/invidious/values.yaml +++ b/charts/incubator/invidious/values.yaml @@ -3,13 +3,72 @@ image: pullPolicy: IfNotPresent tag: latest@sha256:3bb9e44e7d69baf91728c0a88115ef5fdb3adc91432b851e11e4d0e78bbe6e7a -podSecurityContext: - runAsGroup: 0 - runAsUser: 0 - securityContext: - readOnlyRootFilesystem: false - runAsNonRoot: false + container: + readOnlyRootFilesystem: false + runAsNonRoot: false + runAsGroup: 0 + runAsUser: 0 + +service: + main: + ports: + main: + port: 10594 + protocol: http + +workload: + main: + podSpec: + initContainers: + dbseed: + type: install + enabled: true + imageSelector: postgresClientImage + env: + POSTGRES_DB: + secretKeyRef: + name: cnpg-main-urls + key: std + POSTGRES_USER: "{{ .Values.cnpg.main.user }}" + # PG* variables are for the psql client + PGPORT: "5432" + PGPASSWORD: + secretKeyRef: + name: cnpg-main-user + key: password + command: ["sh", "-c"] + args: + - | + echo "Starting DB Seed..." + mkdir -p invidious && cd invidious + + echo "Fetching seed files..." + git init && \ + git remote add invidious https://github.com/iv-org/invidious.git && \ + git fetch invidious && \ + # Fetch config and docker dirs + git checkout invidious/master -- docker config + + # Move config into docker dir + echo "Preparing directory structure..." + mv -fv config docker + + echo "Performing the seed..." + cd docker + ./init-invidious-db.sh + containers: + main: + probes: + liveness: + type: http + readiness: + type: http + startup: + type: http + envFrom: + - configMapRef: + name: invidious-config invidious: network: @@ -105,32 +164,14 @@ invidious: automatic_instance_redirect: false extend_desc: false -envFrom: - - secretRef: - name: '{{ include "tc.common.names.fullname" . }}-invidious-config' - -service: +cnpg: main: - ports: - main: - port: 10594 - protocol: HTTP - -probes: - liveness: - type: HTTP - readiness: - type: HTTP - startup: - type: HTTP - -postgresql: - enabled: true - existingSecret: dbcreds - postgresqlDatabase: invidious - # DB User cannot be changed - # hardcoded from upstream - postgresqlUsername: kemal + enabled: true + database: invidious + # DB User cannot be changed + # hardcoded from upstream + username: kemal portal: - enabled: true + open: + enabled: true