From 411a5402e79ca770dc54654854b16c0fcc799765 Mon Sep 17 00:00:00 2001 From: Waleed Hammam Date: Thu, 14 Dec 2023 09:14:31 +0200 Subject: [PATCH 1/2] ADR for require no maintenance to keep bootstrapping cli up to date --- ...ce-to-keep-bootstrapping-cli-up-to-date.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md diff --git a/docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md b/docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md new file mode 100644 index 0000000..fb5611d --- /dev/null +++ b/docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md @@ -0,0 +1,86 @@ +# 26. require no maintenance to keep bootstrapping cli up to date + +Date: 2023-12-13 + +## Status + +Provisional + +## Context + +Currently, CLI bootstrapping creates and manages WGE values [here](https://github.com/weaveworks/weave-gitops-enterprise/blob/d27d52cf1053d194a40e7652a570d810db552613/pkg/bootstrap/steps/install_wge.go#L49-L124). This means any update / breaking change happens to WGE values +will lead to degraded bootstrapping process for users and maintaining it will require extra cost. Values should be kept up to date accordingly when they change in the WGE. + +## Decision + +Fetching the values file from the corresponding version + +example response for fetching the chart from [wge charts url](https://charts.dev.wkp.weave.works/releases/charts-v3) + +```yaml +apiVersion: v1 +entries: + mccp: + - apiVersion: v2 + appVersion: 1.16.0 + created: "2023-12-11T13:29:39.19014457Z" + dependencies: + - condition: cluster-controller.enabled + name: cluster-controller + repository: file://../cluster-controller + version: 1.0.0 + - condition: templates-controller.enabled + name: templates-controller + repository: file://../templates-controller + version: 0.3.0 + . + . + . + . + description: A Helm chart for Kubernetes + digest: 8d7bab57fd4a1e87112ff950c3b9f65d26df968006d7968af3d5abec843faa79 + name: mccp + type: application + urls: + - https://s3.us-east-1.amazonaws.com/weaveworks-wkp/releases/charts-v3/mccp-0.38.1.tgz + version: 0.38.1 +``` + +Example url for `v0.38.1` version: `https://s3.us-east-1.amazonaws.com/weaveworks-wkp/releases/charts-v3/mccp-0.38.1.tgz` + +By downloading and uncompressing this file you will have the values file corresponding to the downloaded version + +Example for `v0.38.1` `mccp/values.yaml` + +```yaml +# Default values for mccp. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. + +imagePullSecrets: [] +nameOverride: "" +fullnameOverride: "" + +images: + clustersService: docker.io/weaveworks/weave-gitops-enterprise-clusters-service:v0.38.1 + uiServer: docker.io/weaveworks/weave-gitops-enterprise-ui-server:v0.38.1 +. +. +. +. +. +. +``` + +After that, This values file will be converted to `map[string]interface{}` then update the specific values from installation like `oidc` values. + +## Consequences + +### Pros + +- Values will always be up to date + +### Cons + +- Lost the structured values files +- Extra overhead for downloading / uncompressing the chart file \ No newline at end of file From d11bace2f5cfbaf79fd24d58e67c7fecc41deecf Mon Sep 17 00:00:00 2001 From: Waleed Hammam Date: Thu, 14 Dec 2023 12:41:06 +0200 Subject: [PATCH 2/2] extend with options --- ...ce-to-keep-bootstrapping-cli-up-to-date.md | 28 +++++++++++++++---- 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md b/docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md index fb5611d..2a39799 100644 --- a/docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md +++ b/docs/adrs/0026-require-no-maintenance-to-keep-bootstrapping-cli-up-to-date.md @@ -13,7 +13,9 @@ will lead to degraded bootstrapping process for users and maintaining it will re ## Decision -Fetching the values file from the corresponding version +### Options + +#### option a) Fetching the values file from the corresponding version example response for fetching the chart from [wge charts url](https://charts.dev.wkp.weave.works/releases/charts-v3) @@ -74,13 +76,27 @@ images: After that, This values file will be converted to `map[string]interface{}` then update the specific values from installation like `oidc` values. -## Consequences - -### Pros +**Pros** - Values will always be up to date -### Cons +**Cons** - Lost the structured values files -- Extra overhead for downloading / uncompressing the chart file \ No newline at end of file +- Extra overhead for downloading / uncompressing the chart file + + + +#### option B) Refactoring the `install wge` step to the shape of [terraform](https://github.com/weaveworks/weave-gitops-enterprise/blob/7a26044174a046fbf25e7f005b895f8a0a5400dc/pkg/bootstrap/steps/terraform.go) + +where we dont manage values. Something like consuming a helmrelease manifest as stated [here](https://docs.gitops.weave.works/docs/enterprise/getting-started/install-enterprise/#configure-helm-chart-and-commit). +To generate and publish that manifest could be done as part of the release process (we have to do it as part of https://github.com/weaveworks/weave-gitops-enterprise/issues/2213) + +#### option C) How flux does it where flux v2.1.0 can only bootstrap flux for v2.1.0 + +so in this case refactoring install wge to just install the version that the cli belongs to. for example gitops-ee v0.38 only install v0.38, etc ... +see artifacts in https://github.com/fluxcd/flux2/releases/tag/v2.2.0 and https://github.com/fluxcd/flux2/blob/00c6ac81b9938e80a79c5b625b06cfb4f220c3db/pkg/manifestgen/install/manifests.go#L37 + + + +