I built a Kubernetes operator so you stop copy-pasting imagePullSecrets across namespaces (MIT, GitOps-safe)
retained text
Built this out of a recurring annoyance from client work: imagePullSecrets are namespaced, so private-registry creds get copy-pasted into every namespace, and rotating them means chasing down N copies. I know there are already tools that replicate secrets across namespaces (reflector, kubernetes-replicator, Kyverno generate). My problem with "replicate everywhere" is that it pushes credentials into namespaces that never pull private images — more blast radius than I want. So this works the other way around: You define the creds once as a cluster-scoped ClusterPullSecret, and a workload opts in with an annotation. The operator then creates the pull secret only in that workload's namespace, and removes it again (owner refs) when the annotation goes away. On-demand instead of gießkanne. The two parts I spent the most time on: \- The optional webhook mutates the Pod at admission, not the Deployment/CR. That was deliberate — I didn't want Argo CD/Flux to see a diff and start reconcile- looping. failurePolicy is Ignore, so the operator being down never blocks pod scheduling. \- It reads the source Secret uncached and can actively log into the registry to catch expired creds (surfaced via status + events + Prometheus). The uncached read also means it sits nicely behind External Secrets Operator: ESO syncs from Vault/cloud → Secret → ClusterPullSecret, so nothing sensitive lives in Git. Go + controller-runtime, Helm chart, unit/integration/e2e tests. MIT. https://github.com/itdpk-de/pullsecret-operator Would appreciate a sanity check — especially if I've missed a reason the reflector/replicator approach is actually better, or edge cases around the webhook.
document fetched 2026-10-22 00:40 · canonical https://reddit.com/r/kubernetes/comments/1xbjwur/i_built_a_kubernetes_operator_so_you_stop