fix(kanidm): replicate 1/2 from 0 only with automatic_refresh
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/kubeconform Pipeline was successful

kanidm-0 is the authoritative supplier; kanidm-1 and kanidm-2 pull
from kanidm-0 only. automatic_refresh = true on the kanidm-0 peer
entry for kanidm-1/2 so fresh nodes auto-sync domain UUID on restart.
This commit is contained in:
2026-05-31 00:18:28 +10:00
parent b6f8cb0633
commit 2234a42271
+10 -4
View File
@@ -44,13 +44,19 @@ spec:
- |
set -e
cp "/config-template/server-${POD_NAME##*-}.toml" /config/server.toml
for peer in kanidm-0 kanidm-1 kanidm-2; do
[ "${peer}" = "${POD_NAME}" ] && continue
if [ "${POD_NAME}" = "kanidm-0" ]; then
peers="kanidm-1 kanidm-2"
else
peers="kanidm-0"
fi
for peer in ${peers}; do
cert_file="/repl-certs/${peer}"
[ -s "${cert_file}" ] || continue
fqdn="${peer}.kanidm-headless.kanidm.svc.cluster.local"
printf '\n[replication."repl://%s:8444"]\ntype = "mutual-pull"\npartner_cert = "%s"\n' \
"${fqdn}" "$(cat ${cert_file})" >> /config/server.toml
refresh=""
[ "${peer}" = "kanidm-0" ] && refresh="\nautomatic_refresh = true"
printf '\n[replication."repl://%s:8444"]\ntype = "mutual-pull"\npartner_cert = "%s"%s\n' \
"${fqdn}" "$(cat ${cert_file})" "${refresh}" >> /config/server.toml
done
env:
- name: POD_NAME