Flux Upgrade Procedure
The Flux Operator APIs are stable and backward compatible, so it is safe to upgrade the operator to the latest version at any time.
The Flux distribution has a release cadence of approximately one minor release every three months, with patch releases in between. On production clusters, it is recommended to configure Flux Operator to automatically upgrade Flux to the latest patch release in the specified minor version range.
Upgrading the Flux Operator
Depending on the installation method, upgrading the Flux Operator should be done in an automated manner.
If you installed the operator with the Helm CLI, you can configure automated
upgrades with a Flux HelmRelease
as follows:
apiVersion: fluxcd.controlplane.io/v1
kind: ResourceSet
metadata:
name: flux-operator
namespace: flux-system
spec:
inputs:
- interval: "1h" # check for updates every hour
version: "*" # upgrade to latest stable version
resources:
- apiVersion: source.toolkit.fluxcd.io/v1
kind: OCIRepository
metadata:
name: << inputs.provider.name >>
namespace: << inputs.provider.namespace >>
spec:
interval: << inputs.interval | quote >>
url: oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator
layerSelector:
mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
operation: copy
ref:
semver: << inputs.version | quote >>
- apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: << inputs.provider.name >>
namespace: << inputs.provider.namespace >>
spec:
interval: 12h
releaseName: << inputs.provider.name >>
serviceAccountName: << inputs.provider.name >>
chartRef:
kind: OCIRepository
name: << inputs.provider.name >>
values:
reporting:
interval: 30s
If you installed the operator with Terraform/OpenTofu, update the version
argument in
the helm_release
resource and apply the changes with terraform apply
.
If you installed the operator from OperatorHub, you can configure automatic upgrades
by setting Approval
to Automatic
in OpenShift.
Upgrading the Flux Distribution
It is recommended to set the Flux distribution version in the FluxInstance
manifest
to a specific minor version, such as 2.6.x
, to have more control over the upgrade process.
Migrate to Flux stable APIs in Git
Starting with Flux v2.7, the deprecated beta APIs have reached their end of life and are no longer supported.
Before upgrading to Flux v2.7 or later, make sure to migrate all your manifests
to the Flux v2.6 stable APIs in your Git repositories by using the flux migrate -f
command:
git clone <your-git-repo>
cd <your-git-repo>
flux migrate -v 2.6 -f .
git commit -am "Migrate to Flux v2.6 stable APIs"
git push
Update the Flux Instance
After migrating your resources in all Git repositories,
update the FluxInstance
manifest to the desired version:
apiVersion: fluxcd.controlplane.io/v1
kind: FluxInstance
metadata:
name: flux
namespace: flux-system
spec:
distribution:
version: "2.7.x"
The operator will automatically upgrade the Flux components and migrate the Flux APIs to their latest API versions in-cluster.
Kubernetes Version Compatibility
The CNCF Flux distribution supports the 3 most recent minor versions of Kubernetes. The list of supported versions is updated with every Flux minor release and can be found in the release notes.
The Enterprise distribution of Flux supports the 6 most recent minor versions of Kubernetes, including Long-Term Support (LTS) versions offered by cloud providers, and the 3 most recent OpenShift versions. The list of supported Kubernetes and OpenShift versions is updated with every Flux Enterprise minor release and can be found in the release notes.