Apply config changes via rndc reconfig instead of restarting pods #26
Reference in New Issue
Block a user
Delete Branch "benvin/reconfig-without-restart"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Rendered config changes restart every BIND pod because the config hash sits on the pod template. Apply them in place with
rndc reconfiginstead.status.appliedConfig; reconfigure unrecorded pods onceConfigApplied:Propagating(incl. not-ready pods),ExecFailedorReconfigFailedwith named-checkconf output, backing off 2m on errorsdetail, _ := Exec(named-checkconf)drops the error; Exec returns only stdout and puts stderr in the error, and named-checkconf writes its file:line errors to stderr, so ConfigApplied carries no detail in production (the fake returns it on stdout, hiding this) → use the error text (stderr) when stdout is empty, and make fakeExec return it via the error.want, so it gets a needless rndc reconfig (every rolled pod, and every pod once on upgrade) → seed the entry without reconfig when the pod started after the config was last written, or otherwise skip pods whose named loaded the current file.cat(RBAC, exec failure) is treated as "waiting" and reported as Propagating forever, requeueing every 15s → on err (not hash mismatch) put the pod infailedwith the error.catExec error, or Reconcile persisting appliedConfig via Status().Update → add them.requeueShortoverwritesrequeueLongwhenever any pod is waiting or the StatefulSet is not Ready, so a pod with a failingrndc reconfig/exec is retried (reconfig + checkconf exec) every 15s for as long as a rollout or a stale pod exists → let failures keeprequeueLong(only set short whenrequeue == 0), and add a test with one failed pod plus one waiting pod assertingrequeueLong.entrypointScript()changes, so "roll only on entrypoint/pod-spec change" is only half tested → add a case that changes the entrypoint hash input (or asserts annotation ==sha256Hex(entrypointScript())) and expects the template to differ.