Document values precedence, nested vars and merge
Example
helm install -f values-site.yaml -f values-global.yaml --set release=beta
Precedence
- set
- values-global.yaml
- values-site.yaml
- values-local.yaml 5 values.yaml
TO EDIT
- Chart's
values.yaml
is always overwritten by values - The first/rightmost instance of a value-as-a-list will merge. There are no merges or overrides by subsequent/left values-as-a-list (in this example multilingual.plugins)
- The last/leftmost instance of a value-as-a-dict will merge and overrides all others (in this example multilingual.enabled)
Intended result
multilingual:
config: |
'WPML_CACHE_PATH_ROOT' "WP_CONTENT_DIR . '/cache'" --raw --type=constant
enabled: true
plugins: '[sitepress-multilingual-cms,wpml-string-translation,wpml-translation-management]'
-
This works
as both website and global values are merged and values.yaml is overridden
Default - values.yaml
multilingual:
enabled: false
Global - values-global.yaml
multilingual:
enabled: false
config: |
'WPML_CACHE_PATH_ROOT' "WP_CONTENT_DIR . '/cache'" --raw --type=constant
Site/Local - values-website.yaml
multilingual:
enabled: true
plugins: '[sitepress-multilingual-cms,wpml-string-translation,wpml-translation-management]'
-
This does not work
and will not give the intended result as website values will not override global values
Default - values.yaml
multilingual:
enabled: false
Global - values-global.yaml
multilingual:
config: |
'WPML_CACHE_PATH_ROOT' "WP_CONTENT_DIR . '/cache'" --raw --type=constant
plugins: '[sitepress-multilingual-cms,wpml-string-translation]'
Site/Local - values-website.yaml
multilingual:
enabled: true
plugins: '[sitepress-multilingual-cms,wpml-string-translation,wpml-translation-management]'