Files
auricom-home-cluster/kubernetes/apps/default/lychee/app/sync/helmrelease.yaml
2024-04-13 14:57:30 +02:00

66 lines
1.8 KiB
YAML

---
# yaml-language-server: $schema=https://raw.githubusercontent.com/bjw-s/helm-charts/main/charts/other/app-template/schemas/helmrelease-helm-v2beta2.schema.json
apiVersion: helm.toolkit.fluxcd.io/v2beta2
kind: HelmRelease
metadata:
name: &app lychee-sync
namespace: default
spec:
interval: 30m
chart:
spec:
chart: app-template
version: 3.1.0
sourceRef:
kind: HelmRepository
name: bjw-s
namespace: flux-system
maxHistory: 2
install:
createNamespace: true
remediation:
retries: 3
upgrade:
cleanupOnFail: true
remediation:
strategy: rollback
retries: 3
uninstall:
keepHistory: false
values:
controllers:
main:
type: cronjob
cronjob:
concurrencyPolicy: Forbid
schedule: 0 0 * * 1 # At 00:00 on Monday
containers:
main:
image:
repository: ghcr.io/auricom/kubectl
tag: 1.29.2@sha256:693ced2697bb7c7349419d4035a62bd474fc41710675b344f71773d8a687dfc3
command:
- /bin/bash
- -c
- |
#!/bin/bash
set -o errexit
set -o nounset
result=$(kubectl get pod --selector app.kubernetes.io/name=lychee --output custom-columns=:metadata.name --namespace default)
LYCHEE_POD=$(echo $result | awk '{ print $NF }')
if [[ $LYCHEE_POD == *"lychee"* ]]; then
kubectl exec --stdin --container main $LYCHEE_POD -- php artisan lychee:sync /mnt/storage/photo/Gallery/ --skip_duplicates=1
else
echo "lychee deployment not found"
exit 1
fi
service:
app:
controller: *app
enabled: false
serviceAccount:
create: false
name: jobs