homelab/k3s/mattermost/mattermost-db-init.yaml
Samantha Atkins 8cf5640757 Add Listmonk, Mattermost manifests; Ghost SMTP and device verification fix
- Listmonk: newsletter/mailing list manager with PostgreSQL backend,
  NodePort 32375, Postmark SMTP. Replaces Ghost's broken Mailgun-only
  newsletter sending via n8n automation pipeline.
- Mattermost: team messaging manifest, NodePort 32374, PostgreSQL backend.
- Ghost: added Postmark SMTP config for transactional email, disabled
  staffDeviceVerification on all three instances (Ghost has no TOTP,
  only email-based verification which requires working SMTP).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 18:07:35 -04:00

43 lines
1.2 KiB
YAML

# Mattermost DB Init Job
# Creates mattermost database and user in PostgreSQL.
# Run once before deploying Mattermost.
#
# Deploy:
# kubectl create secret generic mattermost-secret \
# --from-literal=db-password='<password>'
# kubectl apply -f mattermost-db-init.yaml
#
# Watch completion:
# kubectl get jobs -w
# kubectl logs job/mattermost-db-init
apiVersion: batch/v1
kind: Job
metadata:
name: mattermost-db-init
spec:
template:
spec:
restartPolicy: OnFailure
containers:
- name: mattermost-db-init
image: postgres:16
env:
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgres-secret
key: password
- name: MATTERMOST_DB_PASSWORD
valueFrom:
secretKeyRef:
name: mattermost-secret
key: db-password
command:
- /bin/sh
- -c
- |
psql -h postgres -U postgres <<EOF
CREATE USER mattermost_user WITH PASSWORD '${MATTERMOST_DB_PASSWORD}';
CREATE DATABASE mattermost_db OWNER mattermost_user;
EOF