refactor(charts): BREAKING CHANGE (#2836)

* Update Apps with new Common version

* Patch with the secret fixes from common

* fix amd
This commit is contained in:
Kjeld Schouten-Lebbing
2022-06-07 19:41:19 +02:00
committed by GitHub
parent e4911cf0b1
commit 5529c2a3af
1546 changed files with 10467 additions and 3650 deletions
+2 -2
View File
@@ -3,7 +3,7 @@ appVersion: "2022w6"
dependencies:
- name: common
repository: https://library-charts.truecharts.org
version: 9.3.24
version: 10.0.8
- condition: postgresql.enabled
name: postgresql
repository: https://charts.truecharts.org/
@@ -27,7 +27,7 @@ name: librephotos
sources:
- https://github.com/LibrePhotos/librephotos
- https://hub.docker.com/r/reallibrephotos/librephotos
version: 2.0.23
version: 3.0.0
annotations:
truecharts.org/catagories: |
- media
@@ -0,0 +1,21 @@
#!/usr/bin/python3
import json
import os
import sys
def migrate(values):
values.update({
**({'secretEnv': values['secret']} if values.get('secret') else {}),
**({'secret': {}} if values.get('secret'))
})
return values
if __name__ == '__main__':
if len(sys.argv) != 2:
exit(1)
if os.path.exists(sys.argv[1]):
with open(sys.argv[1], 'r') as f:
print(json.dumps(migrate(json.loads(f.read()))))
+1 -1
View File
@@ -109,7 +109,7 @@ questions:
type: boolean
default: false
- variable: secret
- variable: secretEnv
group: "Container Configuration"
label: "Secret Image Environment"
schema:
@@ -1,19 +1,5 @@
{{- include "common.setup" . }}
{{/* Append the general configMap volume to the volumes */}}
{{- define "librephotos.harcodedValues" -}}
persistence:
librephotos-config:
enabled: "true"
mountPath: "/etc/nginx/nginx.conf"
subPath: "nginx-config"
type: "custom"
volumeSpec:
configMap:
name: {{ printf "%v-config" (include "common.names.fullname" .) }}
{{- end -}}
{{- $_ := mergeOverwrite .Values (include "librephotos.harcodedValues" . | fromYaml) -}}
{{- include "tc.common.loader.init" . }}
{{- include "librephotos.secrets" . }}
{{ include "common.postSetup" . }}
{{ include "tc.common.loader.apply" . }}
@@ -1,63 +0,0 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-config
labels:
{{- include "common.labels" . | nindent 4 }}
data:
nginx-config: |-
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log debug;
events {
worker_connections 1024;
}
http {
server {
listen 80;
location / {
# React routes are entirely on the App side in the web broswer
# Always proxy to root with the same page request when nginx 404s
error_page 404 /;
proxy_intercept_errors on;
proxy_set_header Host $host;
proxy_pass http://localhost:3000/;
}
location ~ ^/(api|media)/ {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host localhost;
include uwsgi_params;
proxy_pass http://localhost:8001;
}
# Django media
location /protected_media {
internal;
alias /protected_media/;
}
location /static/drf-yasg {
proxy_pass http://localhost:8001;
}
location /data {
internal;
alias /data/;
}
# Original Photos
location /original {
internal;
alias /data/;
}
# Nextcloud Original Photos
location /nextcloud_original {
internal;
alias /data/nextcloud_media/;
}
}
}
+69 -3
View File
@@ -19,12 +19,72 @@ podSecurityContext:
runAsUser: 0
runAsGroup: 0
secret:
secretEnv:
ADMIN_EMAIL: "admin@mydomain.com"
ADMIN_USERNAME: "admin"
ADMIN_PASSWORD: "password"
MAPBOX_API_KEY: ""
configmap:
config:
enabled: true
data:
nginx-config: |-
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log debug;
events {
worker_connections 1024;
}
http {
server {
listen 80;
location / {
# React routes are entirely on the App side in the web broswer
# Always proxy to root with the same page request when nginx 404s
error_page 404 /;
proxy_intercept_errors on;
proxy_set_header Host $host;
proxy_pass http://localhost:3000/;
}
location ~ ^/(api|media)/ {
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host localhost;
include uwsgi_params;
proxy_pass http://localhost:8001;
}
# Django media
location /protected_media {
internal;
alias /protected_media/;
}
location /static/drf-yasg {
proxy_pass http://localhost:8001;
}
location /data {
internal;
alias /data/;
}
# Original Photos
location /original {
internal;
alias /data/;
}
# Nextcloud Original Photos
location /nextcloud_original {
internal;
alias /data/nextcloud_media/;
}
}
}
env:
BACKEND_HOST: "localhost"
DB_BACKEND: "postgresql"
@@ -36,8 +96,6 @@ env:
SKIP_PATTERNS: ""
HEAVYWEIGHT_PROCESS: 1
DEBUG: 0
envValueFrom:
DB_PASS:
secretKeyRef:
name: dbcreds
@@ -118,3 +176,11 @@ persistence:
cache:
enabled: true
mountPath: "/root/.cache"
librephotos-config:
enabled: "true"
mountPath: "/etc/nginx/nginx.conf"
subPath: "nginx-config"
type: "custom"
volumeSpec:
configMap:
name: '{{ printf "%v-config" (include "tc.common.names.fullname" .) }}'