Problem
All Kustomizations apply objects with the same field manager (kustomize-controller). When two Kustomizations render the same object, SSA sees a single manager, so there is no conflict. Each reconcile silently replaces the labels and annotations of the other Kustomization. There is no event, no log line, no failed condition.
We hit this in production. A namespace was rendered by two Kustomizations. Only one of them rendered kustomize.toolkit.fluxcd.io/prune: disabled. The other one removed that annotation on every reconcile. When the second Kustomization later stopped rendering the namespace, its garbage collection deleted it, because the prune check runs against
the live object and the annotation was absent at that moment. Whether the namespace survived depended only on which Kustomization applied last. Reproduced on flux v2.9.3.
Feature request
The controller already stamps owner labels (kustomize.toolkit.fluxcd.io/name and /namespace) on every apply. Before applying, it could check if the live object carries the owner labels of a different Kustomization and emit a warning event, e.g.:
Namespace/t-caas-controllers is also managed by Kustomization flux-system/prerequisites, fields will be overwritten
This makes silent co-ownership visible before it causes data loss. No change to apply or prune behavior is needed.
Workaround
Render the shared object with kustomize.toolkit.fluxcd.io/ssa: IfNotPresent in all but one Kustomization.
Problem
All Kustomizations apply objects with the same field manager (
kustomize-controller). When two Kustomizations render the same object, SSA sees a single manager, so there is no conflict. Each reconcile silently replaces the labels and annotations of the other Kustomization. There is no event, no log line, no failed condition.We hit this in production. A namespace was rendered by two Kustomizations. Only one of them rendered
kustomize.toolkit.fluxcd.io/prune: disabled. The other one removed that annotation on every reconcile. When the second Kustomization later stopped rendering the namespace, its garbage collection deleted it, because the prune check runs againstthe live object and the annotation was absent at that moment. Whether the namespace survived depended only on which Kustomization applied last. Reproduced on flux v2.9.3.
Feature request
The controller already stamps owner labels (
kustomize.toolkit.fluxcd.io/nameand/namespace) on every apply. Before applying, it could check if the live object carries the owner labels of a different Kustomization and emit a warning event, e.g.:This makes silent co-ownership visible before it causes data loss. No change to apply or prune behavior is needed.
Workaround
Render the shared object with
kustomize.toolkit.fluxcd.io/ssa: IfNotPresentin all but one Kustomization.