applicationset
applicationset copied to clipboard
Passing Helm values to chart from Git file generator not working
Hi I was trying to use Git file generator to deploy Helm chart with quite complex configuration and I hoped that it would be possible to pass values
from my configuration yaml to template in ApplicationSet controller. If I do this based on the samples below it seems that {{values}}
template is never expanded. Is this a bug or it's just not supported? Thanks
Sample ApplicationSet definition
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: complex-app
spec:
template:
metadata:
name: "complex-app-{{ metadata.name }}"
project: complex-app
destination:
name: "{{ metadata.cluster }}"
namespace: complex-app
source:
repoURL: https://github.com/my/repo.git
path: my/chart
targetRevision: "{{metadata.revision}}"
helm:
values: "{{ values }}"
Sample config file
metadata:
name: my-deployment
cluster: my-cluster
revision: 1.x
values:
some:
nested:
config:
- value1
- value2
At the moment, only string key-value pairs are supported.
Not ideal but you can put a pipe '|' next to values in your config file. That way it will be interpreted as string.. and in fact in your appset you're referring to helm/values not valueFiles, so it really needs a string
@pdrastil try updating your config file to look like this:
metadata:
name: my-deployment
cluster: my-cluster
revision: 1.x
values: |
some:
nested:
config:
- value1
- value2
This will cause all of the key/values within values
to be stored as a single string. This should work with the say you are referencing {{values}}
in your applicationset.