Files
auricom-home-cluster/kubernetes/apps/default/tandoor/app/helmrelease.yaml
2024-02-24 00:20:59 +01:00

187 lines
5.1 KiB
YAML

---
# yaml-language-server: $schema=https://kubernetes-schemas.pages.dev/helm.toolkit.fluxcd.io/helmrelease_v2beta2.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: &app tandoor
namespace: &ns default
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 2.6.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:
annotations:
reloader.stakater.com/auto: "true"
initContainers:
init-db:
order: 1
image:
repository: ghcr.io/onedr0p/postgres-init
tag: 16
envFrom: &envFrom
- secretRef:
name: tandoor-secret
migrations:
order: 2
image:
repository: vabene1111/recipes
tag: 1.5.13@sha256:6cc5700a3c1ff7fea7d4044876264bdd86d559dc9e350c48f3b2670c5a738e1a
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.13@sha256:6cc5700a3c1ff7fea7d4044876264bdd86d559dc9e350c48f3b2670c5a738e1a
envFrom: *envFrom
env:
DEBUG: "0"
ALLOWED_HOSTS: "*"
GUNICORN_MEDIA: "0"
TZ: ${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.4-alpine@sha256:87a01a6177ccfe0b883c67809ae0857b1f5589070bd4d07beade3562ad8e14ce
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
existingClaim: *app
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: Deployment
apiVersion: apps/v1
metadata:
name: tandoor
namespace: *ns
spec:
template:
spec:
initContainers:
- name: migrations
volumeMounts:
- name: django-js-reverse
mountPath: /opt/recipes/cookbook/static/django_js_reverse
- name: static
mountPath: /opt/recipes/staticfiles