Using External Helm Charts

External helm charts can be included by placing them in the dependencies parameter of the ChartInfo object that must be passed to ChartBuilder. Additionally, the values that would normally be passed to the chart dependency in values.yaml can be passed in the ChartDependency object’s values parameter.

For example, this is how you could use the Grafana helm chart:

from avionix import ChartBuilder, ChartDependency, ChartInfo

if __name__ == "__main__":
    builder = ChartBuilder(
        ChartInfo(
            api_version="3.2.4",
            name="my_chart",
            version="0.1.0",
            app_version="v1",
            dependencies=[
                ChartDependency(
                    "grafana",
                    "5.5.2",
                    "https://kubernetes-charts.storage.googleapis.com/",
                    "stable",
                    values={"resources": {"requests": {"memory": "100Mi"}}},
                )
            ],
        ),
        [],
    )
    builder.install_chart({"dependency-update": None})

In this simple example, the following helm commands will be run after building the chart:

helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm install <path_to_my_chart> --dependency-update

The values.yaml will end up as:

grafana:
    resources:
        requests:
            memory: 100Mi