Note: Please take a look at https://fluxcd.io/contributing/flux/ to find out about how to contribute to Flux and how to interact with the Flux Development team.
There are a number of dependencies required to be able to run the controller and its test suite locally:
In addition to the above, the following dependencies are also used by some of the make targets:
controller-gen(v0.19.0)gen-crd-api-reference-docs(v0.3.0)setup-envtest(latest)
If any of the above dependencies are not present on your system, the first invocation of a make target that requires them will install them.
Prerequisites:
- Go >= 1.25
You can run the test suite by simply doing
make testInstall the controller's CRDs on your test cluster:
make installNote that helm-controller depends on source-controller to acquire the Helm charts from Helm repositories. If source-controller is not running on your test cluster, you need to tell helm-controller where to find it.
Port forward to source-controller artifacts server:
kubectl -n flux-system port-forward svc/source-controller 8080:80Export the local address as SOURCE_CONTROLLER_LOCALHOST:
export SOURCE_CONTROLLER_LOCALHOST=localhost:8080Alternatively, if your test cluster is already running source-controller and helm-controller, you need to scale down the in-cluster helm-controller:
kubectl -n flux-system scale deployment/helm-controller --replicas=0
Run the controller locally:
make runSet the name of the container image to be created from the source code. This will be used when building, pushing and referring to the image on YAML files:
export IMG=registry-path/helm-controller:latestBuild the container image, tagging it as $(IMG):
make docker-buildPush the image into the repository:
make docker-pushNote: make docker-build will build an image for the amd64 architecture.
Deploy helm-controller into the cluster that is configured in the local kubeconfig file (i.e. ~/.kube/config):
make deploy