Writing to (or Reading from) values.yaml

avionix supports the use of helm’s values.yaml file for creating an interface for others to pass values to published helm charts. Avionix has objects that must be used in order to interact with and change the values.yaml file. These objects are the Value object and the Values object. Values contains the values that you would normally put in a values.yaml, but in a Python dictionary format and Value is a value that is referencing the values.yaml file. Value takes one parameter which is a string that uses dot notation to specify the value to use from values.yaml.

For example:

from avionix import ChartBuilder, ChartInfo, ObjectMeta, Value, Values
from avionix.kube.core import ConfigMap

config_map = ConfigMap(
    ObjectMeta(name="test-values"),
    {"my_value": Value("my_value"), "my_nested_value": Value("my.nested.value")},
)
values = Values({"my_value": "some_value", "my": {"nested": {"value": 0}}})
chart = ChartBuilder(
    ChartInfo(
        api_version="3.2.4",
        name="values_yaml_example",
        version="0.1.0",
        app_version="v1",
    ),
    [],
    values=values,
)

For more information on values.yaml see the helm documentation here