Flux CD¶
Validation¶
flate¶
Render and diff Flux GitOps repositories fully offline one static binary, no cluster, no kubectl, no shellouts
Usage:
Other¶
- konflate
-
read-only pull request review tool for Flux using Flate for rendering
-
- Deprecated: flux-local tools and libraries for managing a local flux gitops repository focused on validation steps to help improve quality of commits, PRs, and general local testing.
Install¶
Flux cli tool:
Terraform¶
Issues:
Manual¶
Upgrade/install flux on cluster:
Usage¶
Get all flux resources:
Reconcile all helm releases¶
flux get -A helmrelease --no-header | \
awk -F' ' '{system("flux reconcile -n " $1 " helmrelease " $2)}'
or
kubectl get -A hr --template \
'{{range .items}}{{.metadata.namespace}}/{{.metadata.name}}{{"\n"}}{{end}}' | \
awk -F'/' '{system("flux reconcile -n " $1 " helmrelease " $2)}'
CRDs¶
Troubleshooting¶
Test flux resource locally¶
Beware: Doesn't render valuesFrom: fields!
yq .spec.values media/transmission-helmrelease.yaml > /tmp/values.yml
helm -n test template -f /tmp/values.yml transmission truecharts/transmission
upgrade retries exhausted¶
If you get helm-controller reconciliation failed: upgrade retries exhausted:
another operation (install/upgrade/rollback) is in progress¶
Helm upgrade failed: another operation (install/upgrade/rollback) is in progress
See https://open.greenhost.net/stackspin/wordpress-helm/-/issues/119
Solved by helm rollback and flux reconciliation of the helmRelease.
First list all helm releases in the namespace and watch for the pending-install
status ones:
$ helm -n stackspin-apps ls --all
NAME NAMESPACE REVISION UPDATED STATUS ...
wordpress stackspin-apps 4 2022-04-19 13:57:09.108314695 +0000 UTC pending-install ...
Then do a helm rollback to the revision before (in this case 3):
HelmChart 'flux-system/wireguard-wireguard-server' is not ready¶
Note: There are two helmchart resources:
helmcharts.helm.cattle.io(default, when uses withhelmcharts)
helmcharts.source.toolkit.fluxcd.io(use this one!)
"Cannot delete kustomization when it is running health checks"¶
from Cannot delete kustomization when it is running health checks:
The only workaround is to suspend the Kustomization, then restart the controller by killing its pod. When the controller starts it will no longer try to run the health check again since it receives the new object that's suspended.
→ Solved by the CancelHealthCheckOnNewRevision fetaure gate
Use different branch for Stackspin¶
kc -n flux-system patch gitrepo stackspin -p "{\"spec:\": {\"ref\": {\"branch\": \"nextcloud_1030\" }}}"