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 flux2
Build the project:
make build
This will build the Flux binary and place it in the
_output/bin
directory.
Starting Flux
Install Flux (if needed):
make install-dev
This command installs the latest development version of Flux to your system.
Running Tests
Run unit tests:
make test
Run end-to-end tests:
make e2e
These tests require a Kubernetes cluster and Kind for setting up the environment.
Run environment tests:
make envtest
These 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 fmt
Code linting:
make vet
Clean up dependencies:
make tidy
Install environment test dependencies:
make install-envtest
Running Flux with Kind
Setup Kind environment:
make setup-kind
Setup Kind environment with image automation:
make setup-image-automation
Run tests with Kind:
make test-with-kind
Clean 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/.