Building and Starting Flux
This guide provides a step-by-step explanation of building and starting the Flux project.
Prerequisites
- Go: Ensure you have Go installed.
- Docker: Flux uses Docker for building images and running the environment tests.
Building Flux
Clone the repository:
git clone https://github.com/fluxcd/flux2.git cd flux2Build the project:
make buildThis will build the Flux binary and place it in the
_output/bindirectory.
Starting Flux
Install Flux (if needed):
make install-devThis command installs the latest development version of Flux to your system.
Running Tests
Run unit tests:
make testRun end-to-end tests:
make e2eThese tests require a Kubernetes cluster and Kind for setting up the environment.
Run environment tests:
make envtestThese tests are designed to validate Flux’s behavior in different environments.
Contributing to Flux
If you are interested in contributing to Flux, consider the following:
Code style:
make fmtCode linting:
make vetClean up dependencies:
make tidyInstall environment test dependencies:
make install-envtest
Running Flux with Kind
Setup Kind environment:
make setup-kindSetup Kind environment with image automation:
make setup-image-automationRun tests with Kind:
make test-with-kindClean up Kind environment:
make cleanup-kind
These steps will guide you through building, testing, and running Flux. For more information on contributing to Flux, please refer to the Flux documentation: https://fluxcd.io/docs/.