argoproj / argo-cd

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

UI does not allow to specify values files in paths outside chart directory #3583

Open jannfis opened 4 years ago

jannfis commented 4 years ago

Checklist:

Describe the bug

When using Helm charts stored in Git, one can specify a values file to use for parametrization. Sometimes, it's convenient to store all the values files in different directories outside of the chart's directory, i.e.

helm-dependency-subdir/
  chart/
    Chart.yaml
  values/
    values.yaml

One can refer to this file as ../values/values.yaml when the source path of the application is helm-dependency-subdir/chart, i.e:

$ argocd app create helm-test --project default --dest-namespace helm-test \
  --dest-server https://kubernetes.default.svc \
  --repo https://github.com/jannfis/argocd-example-apps \
  --path helm-dependency-subdir/chart \
  --values '../values/values.yaml'

This works as expected:

$ argocd app get helm-test
Name:               helm-test
Project:            default
Server:             https://kubernetes.default.svc
Namespace:          helm-test
URL:                https://10.96.247.181/applications/helm-test
Repo:               https://github.com/jannfis/argocd-example-apps
Target:             
Path:               helm-dependency-subdir/chart
Helm Values:        ../values/values.yaml
SyncWindow:         Sync Allowed
Sync Policy:        <none>
Sync Status:        OutOfSync from  (798b2d0)
Health Status:      Missing

GROUP  KIND                   NAMESPACE  NAME                     STATUS     HEALTH   HOOK  MESSAGE
       ConfigMap              helm-test  helm-test-mariadb        OutOfSync  Missing        
       ConfigMap              helm-test  helm-test-mariadb-tests  OutOfSync  Missing        
       PersistentVolumeClaim  helm-test  helm-test-wordpress      OutOfSync  Missing        
       Secret                 helm-test  helm-test-mariadb        OutOfSync  Missing        
       Secret                 helm-test  helm-test-wordpress      OutOfSync  Missing        
       Service                helm-test  helm-test-mariadb        OutOfSync  Missing        
       Service                helm-test  helm-test-wordpress      OutOfSync  Missing        
apps   Deployment             helm-test  helm-test-wordpress      OutOfSync  Missing        
apps   StatefulSet            helm-test  helm-test-mariadb        OutOfSync  Missing        

However, when creating the app within the UI, specifying path ../values/values.yaml results in the Helm values field being empty and no values to be used at all. No error message is displayed, and nothing is printed in the logs. The entered values files is just silently ignored.

To Reproduce

  1. Create an app from https://github.com/jannfis/argocd-example-apps/helm-dependency-subdir/chart in the web UI, specifying ../values/values.yaml for the Helm values to use.
  2. Observe that Helm values are empty

Expected behavior

Same behaviour as when the app would be created using the CLI: values file specified is taken into account when rendering manifests via Helm.

Version

argocd: v1.5.4+36bade7
  BuildDate: 2020-05-05T18:59:08Z
  GitCommit: 36bade7a2d7b69d1c0b0c4d41191f792a847d61c
  GitTreeState: clean
  GoVersion: go1.14.1
  Compiler: gc
  Platform: linux/amd64
argocd-server: v1.5.4+36bade7
  BuildDate: 2020-05-05T19:01:57Z
  GitCommit: 36bade7a2d7b69d1c0b0c4d41191f792a847d61c
  GitTreeState: clean
  GoVersion: go1.14.1
  Compiler: gc
  Platform: linux/amd64
  Ksonnet Version: v0.13.1
  Kustomize Version: {Version:kustomize/v3.5.4 GitCommit:3af514fa9f85430f0c1557c4a0291e62112ab026 BuildDate:2020-01-11T03:12:59Z GoOs:linux GoArch:amd64}
  Helm Version: version.BuildInfo{Version:"v3.2.0", GitCommit:"e11b7ce3b12db2941e90399e874513fbd24bcb71", GitTreeState:"clean", GoVersion:"go1.13.10"}
  Kubectl Version: v1.14.0

Logs

Paste any relevant application logs here.
jannfis commented 4 years ago

The workaround is to either create the application declaratively or via the CLI.

xsreality commented 4 years ago

Another workaround is to click the Edit as YAML button in UI and specify the custom values files. Then the helm values field is correctly populated.

image

echung808 commented 2 years ago

To add values file via GUI (declaratively), edit the app manifest:

project: project-name
source:
...
  helm:
    valueFiles:
      - ./path/to/file

The path is relative to the dir where the main chart lives.

Other details about what's possible with values files here: https://github.com/argoproj/argo-cd/issues/938