fluxctl
Automate deployments to Kubernetes with GitOps
TLDR
List workloads currently running in the cluster on specific namespace
Show deployed and available images
Synchronize the cluster with the Git repository
Turn on automatic deployment for a workload
SYNOPSIS
`fluxctl` is structured with subcommands, where each subcommand has its own set of options and arguments. The general syntax is:
`fluxctl [global-options]
Common subcommands include:
- `fluxctl sync`: Forces a sync of the cluster with Git.
- `fluxctl release`: Deploys a new image version to a workload.
- `fluxctl automate`: Configures image automation for a workload.
- `fluxctl deautomate`: Disables image automation for a workload.
- `fluxctl suspend`: Suspends reconciliation or image automation for a workload.
- `fluxctl resume`: Resumes reconciliation or image automation for a workload.
- `fluxctl identity`: Shows the public key for Git deployment.
- `fluxctl logs`: Shows logs from the Flux daemon.
- `fluxctl version`: Displays the client and server versions.
- `fluxctl help`: Shows help for a command.
PARAMETERS
--kubeconfig path
(Global) Path to the kubeconfig file to use for Kubernetes API communication.
--context name
(Global) The name of the kubeconfig context to use.
--namespace name
(Global) The Kubernetes namespace where Flux is running, typically 'flux-system' or 'default'.
--url URL
(Global) URL of the Flux daemon to connect to (e.g., http://localhost:3030). Usually derived from kubeconfig.
--k8s-fwd-ns namespace
(Global) Use Kubernetes port-forwarding to connect to the daemon in the specified namespace.
--dry-run
(Common for subcommands) Show what would happen without making actual changes.
--output format
(Common for subcommands) Output format (e.g., 'json', 'yaml', 'table').
(Subcommand-specific options)
Each subcommand (e.g., `release`, `automate`) has its own specific options and arguments. Use `fluxctl
DESCRIPTION
`fluxctl` is the official command-line interface (CLI) for Flux CD, a GitOps tool for Kubernetes. It allows users to interact with a Flux daemon running inside a Kubernetes cluster to manage application deployments and configurations based on a Git repository. Flux automates the deployment of services to Kubernetes by synchronizing the state of a Git repository with the cluster.
With `fluxctl`, users can perform operations such as releasing new images, automating image updates, suspending or resuming deployments, inspecting logs, and managing Git repository synchronization. It acts as a bridge between the user and the automated GitOps workflow managed by Flux, enabling declarative infrastructure and application management.
CAVEATS
`fluxctl` requires a running Flux daemon within a Kubernetes cluster to operate effectively; it does not function standalone to manage Git or Kubernetes directly.
Proper Kubernetes authentication and authorization are essential, as `fluxctl` leverages your kubeconfig to connect to the cluster and subsequently to the Flux daemon.
The commands executed via `fluxctl` ultimately rely on the Git repository configured for Flux, meaning changes applied via `fluxctl` are often reflected by updates pushed to Git by Flux itself, or by triggering Flux to pull from Git.
<B>GITOPS PRINCIPLE</B>
Flux CD, and by extension `fluxctl`, embodies the GitOps principle: using Git as the single source of truth for declarative infrastructure and applications. All changes to the cluster state are made through Git, which then automatically triggers updates via Flux's reconciliation loop.
<B>RECONCILIATION LOOP</B>
The Flux daemon continuously monitors the configured Git repository for changes. When changes are detected, it reconciles the cluster state to match the desired state declared in Git. `fluxctl` commands often interact with or trigger this reconciliation process.
<B>IMAGE AUTOMATION</B>
A powerful feature of Flux is its ability to automate image updates. `fluxctl` allows you to 'automate' workloads, meaning Flux will scan container registries for new image versions (e.g., 'latest') and automatically commit updates to your Git repository, which then triggers a deployment.
HISTORY
Flux originated as a project by Weaveworks, a pioneer in the GitOps movement. It was one of the earliest and most prominent tools to implement the GitOps principles, automating continuous delivery for cloud-native applications. Initially part of Weaveworks' product suite, Flux later became a core project within the Cloud Native Computing Foundation (CNCF) sandbox, and then graduated to incubating status, signifying its maturity and widespread adoption in the Kubernetes ecosystem. Its development continues as a community-driven project, focusing on robust and scalable GitOps solutions.