Installing | Upgrading | Downgrading | Uninstalling Flagger
Summary
If you are reading this it is likely because you have already installed Weave GitOps and you are now in a position to utilise the Flagger Controller to extend the functionality that Weave GitOps adds to your organisation.
Prerequisites
A correctly installed instance of Weave GitOps (Enterprise or OSS). We advise always checking the changelogs at https://docs.gitops.weave.works/docs/next/enterprise/getting-started/releases-enterprise/ - identify both the existing version from your manifest and version you would like to upgrade/downgrade to. Be sure to note the Kubernetes Distribution and flux version as a precaution to whether the component you are installing will require upgrade of either of those components.
Any upgrade/downgrade process will require you to locate the Weave GitOps install manifest directory. If you have installed the Weave GitOps Enterprise helm chart as originally instructed this should be at 'clusters/management'. If you have customised the location of this you need to retrieve the location. This directory is ideal, but you may prefer to install in a different location i.e an application specific directory.
Process: Installation
Please see https://docs.gitops.weave.works/docs/guides/delivery/#installing-flagger-using-flux for the canonical method to install. Please check https://github.com/fluxcd/flagger/blob/main/CHANGELOG.md to ensure that the version of flagger you re installing is compatible with your choice of kubernetes distribution and ingress, service mesh or any other complementary components. If installing on Weave GitOps Enterprise we advise reusing the same directory as that of other management components.
You will also need to add/customise roles and RBAC to enable Flagger to read the status/conditions of remote objects. Please see https://docs.gitops.weave.works/docs/configuration/user-permissions/#setting-up-remote-cluster-permissions
Process: Upgrade/Downgrade
Upgrading/Downgrading Flagger will potentially involve changes to the CRDs. The below example includes the necessary helm values to ensure that any CRDs are replaced accordingly:
---
apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
name: flagger
namespace: flagger-system
spec:
releaseName: flagger
install: # override existing Flagger CRDs
crds: CreateReplace
upgrade: # update Flagger CRDs
crds: CreateReplace
chart:
spec:
chart: flagger
version: 1.0.0
sourceRef:
kind: HelmRepository
name: flagger
Follow the necessary process to reconcile and update the installation. Note this
Process: Uninstall
To uninstall the Flagger controller you can simply remove the HelmRelease and reconcile the cluster. Remember you may want to review RBAC and ClusterRoles thereafter to return any Flagger specific adjustments to more appropriate permissions.