← 返回命令列表

Linux command

flux 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Bootstrap Flux

flux bootstrap github --owner=[username] --repository=[repo] --path=[clusters/my-cluster]

Check prerequisites

flux check --pre

Check Flux components

flux check

Get all Flux resources

flux get all

Reconcile a Kustomization

flux reconcile kustomization [name]

Suspend updates

flux suspend kustomization [name]

Resume updates

flux resume kustomization [name]

Export Flux resources

flux export source git --all

View Flux controller logs

flux logs

说明

Flux is a GitOps continuous delivery tool for Kubernetes. It automatically synchronizes cluster state with configuration stored in Git repositories, ensuring that the live cluster matches the desired state defined in version control. Flux monitors Git repositories, Helm repositories, and OCI registries for changes. When updates are detected, it applies them to the cluster automatically. This enables declarative, auditable infrastructure management following GitOps principles. The flux CLI bootstraps Flux components into a cluster and provides management commands for sources, kustomizations, and Helm releases. Flux uses Kubernetes custom resources to define what to sync and how.

参数

--kubeconfig _FILE_
Path to kubeconfig file.
-n, --namespace _NAMESPACE_
Namespace for CLI operations (default: flux-system).
--context _CONTEXT_
Kubernetes context to use.
--timeout _DURATION_
Timeout for operations (default: 5m0s).
--verbose
Print generated objects.
-h, --help
Display help for command.

FAQ

What is the flux command used for?

Flux is a GitOps continuous delivery tool for Kubernetes. It automatically synchronizes cluster state with configuration stored in Git repositories, ensuring that the live cluster matches the desired state defined in version control. Flux monitors Git repositories, Helm repositories, and OCI registries for changes. When updates are detected, it applies them to the cluster automatically. This enables declarative, auditable infrastructure management following GitOps principles. The flux CLI bootstraps Flux components into a cluster and provides management commands for sources, kustomizations, and Helm releases. Flux uses Kubernetes custom resources to define what to sync and how.

How do I run a basic flux example?

Run `flux bootstrap github --owner=[username] --repository=[repo] --path=[clusters/my-cluster]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --kubeconfig _FILE_ do in flux?

Path to kubeconfig file.