From 1172aa3e968f92373d5d69a00087c0b6b29a615b Mon Sep 17 00:00:00 2001 From: unkin-agent Date: Sat, 5 Sep 2026 16:04:40 +1000 Subject: [PATCH] pdbmux: order backends new-first and drop primary/prefer (#452) ## Why pdbmux#9 drops primary/prefer and makes configured backend order the only tie-break, so the current `old`-first list would silently reverse which PuppetDB wins. ## How - Order `PDBMUX_BACKENDS` with `new=http://puppetdb.puppet.svc.cluster.local:8080` first and `old=http://puppetdbapi.service.consul:8080` second, URLs unchanged. - Drop `PDBMUX_PRIMARY` and `PDBMUX_PREFER`; both already resolve to `new`, on the deployed v0.1.0 image (estate defaults) and on pdbmux main (first-backend fallback), so the rendered behaviour is unchanged today. - Refresh the configmap and deployment comments to describe order-based precedence. Merge this before pdbmux#9. Reviewed-on: https://git.unkin.net/unkin/argocd-apps/pulls/452 Co-authored-by: unkin-agent Co-committed-by: unkin-agent --- apps/base/pdbmux/configmap.yaml | 13 +++++-------- apps/base/pdbmux/deployment.yaml | 3 +-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/apps/base/pdbmux/configmap.yaml b/apps/base/pdbmux/configmap.yaml index 1238425..bf2b427 100644 --- a/apps/base/pdbmux/configmap.yaml +++ b/apps/base/pdbmux/configmap.yaml @@ -6,14 +6,11 @@ metadata: namespace: pdbmux data: PDBMUX_LISTEN: ":8080" - # Two PuppetDB backends merged during the VM -> k8s migration: + # Two PuppetDB backends merged during the VM -> k8s migration, in precedence + # order (first wins ties / pass-through): + # new = the in-cluster k8s PuppetDB (plain HTTP on 8080; in-cluster address + # is preferred over the external gateway to avoid a hairpin) # old = legacy Consul-registered puppetdbapi (reachable from pods via the # Consul DNS the puppet workloads already use) - # new = the in-cluster k8s PuppetDB (plain HTTP on 8080; in-cluster address - # is preferred over the external gateway to avoid a hairpin). - PDBMUX_BACKENDS: "old=http://puppetdbapi.service.consul:8080,new=http://puppetdb.puppet.svc.cluster.local:8080" - # "new" (the k8s PuppetDB) is the primary for non-merged pass-through and the - # preferred backend for ties / static-merge fallback. - PDBMUX_PRIMARY: "new" - PDBMUX_PREFER: "new" + PDBMUX_BACKENDS: "new=http://puppetdb.puppet.svc.cluster.local:8080,old=http://puppetdbapi.service.consul:8080" PDBMUX_MERGE: "freshness" diff --git a/apps/base/pdbmux/deployment.yaml b/apps/base/pdbmux/deployment.yaml index ae1f23d..827251e 100644 --- a/apps/base/pdbmux/deployment.yaml +++ b/apps/base/pdbmux/deployment.yaml @@ -32,8 +32,7 @@ spec: name: http protocol: TCP envFrom: - # PDBMUX_LISTEN / PDBMUX_BACKENDS / PDBMUX_PRIMARY / PDBMUX_PREFER / - # PDBMUX_MERGE + # PDBMUX_LISTEN / PDBMUX_BACKENDS / PDBMUX_MERGE - configMapRef: name: pdbmux-env optional: false