kubernetes-helm

Define a default values.yaml file in a library/dependency chart


I'm working on creating a Helm library chart that will provide reusable components and configurations for other application charts. I want to define default values for the parameters in the library chart's values.yaml file, but I'm unsure about the correct approach to achieve this.

Here's what I'm trying to do: I have a library chart named my-library which I plan to use as a base for multiple application charts. I want to set default values for certain parameters in the values.yaml file of my-library so that these values are used whenever an application chart includes and references this library chart.

when i try using my application chart it will ignore any value provided in the values.yaml of the library chart and treat them as they don't exist, when i run with debug i see them under: my-library but the chart will ignore them. how can i make the chart use the default values of the library chart unless told otherwise?


Solution

  • As David Maze said the solution i used is using the default function in the chart for example { Values.something | default "foo"}