vagrant up --provision
vagrant ssh k3s1.devel
helm repo add fluxcd https://fluxcd.github.io/flux
kubectl apply -f https://raw.githubusercontent.com/fluxcd/flux/master/deploy-helm/flux-helm-release-crd.yaml
cat << EOF > flux-get-started.sh
helm upgrade -i flux \
--set helmOperator.create=true \
--set helmOperator.createCRD=false \
--set [email protected]:manuelkasiske/flux-example-project \
--namespace flux \
fluxcd/flux
EOF
chmod +x flux-get-started.sh
kubectl -n flux get pods
curl -SsL -o /usr/local/bin/fluxctl https://github.com/fluxcd/flux/releases/download/1.13.2/fluxctl_linux_amd64
chmod +x /usr/local/bin/fluxctl
echo "export FLUX_FORWARD_NAMESPACE=flux" >> /root/.bashrc
source /root/.bashrc
fluxctl list-workloads --all-namespaces
fluxctl identity --k8s-fwd-ns flux
Apply this key as git access key for example repository!
Wait a few minute to get it synched automatically - or just type
fluxctl sync
To find out which workloads are managed by flux run:
fluxctl list-workloads -a
To find out which images are available for podinfo run:
fluxctl list-images -w demo:deployment/podinfo
To upgrade the version of podinfo to 1.4 type
fluxctl policy -w demo:deployment/podinfo --tag-all='1.4.*'
At this point flux will upgrade the version in the deployment yaml file and will automatically run the deployment.
If a release doesn't work, we can lock it by:
fluxctl lock -w demo:deployment/podinfo -m "1.4.2 does not work for us"
After that we can rollback to an older version by:
fluxctl release --force --workload demo:deployment/podinfo -i stefanprodan/podinfo:1.4.1
To see, what flux is doing just type:
kubectl logs -n default deploy/flux -f
[https://github.com/fluxcd/flux-get-started] [https://github.com/fluxcd/flux] [https://github.com/fluxcd/flux/releases/tag/1.13.2] [https://github.com/fluxcd/flux/blob/master/site/fluxctl.md#linux] [https://github.com/fluxcd/flux/blob/master/site/annotations-tutorial.md] [https://github.com/fluxcd/flux/blob/master/site/helm-get-started.md]