My FluxCD Notes
20 de out. de 2025
Install flux CLI
brew install fluxcd/tap/fluxCheck the Kubernetes cluster
flux check --preInstall flux on the Cluster
flux bootstrap github \
--owner=Cultura-do-Caractere \
--repository=Youtube \
--branch=main \
--path=./video7/cluster \
--personalClone the git repository
git clone https://github.com/$GITHUB_USER/fleet-infra
cd fleet-infraflux create source git youtube \
--url=https://github.com/Cultura-Do-Caractere/Youtube \
--branch=master \
--interval=1m \
--export > ./clusters/my-cluster/go-app.yamlChecking image controller automaton
flux check --components-extra=image-reflector-controller,image-automation-controllerAdding new components
flux bootstrap github \
--owner=Cultura-do-Caractere \
--repository=Youtube \
--branch=main \
--path=./video7/cluster \
--read-write-key \
--personal --components-extra image-reflector-controller,image-automation-controllerCreate Kustomize for Go-App
flux create kustomization go-app \
--target-namespace=default \
--source=youtube \
--path="./kustomize" \
--prune=true \
--wait=true \
--interval=30m \
--retry-interval=2m \
--health-check-timeout=3m \
--export > ./video7/cluster/environments/dev/go-app/test.yaml
--target-namespace=default \
--source=podinfo \
--path="./kustomize" \
--retry-interval=2m Watch Flux sync the application
flux get kustomizations --watchCreating a secret
flux create secret git image-update \
--url=ssh://git@github.com/Cultura-do-Caractere/Youtube \
--ssh-key-algorithm=ecdsa \
--ssh-ecdsa-curve=p521Freezing Deploy
flux suspend kustomization go-appDeleting Kustomization
flux delete kustomization go-app2Force reconcile
flux reconcile kustomization flux-systemGetting Tree of objects
flux tree kustomization go-appForcing reconciliation:
flux reconcile kustomization flux-system --with-sourceRunning for specific kustomizaretion
flux reconcile kustomization <name> -n <namespace> --with-sourceVerify last image scan
kubectl describe imagerepository podinfoAdd secret for a Docker Registry
kubectl create secret docker-registry ghcr \
--namespace=flux-system \
--docker-server=ghcr.io \
--docker-username=AlissonMMenezes \
--docker-password="your-password-here"Scan last image
flux get image repository blog-alissonmachado-repo -n blog-alissonmachado --kubeconfig=/etc/rancher/k3s/k3s.yamlScanning the image manually
flux reconcile image repository my-app --namespace=flux-system