This article explains how to change FluxCD (flux-system) sync path in Kustomization. This may be useful if you migrate your Gitlab Project or change layout in current repository.
Instructions
To change sync path for FluxCD, follow steps below:
Export proper PAT as environment variable:
export GITLAB_TOKEN=<pat>
Set your cluster as active context:
kubectx <context>
Prepare your repository (copy your manifests, add new layout, etc).
Modify field .spec.path in Kustomization resource (gotk-sync.yaml file) to new value.
Run uninstall command:
flux uninstall
Create flux-system namespace:
kubectl create ns flux-system
Apply FluxCD CRDs to omit errors with parsing your existing FluxCD manifests in repo before it will bootstrap again ( this command apply only most used CRDs - if you use more, add them):