Skip to content

Commit fed429b

Browse files
committed
docs: document experimental drift detection
Signed-off-by: Hidde Beydals <hello@hidde.co>
1 parent 0212c6d commit fed429b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

docs/spec/v2beta1/helmreleases.md

+36
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,42 @@ spec:
12701270
crds: CreateReplace
12711271
```
12721272

1273+
### Drift detection
1274+
1275+
**Note:** This feature is experimental and can be enabled by setting `--feature-gates=DetectDrift=true`.
1276+
1277+
When a HelmRelease is in-sync with the Helm release object in the storage, the controller will
1278+
compare the manifests from the Helm storage with the current state of the cluster using a
1279+
[server-side dry-run apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/).
1280+
If this comparison detects a drift (either due resource being created or modified during the
1281+
dry-run), the controller will perform an upgrade for the release, restoring the desired state.
1282+
1283+
### Excluding resources from drift detection
1284+
1285+
The drift detection feature can be configured to exclude certain resources from the comparison
1286+
by labeling or annotating them with `helm.toolkit.fluxcd.io/diff: disabled`. Using
1287+
[post-renderers](#post-renderers), this can be applied to any resource rendered by Helm.
1288+
1289+
```yaml
1290+
apiVersion: helm.toolkit.fluxcd.io/v2beta1
1291+
kind: HelmRelease
1292+
metadata:
1293+
name: app
1294+
namespace: webapp
1295+
spec:
1296+
postRenderers:
1297+
- kustomize:
1298+
patches:
1299+
- target:
1300+
version: v1
1301+
kind: Deployment
1302+
name: my-app
1303+
patch:
1304+
- op: add
1305+
path: /metadata/labels/helm.toolkit.fluxcd.io~1diff
1306+
value: disabled
1307+
```
1308+
12731309
## Status
12741310

12751311
When the controller completes a reconciliation, it reports the result in the status sub-resource.

0 commit comments

Comments
 (0)