6.1 KiB
		
	
	
	
			
		
		
	
	Flux release procedure
The Flux Go modules and the GitOps Toolkit controllers are released by following the semver conventions.
Repositories subject to semver releases:
- fluxcd/pkg
- modules: apis/meta,runtime, various utilities
- dependencies: k8s.io/*,sigs.k8s.io/controller-runtime
 
- modules: 
- fluxcd/source-controller
- modules: api
- dependencies: github.com/fluxcd/pkg/*
 
- modules: 
- fluxcd/kustomize-controller
- modules: api
- dependencies: github.com/fluxcd/source-controller/api,github.com/fluxcd/pkg/*
 
- modules: 
- fluxcd/helm-controller
- modules: api
- dependencies: github.com/fluxcd/source-controller/api,github.com/fluxcd/pkg/*
 
- modules: 
- fluxcd/image-reflector-controller
- modules: api
- dependencies: github.com/fluxcd/pkg/*
 
- modules: 
- fluxcd/image-automation-controller
- modules: api
- dependencies: github.com/fluxcd/source-controller/api,github.com/fluxcd/image-reflector-controller/api,github.com/fluxcd/pkg/*
 
- modules: 
- fluxcd/notification-controller
- modules: api
- dependencies: github.com/fluxcd/pkg/*
 
- modules: 
- fluxcd/flux2
- modules: manifestgen
- dependencies: github.com/fluxcd/source-controller/api,github.com/fluxcd/kustomize-controller/api,github.com/fluxcd/helm-controller/api,github.com/fluxcd/image-reflector-controller/api,github.com/fluxcd/image-automation-controller/api,github.com/fluxcd/notification-controller/api,github.com/fluxcd/pkg/*
 
- modules: 
- fluxcd/terraform-provider-flux
- dependencies: github.com/fluxcd/flux2/pkg/manifestgen
 
- dependencies: 
Release procedure
Go packages
The Go packages in fluxcd/pkg are dedicated modules, each module has its own set of dependencies and release cycle.
Release procedure for a package:
- Checkout the mainbranch and pull changes from remote.
- Run make release-<package name> VER=<next semver>.
Controllers
A toolkit controller has a dedicated module for its API, the API module has its own set of dependencies.
Release procedure for a controller and its API:
- Checkout the mainbranch and pull changes from remote.
- Create a api/<next semver>tag and push it to remote.
- Create a new branch from maini.e.release-<next semver>. This will function as your release preparation branch.
- Update the github.com/fluxcd/<NAME>-controller/apiversion ingo.mod
- Add an entry to the CHANGELOG.mdfor the new release and change thenewTagvalue inconfig/manager/kustomization.yamlto that of the semver release you are going to make. Commit and push your changes.
- Create a PR for your release branch and get it merged into main.
- Create a <next semver>tag for the merge commit inmainand push it to remote.
- Confirm CI builds and releases the newly tagged version.
Flux
Release procedure for Flux:
- Checkout the mainbranch and pull changes from remote.
- Create a <next semver>tag formmainand push it to remote.
- Confirm CI builds and releases the newly tagged version.
Upgrade Kubernetes modules
Flux has the following Kubernetes dependencies:
- k8s.io/api
- k8s.io/apiextensions-apiserver
- k8s.io/apimachinery
- k8s.io/cli-runtime
- k8s.io/client-go
- sigs.k8s.io/controller-runtime
Note that all k8s.io/* packages must have the same version in go.mod e.g.:
	k8s.io/api v0.20.2
	k8s.io/apiextensions-apiserver v0.20.2
	k8s.io/apimachinery v0.20.2
	k8s.io/cli-runtime v0.20.2
	k8s.io/client-go v0.20.2
The specialised reconcilers depend on:
- kustomize-controller: sigs.k8s.io/kustomize/api
- image-automation-controller: sigs.k8s.io/kustomize/kyaml
- helm-controller: helm.sh/helm/v3
Note that the k8s.io/* version must be compatible with both kustomize/api and helm/v3.
If there is a breaking change in client-go we have to wait for Kustomize and Helm to upgrade first.
Upgrade procedure:
fluxcd/pkg:
- Update the k8s.io/*version inpkg/apis/meta/go.mod
- Release the apis/metapackage
- Update apis/metaversion inpkg/runtime/go.mod
- Update the k8s.io/*version inpkg/runtime/go.mod
- Update sigs.k8s.io/controller-runtimeversion inpkg/runtime/go.mod
- Release the runtimepackage
fluxcd/source-controller:
- Update the github.com/fluxcd/pkg/apis/metaversion insource-controller/api/go.modandsource-controller/go.mod
- Update the k8s.io/*version insource-controller/api/go.modandsource-controller/go.mod
- Update the sigs.k8s.io/controller-runtimeversion insource-controller/api/go.modandsource-controller/go.mod
- Update the github.com/fluxcd/pkg/runtimeversion insource-controller/go.mod
- Release the apipackage
fluxcd/<kustomize|helm|notification|image-automation>-controller:
- Update the github.com/fluxcd/source-controller/apiversion in<NAME>-controller/api/go.modand<NAME>-controller/go.mod
- Update the github.com/fluxcd/pkg/apis/metaversion in<NAME>-controller/api/go.modand<NAME>-controller/go.mod
- Update the k8s.io/*version in<NAME>-controller/api/go.modand<NAME>-controller/go.mod
- Update the github.com/fluxcd/pkg/runtimeversion in<NAME>-controller/go.mod
- Release the apipackage
fluxcd/flux2:
- Update the github.com/fluxcd/*-controller/apiversion influx2/go.mod(automated with GitHub Actions)
- Update the github.com/fluxcd/pkg/*version influx2/go.mod
- Update the k8s.io/*andgithub.com/fluxcd/pkg/runtimeversion influx2/go.mod
fluxcd/terraform-provider-flux:
- Update the github.com/fluxcd/flux2version interraform-provider-flux/go.mod(automated with GitHub Actions)