47 lines
1.6 KiB
YAML
47 lines
1.6 KiB
YAML
---
|
|
# One-time job to install the listmonk database schema.
|
|
# WARNING: --install wipes and recreates tables. Only run on fresh DB.
|
|
# This job has a unique name with a timestamp suffix to prevent re-running.
|
|
# After first successful run it completes and TTL cleans it up.
|
|
# To re-install schema (destructive): delete this job and re-apply.
|
|
apiVersion: batch/v1
|
|
kind: Job
|
|
metadata:
|
|
name: listmonk-schema-init-v1
|
|
namespace: listmonk
|
|
annotations:
|
|
# Prevent Argo CD from pruning a completed job
|
|
argocd.argoproj.io/hook: Sync
|
|
argocd.argoproj.io/hook-delete-policy: HookSucceeded
|
|
spec:
|
|
ttlSecondsAfterFinished: 600
|
|
template:
|
|
spec:
|
|
restartPolicy: OnFailure
|
|
containers:
|
|
- name: listmonk-install
|
|
image: listmonk/listmonk:v4.1.0
|
|
command: ["/bin/sh", "-c", "cd /listmonk && ./listmonk --install --yes"]
|
|
env:
|
|
- name: LISTMONK_db__host
|
|
value: "postgres-postgresql.platform.svc.cluster.local"
|
|
- name: LISTMONK_db__port
|
|
value: "5432"
|
|
- name: LISTMONK_db__name
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: listmonk-secrets
|
|
key: db_name
|
|
- name: LISTMONK_db__user
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: listmonk-secrets
|
|
key: db_user
|
|
- name: LISTMONK_db__password
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: listmonk-secrets
|
|
key: db_password
|
|
- name: LISTMONK_db__ssl_mode
|
|
value: "disable"
|