Files
auricom-home-cluster/kubernetes/apps/default/tandoor/app/helmrelease.yaml
2023-11-30 00:41:00 +01:00

188 lines
5.1 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/fluxcd-community/flux2-schemas/main/helmrelease-helm-v2beta1.json
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: &app tandoor
namespace: &ns default
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 2.3.0
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
maxHistory: 2
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
retries: 3
uninstall:
keepHistory: false
values:
defaultPodOptions:
enableServiceLinks: false
securityContext:
runAsUser: 568
runAsGroup: 568
controllers:
main:
type: statefulset
annotations:
reloader.stakater.com/auto: "true"
initContainers:
01-init-db:
image:
repository: ghcr.io/auricom/postgres-init
tag: 15.5@sha256:a337602f0dc11ee0e7f819ede78fa1a13e40a52adad737353efe10ce265a4b36
pullPolicy: IfNotPresent
envFrom: &envFrom
- secretRef:
name: tandoor-secret
02-init-migrate:
image:
repository: vabene1111/recipes
tag: 1.5.9
envFrom: *envFrom
command:
- sh
- -c
- |
set -e
source /opt/recipes/venv/bin/activate
echo "Updating database"
python3 /opt/recipes/manage.py migrate
python3 /opt/recipes/manage.py collectstatic_js_reverse
python3 /opt/recipes/manage.py collectstatic --noinput
containers:
main:
image:
repository: vabene1111/recipes
tag: 1.5.9
envFrom: *envFrom
env:
DEBUG: "0"
ALLOWED_HOSTS: "*"
GUNICORN_MEDIA: "0"
TIMEZONE: ${TIMEZONE}
TANDOOR_PORT: &port 8888
FRACTION_PREF_DEFAULT: "0"
COMMENT_PREF_DEFAULT: "1"
SHOPPING_MIN_AUTOSYNC_INTERVAL: "5"
command:
- /opt/recipes/venv/bin/gunicorn
- -b
- :8888
- --access-logfile
- "-"
- --error-logfile
- "-"
- --log-level
- INFO
- recipes.wsgi
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 512Mi
nginx:
image:
repository: nginxinc/nginx-unprivileged
tag: 1.25.3-alpine
service:
main:
ports:
http:
port: *port
nginx:
port: &port2 8080
ingress:
main:
enabled: true
className: "nginx"
annotations:
hajimari.io/icon: mdi:chef-hat
hosts:
- host: &host "{{ .Release.Name }}.${SECRET_CLUSTER_DOMAIN}"
paths:
- path: /
service:
name: main
port: http
- path: /media
service:
name: main
port: *port2
- path: /static
service:
name: main
port: *port2
tls:
- hosts:
- *host
persistence:
config:
type: persistentvolumeclaim
name: tandoor-configmap
existingClaim: tandoor-files
advancedMounts:
main:
main:
- path: /opt/recipes/mediafiles
nginx:
- path: /media
nginx-config:
type: configMap
name: tandoor-configmap
advancedMounts:
main:
nginx:
- path: /etc/nginx/nginx.conf
subPath: nginx-config
django-js-reverse:
type: emptyDir
advancedMounts:
main:
main:
- path: /opt/recipes/cookbook/static/django_js_reverse
static:
type: emptyDir
advancedMounts:
main:
main:
- path: /opt/recipes/staticfiles
nginx:
- path: /static
cache:
type: emptyDir
advancedMounts:
main:
nginx:
- path: /var/cache/nginx
postRenderers:
- kustomize:
patchesStrategicMerge:
- kind: StatefulSet
apiVersion: apps/v1
metadata:
name: tandoor
namespace: *ns
spec:
template:
spec:
initContainers:
- name: 02-init-migrate
volumeMounts:
- name: django-js-reverse
mountPath: /opt/recipes/cookbook/static/django_js_reverse
- name: static
mountPath: /opt/recipes/staticfiles