You will need a Kubernetes cluster version 1.24 or newer. For a quick local test, you can use Kubernetes kind. Any other Kubernetes setup will work as well though.
Create a cluster called staging with the kind CLI:
kind create cluster --name stagingInstall the Flux CLI on MacOS or Linux using Homebrew:
brew install fluxcd/tap/fluxFor other installation methods please see fluxcd.io/flux/installation.
In order to follow the workshop you'll need a GitHub account and a
personal access token
that can create repositories (check all permissions under repo).
Add the GitHub PAT and username to your shell environment:
export GITHUB_TOKEN=<your-token>
export GITHUB_USER=<your-username>Fork the workshop repository on your personal account and clone it locally:
git clone https://github.com/${GITHUB_USER}/flux-workshop-2023.git
cd flux-workshop-2023Install the Flux controllers on the staging cluster:
flux bootstrap github \
--owner=${GITHUB_USER} \
--repository=flux-workshop-2023 \
--branch=main \
--personal \
--path=clusters/stagingPull the changes locally:
git pullInspect the Flux manifests generated in the repo:
tree ./clustersRename the infrastructure.yaml.x to infrastructure.yaml in the clusters/staging directory,
then commit the changes and push them upstream.
Wait for Flux to reconcile the infra Kustomizations:
flux get kustomizations --watchTo access the Flux UI, first start port forwarding with:
kubectl -n flux-system port-forward svc/weave-gitops 9001:9001Navigate to http://localhost:9001 and login using the username admin and the password flux.
Rename the apps.yaml.x to apps.yaml in the clusters/staging directory,
then commit the changes and push them upstream.
Wait for Flux to reconcile the apps Kustomizations:
flux get kustomizations --watchEdit the podinfo.yaml file from the apps directory, and change the tag: 6.4.0 to semver: 6.4.x.
Commit the changes and push them upstream.
Navigate to Applications > podinfo in the Flux UI and watch the app being upgraded to the latest version.