Flux can be upgrade from any
v2.x release to any other
v2.x release (the latest patch version).
For more details about supported versions and upgrades please see the Flux
Flux CLI upgrade
flux check --pre will tell you if a newer Flux version is available.
Verify that you are running the latest version with:
Flux controllers upgrade
The Flux controllers have the capability to upgrade themselves if they were installed using the bootstrap procedure.
Upgrade with Git
To upgrade the Flux controllers with Git, you can generate the new Kubernetes manifests using the Flux CLI and push them to the Git repository where bootstrap was run.
Note that this procedure does not require direct access to the Kubernetes cluster where Flux is installed.
Assuming you’ve bootstrapped with
--path=/clusters/my-cluster, you can update the manifests in Git with:
git clone https://<git-host>/<org>/<bootstrap-repo> cd <bootstrap-repo> flux install --export > ./clusters/my-cluster/flux-system/gotk-components.yaml git add -A && git commit -m "Update $(flux -v) on my-cluster" git push
If you’ve enabled extra Flux components at bootstrap, like those required for the image automation feature. Ensure to include these components when generating the components manifest:
flux install \ --components-extra image-reflector-controller,image-automation-controller \ --export > ./clusters/my-cluster/flux-system/gotk-components.yaml
Wait for Flux to detect the changes or, tell it to do the upgrade immediately with:
flux reconcile ks flux-system --with-source
Automated upgradesYou can automate the components manifest update with GitHub Actions and open a PR when there is a new Flux version available. For more details please see Flux GitHub Action docs.
Upgrade with Flux CLI
If you’ve used the bootstrap procedure to deploy Flux, then rerun the bootstrap command for each cluster using the same arguments as before:
flux bootstrap github \ --owner=my-github-username \ --repository=my-repository \ --branch=main \ --path=clusters/my-cluster \ --personal
The above command will clone the repository, it will update the components manifest in
<path>/flux-system/gotk-components.yaml and it will push the changes to the remote branch.
Verify that the controllers have been upgrade with:
Upgrade with Terraform
The upgrade performed with Terraform behaves in the same way as the upgrade with Flux CLI.
Upgrade with kubectl
If you’ve installed Flux directly on the cluster with kubectl, then rerun the command using the latest manifests from GitHub releases page:
kubectl apply --server-side -f https://github.com/fluxcd/flux2/releases/latest/download/install.yaml