Files
homelab-infra/archive/keycloak/keycloak-db-secret-sync.yaml
T
panxiao81 88a02ababa
lint / yaml (push) Has been cancelled
lint / ansible (push) Has been cancelled
lint / terraform (push) Has been cancelled
Establish clean homelab infrastructure baseline
Reorganize the brownfield repository, remove retired and generated artifacts, harden ignore rules, and record the GitOps/IaC redesign.
2026-09-09 16:47:20 +00:00

23 lines
755 B
YAML

apiVersion: v1
kind: ConfigMap
metadata:
name: keycloak-db-secret-sync
namespace: keycloak
data:
sync.sh: |
#!/bin/sh
set -eu
until kubectl -n shared-db get secret shared-postgresql-superuser-secret >/dev/null 2>&1; do
sleep 5
done
username=$(kubectl -n shared-db get secret shared-postgresql-superuser-secret -o jsonpath='{.data.username}' | base64 -d)
password=$(kubectl -n shared-db get secret shared-postgresql-superuser-secret -o jsonpath='{.data.password}' | base64 -d)
kubectl create secret generic keycloak-db-secret \
--namespace keycloak \
--from-literal=username="${username}" \
--from-literal=password="${password}" \
--dry-run=client -o yaml | kubectl -n keycloak apply -f -