How do I set helm values (not files) in ArgoCD Application spec

Viewed 599

I looked all over the ArgoCD docs for this but somehow I cannot seem to find an answer. I have an application spec like so:

apiVersion: argoproj.io/v1alpha1                                                                                                                                                                                                                                                          
kind: Application                                                                                                                                                                                                                                                                         
metadata:                                                                                                                                                                                                                                                                                 
  name: myapp                                                                                                                                                                                                                                                                            
  namespace: argocd                                                                                                                                                                                                                                                                       
spec:                                                                                                                                                                                                                                                                                     
  destination:                                                                                                                                                                                                                                                                            
    namespace: default                                                                                                                                                                                                                                                                    
    server: https://kubernetes.default.svc                                                                                                                                                                                                                                                
  project: default                                                                                                                                                                                                                                                                        
  source:                                                                                                                                                                                                                                                                                 
    helm:                                                                                                                                                                                                                                                                                 
      valueFiles:                                                                                                                                                                                                                                                                         
      - my-values.yaml                                                                                                                                                                                                                                                     
    path: .                                                                                                                                                                                                                                        
    repoURL: ssh://git@blah.git                                                                                                                                                                                                                        
    targetRevision: HEAD

However, I also need to specify a particular helm value (like you'd do with --set in the helm command. I see in the ArgoCD web UI that it has a spot for Values, but I have tried every combination of entries I can think of (somekey=somevalue, somekey:somevalue, somekey,somevalue). I also tried editing the manifest directly, but I still get similar errors trying to do so. ArgoCD Web UI The error is long nonsense that ends with error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type map[string]interface {}

What is the correct syntax to set a single value, either through the web UI or the manifest file?

1 Answers

you would use parameters via spec.source.helm.parameters

something like:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: my-project
  source:
    repoURL: https://charts.my-company.com
    targetRevision: "1234"
    chart: my-chart
    helm:
      parameters:
        - name: my.helm.key
          value: some-val
  destination:
    name: k8s-dev
    namespace: my-ns

Sample from Argo Docs - https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#build-environment

Related