manifests: https://github.com/Orpere/flux
vim .env
...
GITHUB_TOKEN=
GITHUB_REPOSITORY_OWNER=
GITHUB_USER=
MY_CLUSTER=
MY_REPOSITORY=
BRANCH=
KUBE_VERSION=v1.25.3
PASSWORD=
SECRET=flux-ssh
SLACK=
...
- create a cluster
./create_kind.sh
- install flux v1
./fluxv1.sh
- install flux v2
./fluxv2.sh
- scale down the flux operator and flux to 0 replicas
k scale deployment -n flux --replicas 0 --all
- reconcilie
flux reconcile hr nginx -n default
flux reconcile kustomization flux-system --with-source
- check if the config map was changed for
Name: test-configmap │
│ Namespace: default │
│ Labels: kustomize.toolkit.fluxcd.io/name=flux-system │
│ kustomize.toolkit.fluxcd.io/namespace=flux-system │
│ Annotations: <none> │
│ │
│ Data │
│ ==== │
│ test: │
│ ---- │
│ test configmap flux v2 │
│ │
│ BinaryData │
│ ==== │
│ │
│ Events: <none>
- delete flux v2 namespace
# Uninstall Flux but keep the namespace
flux uninstall --namespace=flux-system --keep-namespace=true
uninstall flux v1
helm uninstall helm-operator -n flux
helm uninstall flux -n flux
kubectl delete crd helmreleases.helm.fluxcd.io
kubectl delete namespace flux
- scale up the flux deployment and sync
fluxctl sync --k8s-fwd-ns flux
- check the test-configmap
│ Name: test-configmap │
│ Namespace: default │
│ Labels: fluxcd.io/sync-gc-mark=sha256.WaB78dgFgRgoZ_BK5dtC3QHHR7rW6F1tzlD6fB44NQU │
│ kustomize.toolkit.fluxcd.io/name=flux-system │
│ kustomize.toolkit.fluxcd.io/namespace=flux-system │
│ Annotations: fluxcd.io/sync-checksum: a8de40f3a5d79e8a083fb5a39f35ea3e393f1193 │
│ │
│ Data │
│ ==== │
│ test: │
│ ---- │
│ test configmap flux v1 │
│ │
│ BinaryData │
│ ==== │
│ │
│ Events: <none>
- deploy a helm chart with extra parameters on flux v1 e fluxv2
cat ./clusters/k8s/workflows/nginx2.yaml
- notifications
kubectl -n flux-system create secret generic slack-url \
--from-literal=address=${SLACK}
-
tag system
-
image automation
-
disaster recovery
run the bootstrap again and it shoud install all manifests
- create manifests using cli
example:
flux create hr myrelease \
--source=HelmRepository/mychart \
--chart=mychart \
--export > mychart-release.yaml
flux create source helm mychart \
--url https://my-registry/dir \
--export > repository.yaml
- multitenancy
notes: helm sources can be git, helmrepo, s3
ref:
https://www.youtube.com/watch?v=r_vKf5l1D1M&t=2560s
https://devopscube.com/build-docker-image/
https://helm.sh/docs/chart_template_guide/accessing_files/
https://github.com/weaveworks/weave-gitops
https://fluxcd.io/flux/guides/notifications/
https://fluxcd.io/flux/guides/image-update/
create demo:
git submodule update --recursive --remote
cp -R flux/v2-manifests/* flux/fluxv2/demo/.
cd flux
git add .
git commit -m "add demo"
git push -f origin HEAD:main
remove demo:
cd flux
rm -fr fluxv2
git add .
git commit -m "remove demo"
git push -f origin HEAD:main
kind delete cluster --name demo
TODO proccess:
- deploy descale to 0 operator
- deploy descale to 0 flux
- helm install fluxv2
- migrate the objects from v1 to v2
- helm uninstall helm-operator
- delete crd helmreleases.helm.fluxcd.io
- helm uninstall fluxv1
- delete namespace fluxv1 namespace