Trigger a Flux reconciliation from the cluster UI
Release notes
While FluxCD triggers a reconciliation following the configured interval, there are situations where you might want to get an immediate reconciliation. There are multiple options for this, like triggering the reconciliation from CI or the command line. GitLab now allows you to trigger a reconciliation without any additional setup from the GitLab UI.
To trigger a reconciliation, you should navigate to the Kubernetes dashboard configured for the specific Flux resource, and open the Flux details by clicking on the Flux status badge.
Problem to solve
As an application operator, I want to trigger a reconciliation of Flux resources, so I don't have to wait for the reconciliation loop to start.
Proposal
Flux uses the reconcile.fluxcd.io/requestedAt
annotation to trigger a reconciliation. Whenever the value differs from the value saved in the resources state
, Flux reconciles.
For example, the Flux documentation describes to manually trigger a reconciliation with
kubectl annotate --field-manager=flux-client-side-apply --overwrite gitrepository/<repository-name> reconcile.fluxcd.io/requestedAt="$(date +%s)"
Intended users
Feature Usage Metrics
- MAU of button clicks
Impletetion guide
-
Add a "refresh" button into the details drawer, near the status field.
-
Create a client Graphql mutation using PATCH request to the
/-/k8s-proxy/apis/kustomize.toolkit.fluxcd.io/v1/namespaces/<namespace>/kustomizations/<name>
or/-/k8s-proxy/apis/helm.toolkit.fluxcd.io/v2beta1/namespaces/<namespace>/helmreleases/<name>
. -
Include body:
"body": `[{ "op": "replace", "path": "/metadata/annotations/reconcile.fluxcd.io~1requestedAt", "value": ${new Date()} }]`
-
Set
"Content-Type": "application/json-patch+json"
header.
Does this feature require an audit event?
No
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.