Skip to content

Commit 91d038c

Browse files
authored
Merge pull request #2519 from fluxcd/fo-upgrade
Add operator upgrade procedure
2 parents 3cded16 + 2691a79 commit 91d038c

3 files changed

Lines changed: 78 additions & 8 deletions

File tree

content/en/flux/concepts.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ These are some core concepts in Flux.
99
## GitOps
1010

1111
GitOps is a way of managing your infrastructure and applications so that whole system
12-
is described declaratively and version controlled (most likely in a Git repository),
13-
and having an automated process that ensures that the deployed environment
14-
matches the state specified in a repository.
12+
is described declaratively and version controlled, and having an automated process
13+
that ensures that the deployed environment matches the state specified
14+
in one or more Git repositories.
1515

1616
For more information, take a look at the following resources:
1717

@@ -36,6 +36,7 @@ For more information, take a look at the following resources:
3636

3737
* [Flux OCI Artifacts documentation](/flux/cheatsheets/oci-artifacts/)
3838
* [OCI Bootstrap with Flux Operator](/flux/installation/#bootstrap-with-flux-operator)
39+
* [Gitless GitOps overview](https://fluxoperator.dev/gitless-gitops/)
3940

4041
## GitOps Toolkit (gotk)
4142

content/en/flux/installation/_index.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,11 @@ helm install flux-operator oci://ghcr.io/controlplaneio-fluxcd/charts/flux-opera
189189
```
190190

191191
The Flux Operator can be installed using Helm, Terraform, OpenTofu, OperatorHub, and other methods.
192-
For more information, refer to the [installation guide](https://fluxcd.control-plane.io/operator/install/).
192+
For more information, refer to the [installation guide](https://fluxoperator.dev/docs/guides/install/).
193193

194194
#### Configure the Flux Instance
195195

196-
Create a [FluxInstance](https://fluxcd.control-plane.io/operator/fluxinstance/) resource
196+
Create a [FluxInstance](https://fluxoperator.dev/docs/crd/fluxinstance/) resource
197197
named `flux` in the `flux-system` namespace to install the latest Flux stable version and configure the
198198
Flux controllers to sync the cluster state from an OCI artifact stored in GitHub Container Registry:
199199

@@ -205,14 +205,15 @@ metadata:
205205
namespace: flux-system
206206
annotations:
207207
fluxcd.controlplane.io/reconcileEvery: "1h"
208-
fluxcd.controlplane.io/reconcileTimeout: "5m"
208+
fluxcd.controlplane.io/reconcileTimeout: "10m"
209209
spec:
210210
distribution:
211211
version: "2.x"
212212
registry: "ghcr.io/fluxcd"
213213
artifact: "oci://ghcr.io/controlplaneio-fluxcd/flux-operator-manifests"
214214
components:
215215
- source-controller
216+
- source-watcher
216217
- kustomize-controller
217218
- helm-controller
218219
- notification-controller
@@ -248,14 +249,14 @@ spec:
248249
249250
> For more information on how to configure syncing from Git repositories,
250251
> container registries, and S3-compatible storage, refer to the
251-
> [cluster sync guide](https://fluxcd.control-plane.io/operator/flux-sync/).
252+
> [cluster sync guide](https://fluxoperator.dev/docs/instance/sync/).
252253
253254
The operator can automatically upgrade the Flux controllers and their CRDs when a new version is available.
254255
To restrict the upgrade to patch versions only, set the `distribution.version` field to e.g. `2.7.x`
255256
or to a fixed version e.g. `2.7.0` to disable automatic upgrades.
256257

257258
The Flux Operator can take over the management of existing installations from the Flux CLI or other tools.
258-
For a step-by-step guide, refer to the [Flux Operator migration guide](https://fluxcd.control-plane.io/operator/).
259+
For a step-by-step guide, refer to the [Flux Operator migration guide](https://fluxoperator.dev/docs/guides/migration/).
259260

260261
### Dev install
261262

content/en/flux/installation/upgrade.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,74 @@ and run `terraform apply`.
100100

101101
The upgrade performed with Terraform behaves in the same way as the [upgrade with Flux CLI](#upgrade-with-flux-cli).
102102

103+
### Upgrade with Flux Operator
104+
105+
If you've used the [Flux Operator](https://fluxoperator.dev/) to deploy Flux,
106+
first update the operator to the latest version, then update the `FluxInstance` resource
107+
to specify the latest Flux minor version.
108+
109+
The Flux Operator can be automatically updated by creating a [ResourceSet](https://fluxoperator.dev/docs/crd/resourceset/)
110+
that references the latest version of the operator's [Helm chart](https://fluxoperator.dev/docs/charts/flux-operator/):
111+
112+
```yaml
113+
apiVersion: fluxcd.controlplane.io/v1
114+
kind: ResourceSet
115+
metadata:
116+
name: flux-operator
117+
namespace: flux-system
118+
spec:
119+
inputs:
120+
- version: "*"
121+
interval: 12h
122+
resources:
123+
- apiVersion: source.toolkit.fluxcd.io/v1
124+
kind: OCIRepository
125+
metadata:
126+
name: << inputs.provider.name >>
127+
namespace: << inputs.provider.namespace >>
128+
spec:
129+
interval: << inputs.provider.interval >>
130+
url: oci://ghcr.io/controlplaneio-fluxcd/charts/flux-operator
131+
layerSelector:
132+
mediaType: "application/vnd.cncf.helm.chart.content.v1.tar+gzip"
133+
operation: copy
134+
ref:
135+
semver: << inputs.version | quote >>
136+
- apiVersion: helm.toolkit.fluxcd.io/v2
137+
kind: HelmRelease
138+
metadata:
139+
name: << inputs.provider.name >>
140+
namespace: << inputs.provider.namespace >>
141+
spec:
142+
interval: 1h
143+
releaseName: << inputs.provider.name >>
144+
serviceAccountName: << inputs.provider.name >>
145+
upgrade:
146+
strategy:
147+
name: RetryOnFailure
148+
chartRef:
149+
kind: OCIRepository
150+
name: << inputs.provider.name >>
151+
```
152+
153+
After the operator is up-to-date, if there is a new Flux minor version available,
154+
update the `FluxInstance` resource to specify the latest version:
155+
156+
```yaml
157+
apiVersion: fluxcd.controlplane.io/v1
158+
kind: FluxInstance
159+
metadata:
160+
name: flux
161+
namespace: flux-system
162+
spec:
163+
distribution:
164+
version: "2.8.x" # update to the latest minor version
165+
```
166+
167+
Note that both the `ResourceSet` and the `FluxInstance` resources should
168+
be placed in the `clusters/<cluster>/flux-system` directory of the Git repository
169+
used to bootstrap Flux with the operator.
170+
103171
### Upgrade with kubectl
104172

105173
If you've installed Flux directly on the cluster with kubectl,

0 commit comments

Comments
 (0)