Installing Weave GitOps
Before you begin
We will provide a complete walk-through of getting Flux installed and Weave GitOps configured. However, if you have:
- an existing cluster bootstrapped Flux version >= 0.32.0 🎉
- followed our installation doc to configure access to the Weave GitOps dashboard then install Weave GitOps 👏
Then you can skip ahead to the Weave GitOps overview 🏃 but note ⚠️ you may need to alter commands where we are committing files to GitHub ⚠️.
To follow along, you will need the following:
- A Kubernetes cluster - such as Kind.
- A GitHub account and personal access token with repo permissions.
Weave GitOps is an extension to Flux and therefore requires that Flux 0.32 or later has already been installed on your Kubernetes cluster. Full documentation is available at: https://fluxcd.io/docs/installation/.
This version of Weave GitOps is tested against the following Flux releases:
Install the flux CLI
brew install fluxcd/tap/flux
For other installation methods, see the relevant Flux documentation.
Export your credentials
Check your Kubernetes cluster
flux check --pre
The output is similar to:
► checking prerequisites
✔ kubernetes 1.22.2 >=1.20.6
✔ prerequisites checks passed
Install Flux onto your cluster with the
flux bootstrap github \
Full installation documentation including how to work with other Git providers is available here.
The bootstrap command above does the following:
- Create a git repository fleet-infra on your GitHub account
- Add Flux component manifests to the repository
- Deploy Flux Components to your Kubernetes Cluster
- Configure Flux components to track the path /clusters/my-cluster/ in the repository
Install Weave GitOps
For this guide we will use the cluster user, for complete documentation including how to configure an OIDC provider see the documentation here.
Weave GitOps includes a command-line interface to help users create and manage resources.
gitops CLI is currently supported on Mac (x86 and Arm), and Linux - including Windows Subsystem for Linux (WSL).
Windows support is a planned enhancement.
There are multiple ways to install the
curl --silent --location "https://github.com/weaveworks/weave-gitops/releases/download/v0.11.0/gitops-$(uname)-$(uname -m).tar.gz" | tar xz -C /tmp
sudo mv /tmp/gitops /usr/local/bin
brew tap weaveworks/tap
brew install weaveworks/tap/gitops
Deploying Weave GitOps
Clone your git repository where Flux has been bootstrapped.
git clone https://github.com/$GITHUB_USER/fleet-infra
Run the following command which will create a
HelmReleaseto deploy Weave GitOps
gitops create dashboard ww-gitops \
--export > ./clusters/my-cluster/weave-gitops-dashboard.yaml
This command stores a hash of a password. While this is relatively safe for demo and testing purposes it is recommend that you look at more secure methods of storing secrets (such as Flux's SOPS integration) for production systems.
Commit and push the
git add -A && git commit -m "Add Weave GitOps Dashboard"
Validate that Weave GitOps and Flux are installed
kubectl get pods -n flux-system
You should see something similar to:
NAME READY STATUS RESTARTS AGE
helm-controller-5bfd65cd5f-gj5sz 1/1 Running 0 10m
kustomize-controller-6f44c8d499-s425n 1/1 Running 0 10m
notification-controller-844df5f694-2pfcs 1/1 Running 0 10m
source-controller-6b6c7bc4bb-ng96p 1/1 Running 0 10m
ww-gitops-weave-gitops-86b645c9c6-k9ftg 1/1 Running 0 5m
There's many other things you can configure in the weave gitops helm chart. For a reference, see our value file reference.
In our following Get Started document, we will walk you through logging into the GitOps Dashboard and deploying an application.