argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
17.49k stars 5.32k forks source link

Allow Custom Plugins to use helm variables via the GUI #10474

Open BMonsalvatge opened 2 years ago

BMonsalvatge commented 2 years ago

Summary

Currently when using a plugin like the argocd vault plugin, I am no longer able to see the values of the helm chart via the gui and have to set it manually. Ref: https://github.com/argoproj-labs/argocd-vault-plugin/issues/385#issuecomment-1230484255

Motivation

When using a CMP, it'd be nice if we could still have the default features of the way helm works in argocd.

Proposal

Not sure how it should logically function in ArgoCD, but when using a CMP it'd be nice to have the features of helm still available in the GUI. I am still using helm within ArgoCD to specify the values, they just no longer propagate into the GUI.

crenshaw-dev commented 1 year ago

May be partially solved by this: https://github.com/argoproj/argo-cd/pull/9216

BMonsalvatge commented 1 year ago

Yea, that would partially solve the issue. I think the only additional functionality that feels missing is a way to prefill those parameters the way helm plugin does by default. Maybe if there was some way a CMP can express where to get those values from (in the case of helm, pointing to values.yaml).

crenshaw-dev commented 1 year ago

@BMonsalvatge that's part of #9216! When the plugin sends Argo CD a description of what parameters it accepts, it can generate the list however it wants and pre-fill values which are already set. We designed it this way specifically with Helm in mind.

The feature proposal actually includes a small script which converts a values.yaml to a list of plugin parameters: https://argo-cd.readthedocs.io/en/latest/proposals/parameterized-config-management-plugins/#example-3-simple-helm-cmp

yq e -o=p values.yaml | jq --slurp --raw-input '
  [{
    name: "helm-parameters", 
    title: "Helm Parameters",
    collectionType: "map",
    map: split("\\n") | map(capture("(?<key>.*) = (?<value>.*)")) | from_entries
  }]'
BMonsalvatge commented 1 year ago

Thanks for clarifying! Understanding that now looking over it a second time. I appreciate the response!

crenshaw-dev commented 1 year ago

Yeah I'm pretty excited about the feature, even more excited that it sounds like someone might use it. 😆 We'll get it reviewed and merged in time for 2.6 late next month.