4
votes

Im using the following code to install chart that is bounded in my source code (eg. in my app/chart/chart1 in my go bin app), Now I need to move the chart to git repository or to artifactory,

My question is how can I install the chart from outside my program?

This is the code I use which works for bundled chart

I use the helm3 loader package which works when I have the chart bundled in my app

chart, err := loader.Load(“chart/chart1”)

https://pkg.go.dev/helm.sh/helm/[email protected]/pkg/chart/loader

Should I load it somehow with an http call or helm have some built in functionality ? we need some efficient way to handle it

2

2 Answers

2
votes

It seems that helm during its upgrade/install commands checks first a couple of different locations which you can see getting called here. The content of that function is here. And then continues here with loader.Load

2
votes

You can use something like this for installing nginx chart


    myChart, err := loader.Load("https://charts.bitnami.com/bitnami/nginx-8.8.4.tgz")
...
    install := action.NewInstall(m.actionConfig)
    install.ReleaseName = "my-release"
...
    myRelease, err := install.Run(myChart, myValues)

It would be similar to:

helm install my-release https://charts.bitnami.com/bitnami/nginx-8.8.4.tgz