$ account fluxcd
Flux2 is a CLI tool (the `flux` command) for implementing GitOps workflows on Kubernetes. It manages the lifecycle of Flux-specific Kubernetes resources (GitRepository, HelmRepository, OCIRepository, Kustomization, HelmRelease, ImageRepository, etc.) by generating manifests, applying them via server-side apply, and monitoring reconciliation status. The CLI is built with Cobra and provides subcommands for bootstrap, install, create, get, reconcile, suspend, resume, export, delete, diff, build, push, pull, tag, trace, tree, events, logs, check, migrate, uninstall, and plugin management. It supports multiple Git providers (GitHub, GitLab, Gitea, Bitbucket Server), OCI registries, Helm repositories, and cloud authentication (AWS, Azure, GCP). The architecture follows an adapter pattern where each resource type implements a common interface, enabling generic command implementations. Key data flows include: (1) bootstrap: clone a Git repository, generate manifests, push sync config, wait for readiness; (2) install: deploy Flux controllers and CRDs onto a cluster; (3) reconcile: fetch desired state from a source (Git, OCI, Helm), compute diff, apply via Kubernetes API, wait for convergence; (4) artifact management: build tarballs from manifests and push to OCI registries with metadata. External dependencies include Kubernetes controller-runtime, go-containerregistry, go-git, and various cloud SDKs. The repository also serves as the distribution hub for Flux controller manifests and includes a GitHub Action for installing the CLI in CI pipelines.