Toolkit: CLIs, UIs & Helpers
The tools you'll reach for around a GitOps setup, grouped by job. Versions move quickly here; check each project's releases page before pinning.
The agents' own CLIs
| Task | Argo CD (argocd) |
Flux (flux) |
|---|---|---|
| list / status | argocd app list, argocd app get APP |
flux get all -A, flux get kustomizations |
| what would change | argocd app diff APP [--local DIR] |
flux diff kustomization KS --path DIR |
| apply now | argocd app sync APP |
flux reconcile kustomization KS --with-source |
| re-read Git ignoring caches | argocd app get APP --hard-refresh |
flux reconcile source git NAME |
| wait in CI | argocd app wait APP --health --sync --timeout 600 |
kubectl wait kustomization/KS -n flux-system --for=condition=ready --timeout=10m |
| pause | argocd app set APP --sync-policy none |
flux suspend kustomization KS |
| roll back | argocd app rollback APP ID |
revert in Git (Helm: automatic remediation) |
| where does this object come from | the UI's resource tree | flux trace deployment NAME -n NS |
| offline rendering | (use helm/kustomize directly) | flux build kustomization KS --path DIR --dry-run |
| generate YAML | write it; argocd appset generate previews ApplicationSets |
flux create … --export |
Rendering and validation in CI
The most valuable tool in a GitOps repo is a CI job that renders every environment and validates the result, so broken YAML never reaches an agent. This session is a small version of that job for a linkly-deploy-style repo (one environment is deliberately broken so you can see it fail):
mkdir -p repo/charts/linkly/templates repo/apps/linkly/staging repo/apps/linkly/production && cd repo
printf 'apiVersion: v2\nname: linkly\nversion: 0.3.2\n' > charts/linkly/Chart.yaml
printf 'replicaCount: 2\nimage: {tag: 1.4.0}\n' > charts/linkly/values.yaml
cat > charts/linkly/templates/deployment.yaml <<'EOF'
apiVersion: apps/v1
kind: Deployment
metadata: {name: linkly}
spec:
replicas: {{ .Values.replicaCount }}
selector: {matchLabels: {app: linkly}}
template:
metadata: {labels: {app: linkly}}
spec:
containers: [{name: linkly, image: "ghcr.io/acme/linkly:{{ .Values.image.tag }}"}]
EOF
printf 'replicaCount: 1\nimage: {tag: 1.5.0-rc.2}\n' > apps/linkly/staging/values.yaml
printf 'replicaCount: "three"\nimage: {tag: 1.4.0}\n' > apps/linkly/production/values.yaml # a typo'd value
cat > validate.sh <<'EOF'
#!/usr/bin/env bash
# Render every environment of every app and validate it. Exit 1 if anything fails.
set -uo pipefail
status=0
for dir in apps/*/*/; do
app=$(basename "$(dirname "$dir")"); env=$(basename "$dir")
if out=$(helm template "$app" "charts/$app" -f "$dir/values.yaml" 2>&1 | kubeconform -strict -summary - 2>&1); then
echo "ok $app/$env"
else
echo "FAIL $app/$env"; echo "$out" | sed 's/^/ /'; status=1
fi
done
exit $status
EOF
chmod +x validate.sh
./validate.sh; echo "exit code: $?"FAIL linkly/production
stdin - Deployment linkly is invalid: problem validating schema. Check JSON formatting: jsonschema validation failed with 'file:///opt/k8s-schemas/v1.34.12-standalone-strict/deployment-apps-v1.json#' - at '/spec/replicas': got string, want null or integer
Summary: 1 resource found parsing stdin - Valid: 0, Invalid: 1, Errors: 0, Skipped: 0
ok linkly/staging
exit code: 1
replicas: "three" renders as YAML without complaint; only schema validation catches it. Add a rendered-diff step for reviewers (render main and the PR branch, diff -u the outputs, post it as a PR comment) and you have most of what dedicated tools offer.
Helpers worth knowing
| Tool | What it does |
|---|---|
| Renovate | opens PRs that bump image tags, chart versions and targetRevisions in deploy repos; understands Helm values, Kustomize images:, Argo CD Applications and Flux HelmReleases |
| Kargo | promotion orchestration for Argo CD: stages, "freight" (a set of versions), verification, and promotion PRs |
| Argo CD Image Updater | Argo CD's counterpart to Flux image automation |
| argocd-diff-preview, flux-local | render the full effect of a PR (all Applications / Flux objects) in CI without a cluster, for review comments |
| Flagger | progressive delivery for Flux (canary, A/B, blue-green), Gateway API among its routers |
| Argo Rollouts kubectl plugin | kubectl argo rollouts get/promote/abort, plus a dashboard |
| Flux Operator | installs and upgrades Flux declaratively (FluxInstance), adds ResourceSets and a web UI |
| Headlamp (with the Flux plugin), Capacitor | UIs for Flux |
| SOPS + age, Sealed Secrets (kubeseal), External Secrets Operator | secrets in GitOps (Secrets) |
| kubeconform, kube-linter, Conftest/Kyverno CLI | schema validation and policy checks on rendered manifests |
| pre-commit | run helm lint, yamllint and the validate script before every commit |
Local playgrounds
A kind or k3d cluster on a laptop runs both agents comfortably. Point them at a repository on GitHub, or at a Git server inside the cluster (Gitea), and break things on purpose: delete a Deployment, edit a ConfigMap, push an invalid manifest, and watch how each tool reports and repairs it. The Exercises suggest a sequence.
Test yourself
Why does the validate script pipe helm template into kubeconform -strict instead of only running helm template?
- helm template can't run without a cluster
- Rendering only proves the templates produce YAML; schema validation catches wrong types and unknown fields like
replicas: "three" - kubeconform applies the manifests
- It is faster
Which tool opens pull requests that bump chart versions and image tags in a deploy repository?
- Flagger
- Renovate
- kubeconform
- Headlamp