هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
ماذا يفعل
Flux installs controllers into the cluster: the source-controller pulls Git repos, Helm repos and OCI artifacts; the kustomize-controller applies folders; the helm-controller installs charts; the image automation controllers can write new image tags back to Git. Everything is a Kubernetes object (GitRepository, Kustomization, HelmRelease). Flux has no own UI — you use flux and kubectl.
flux bootstrap installs Flux and commits its own config to your Git repo, so Flux manages itself.
طريقة الكتابة
flux bootstrap github --owner USER --repository REPO --path clusters/NAME
flux get|reconcile|suspend|resume KIND NAMEالأجزاء الرئيسية
Commands
check[--pre]- Check the cluster and Flux.
bootstrapgithub|gitlab|git- Install Flux and connect it to a repo.
createsourcegitNAME- Create a GitRepository source.
createkustomizationNAME- Create a Kustomization (apply a folder).
createhelmreleaseNAME- Create a HelmRelease.
getall|sources|kustomizations|helmreleases- Show status.
reconcilekustomization|sourceNAME- Sync now.
suspend/resumeKINDNAME- Pause / continue syncing.
logs[--level error]- Controller logs.
diffkustomizationNAME--pathDIR- Show changes before push.
events- Flux events.
exportKINDNAME- Print YAML.
uninstall- Remove Flux.
الخيارات 6
الأكثر استخدامًا
Common flags
لا يوجد شيء يطابق هذا الفلتر.
أمثلة 10
$ مستخدم عادي# بصلاحية root (أو مع sudo)
1Check and bootstrap with GitHub
flux check --pre export GITHUB_TOKEN=github_pat_xxxx flux bootstrap github --owner s0sta --repository fleet --branch main --path clusters/home --personal2Add an app from another repo (as YAML in Git)
flux create source git shop --url https://github.com/s0sta/platform --branch main --interval 1m --export > clusters/home/shop-source.yaml flux create kustomization shop --source GitRepository/shop --path ./apps/shop/overlays/prod --prune --interval 5m --target-namespace shop --export > clusters/home/shop-kustomization.yaml git add clusters/home && git commit -m "Add shop" && git push3Watch and force a sync
flux get kustomizations flux reconcile kustomization shop --with-source flux get all -A4Install a Helm chart with a HelmRelease
cat clusters/home/podinfo.yaml apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease metadata: { name: podinfo, namespace: podinfo } spec: interval: 10m chart: spec: chart: podinfo version: "6.7.x" sourceRef: { kind: HelmRepository, name: podinfo, namespace: flux-system } values: replicaCount: 25Decrypt SOPS secrets during apply
cat clusters/home/shop-kustomization.yaml spec: decryption: provider: sops secretRef: { name: sops-age }6Pause during an incident
flux suspend kustomization shop flux resume kustomization shop7Read errors
flux logs --level error --since 1h flux events -n flux-system8Preview a change before you push
flux diff kustomization shop --path ./apps/shop/overlays/prod9See which version runs where
flux get sources git -A flux version10Export everything for a backup
flux export source git --all > sources.yaml flux export kustomization --all > kustomizations.yaml
لا يوجد شيء يطابق هذا الفلتر.
انتبه
- The bootstrap token needs repo rights only once; Flux then uses a deploy key.
--prunedeletes objects you remove from Git — that is the point, but check the path.
الملفات
clusters/NAME/flux-system/- Flux's own config in your repo.
نصائح للحفظ
- Flux vs Argo CD: Flux is CLI/controllers only; Argo CD has a strong UI and multi-cluster view. Learn one well.
رموز الخروج
0 | Success. |
1 | Error. |