community icon indicating copy to clipboard operation
community copied to clipboard

how to set value of subchart based on value of parent chart?

Open shaofeng66 opened this issue 3 weeks ago • 0 comments

My chart has elasticsearch as subchart:

- name: elasticsearch
  repository: oci://registry-1.docker.io/bitnamicharts
  version: 21.4.x
  condition: tags.elasticsearch

and my chart has a flag "highAvailability", if user set it to true, I want to set elasticsearch.master.replicaCount = 3, otherwise set it to 1.

There are many similar values in subcharts, so I want to user can tigger ha mode by setting single "highAvailability", instead of set many flags one by one.

Now I have a values-ha.yaml which includes all the values that should be set when "highAvailability" is set to true, however my user need to obtain this values-ha.yaml file from somewhere before helm install, either by downloading the whole helm package file and extract this values-ha.yaml file to disk, or get it from other distribute channel, then use the "-f" flag of helm command.

What is the best practice?

shaofeng66 avatar Dec 16 '25 03:12 shaofeng66