weaveworks / weave-gitops-enterprise

This repo provides the enterprise level features for the weave-gitops product, including CAPI cluster creation and team workspaces.
https://docs.gitops.weave.works/
Apache License 2.0
160 stars 29 forks source link

[PL] Support specifying a templated values.yaml if a user selects a profile #2533

Closed foot closed 1 year ago

foot commented 1 year ago

When upgrading to 0.18.1, PL bumped into a breaking change in (v0.11.0) https://docs.gitops.weave.works/docs/next/releases/#breaking-changes-4

The default values for a profile are not fetched and included in a pull-request Prior to this release WGE would fetch the default values.yaml for every profile installed and include them in the HelmReleases in the Pull Request when rendering out the profiles of a template. This was an expensive operation and occasionally led to timeouts. The new behaviour is to omit the values and fall back to the defaults included in the helm-chart. This sacrifices some UX (being able to see all the defaults in the PR and tweak them) to improve performance. There should not be any final behaviour changes to the installed charts. You can still view and tweak the values.yaml when selecting profiles to include on the "Create resource (cluster)" page. If changes are made here the updated values.yaml will be included.

Which we should have reached out and understood all the use cases first.

PL use case: Profile is not selected at all by default, if user does select it then the values.yaml should be X by default, where X can contain template params"

To address this use case we could either:

  1. ~revert to old behaviour of fetching and templating the values.yaml from the helmrepository.~
  2. Add a new field selected: false alongside required and editable, so you can specify values.yaml but also have the profile unchecked by default.
  3. Other way to store "templated profile definitions" that can be shared between templates?

Example of 2:

  charts:
    helmRepositoryTemplate:
      path: ${NAMESPACE}/${CLUSTER_NAME}/helm-repo.yaml
    items:
      - chart: cert-manager
        targetNamespace: cert-manager
        # new field?
        selected: false
        required: false
        editable: true
        version: 0.0.8
        template:
          path: ${NAMESPACE}/${CLUSTER_NAME}/cert-manager.yaml
          content:
            spec:
              install:
                remediation:
                  retries: ${CERT_MANAGER_RETRIES}
foot commented 1 year ago

"Workaround": users have to deselect profiles they don't want.

foot commented 1 year ago

https://github.com/weaveworks/weave-gitops-interlock/issues/301

foot commented 1 year ago

Can user see original original values in the UI at this point?

foot commented 1 year ago

@steve-fraser to choose a direction here, it would be good to understand how important we think it is to store the default values for a profile OUTSIDE of a template or not? E.g. is it a real pain to repeat the default values (that may include template params) in each template?