You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gitlab decided to switch to using Flux for GitOps stuff last year. I've put off making the change until now, but I'm struggling to get it to fit with my current setup.
But, I'm stuck at this error when I check the logs:
$ kubectl get kustomizations.kustomize.toolkit.fluxcd.io -n flux-system
NAME AGE READY STATUS
flux-system 3d4h False kustomize build failed: accumulating resources: accumulation err='merging resources from './awx/ns.yaml': may not add resource with an already registered id: Namespace.v1.[noGrp]/awx.[noNs]': must build at directory: '/tmp/kustomization-1427210208/manifests/development/awx/ns.yaml': file is not directory
$ kubectl logs pod/kustomize-controller-7b7b47f459-27lp7 -n flux-system
[…]
{"level":"error","ts":"2024-03-11T15:17:09.258Z","msg":"Reconciliation failed after 283.638596ms, next try in 10m0s","controller":"kustomization","controllerGroup":"kustomize.toolkit.fluxcd.io","controllerKind":"Kustomization","Kustomization":{"name":"flux-system","namespace":"flux-system"},"namespace":"flux-system","name":"flux-system","reconcileID":"94475020-0abc-43cb-b4f5-769df4bc0ce1","revision":"dev@sha1:7fc99637be1b6cb229365827c4644461e29a9adf","error":"kustomize build failed: accumulating resources: accumulation err='merging resources from './awx/ns.yaml': may not add resource with an already registered id: Namespace.v1.[noGrp]/awx.[noNs]': must build at directory: '/tmp/kustomization-1198011735/manifests/development/awx/ns.yaml': file is not directory"}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello there,
Gitlab decided to switch to using Flux for GitOps stuff last year. I've put off making the change until now, but I'm struggling to get it to fit with my current setup.
My Gitlab project with the manifest files looks a lot like this : https://mygitlab.mycompany.net/iac/kubernetes
So far, this is what my manifests repository looks like :
I followed the "migrate to flux" documentation : https://docs.gitlab.com/ee/user/clusters/agent/gitops/migrate_to_flux.html
I decided to start with my dev environment, so here's how I went about bootstrapping Flux:
After running that, I noticed a new "flux-system" directory popped up in my "manifests/development" path:
Here's what's inside the "gotk-sync.yaml" file:
Here's what's inside the "kustomization.yaml" file:
But, I'm stuck at this error when I check the logs:
$ kubectl get kustomizations.kustomize.toolkit.fluxcd.io -n flux-system
NAME AGE READY STATUS
flux-system 3d4h False kustomize build failed: accumulating resources: accumulation err='merging resources from './awx/ns.yaml': may not add resource with an already registered id: Namespace.v1.[noGrp]/awx.[noNs]': must build at directory: '/tmp/kustomization-1427210208/manifests/development/awx/ns.yaml': file is not directory
$ kubectl logs pod/kustomize-controller-7b7b47f459-27lp7 -n flux-system
[…]
{"level":"error","ts":"2024-03-11T15:17:09.258Z","msg":"Reconciliation failed after 283.638596ms, next try in 10m0s","controller":"kustomization","controllerGroup":"kustomize.toolkit.fluxcd.io","controllerKind":"Kustomization","Kustomization":{"name":"flux-system","namespace":"flux-system"},"namespace":"flux-system","name":"flux-system","reconcileID":"94475020-0abc-43cb-b4f5-769df4bc0ce1","revision":"dev@sha1:7fc99637be1b6cb229365827c4644461e29a9adf","error":"kustomize build failed: accumulating resources: accumulation err='merging resources from './awx/ns.yaml': may not add resource with an already registered id: Namespace.v1.[noGrp]/awx.[noNs]': must build at directory: '/tmp/kustomization-1198011735/manifests/development/awx/ns.yaml': file is not directory"}
What do you think I'm missing?
Thanks for your help
Beta Was this translation helpful? Give feedback.
All reactions