grafana / k8s-monitoring-helm

Apache License 2.0
120 stars 50 forks source link

helm install fails "k8s-monitoring/templates/tests/test.yaml" at <index .Subcharts "grafana-agent">" #494

Open LingamEswar opened 1 month ago

LingamEswar commented 1 month ago

HI team, We are trying to install k8s-monitoring chart of v0.12.0 and while installing we are facing an issue

Error: template: k8s-monitoring/templates/tests/test.yaml:106:54: executing "k8s-monitoring/templates/tests/test.yaml" at <index .Subcharts "grafana-agent">: error calling index: index of untyped nil

I have check in the repo list and i am able to see the grafana-agent chart as well. But not sure why the issue is.

Can you please help here as soon as possible.

Tried with 0.9.3 and latest version as well. But resulted in same issue.

petewall commented 1 month ago

HI Team & @skl , We are also facing the same issue. Helm Version : Version:"v3.11.3", GitCommit:"323249351482b3bbfc9f5004f65d400aa70f9ae7", GitTreeState:"clean", GoVersion:"go1.20.3"

Error: executing "k8s-monitoring/templates/tests/test.yaml" at <index .Subcharts "grafana-agent">: error calling index: index of untyped nil

Any help is much appreciated.

petewall commented 1 month ago

I just tested with Helm 3.11.3 and it worked fine. The line in question is: https://github.com/grafana/k8s-monitoring-helm/blob/v0.12.0/charts/k8s-monitoring/templates/tests/test.yaml#L106

Specifically, this section (index .Subcharts "grafana-agent"), which has Helm access the grafana-agent templates within the .Subcharts object. This is needed because we invoke the grafana-agent.fullname template.

With index of untyped nil: that makes me thing that .Subcharts is not defined.

petewall commented 1 month ago

How are you trying to deploy the chart? with the Helm cli? with Terraform or ArgoCD?

LingamEswar commented 1 month ago

How are you trying to deploy the chart? with the Helm cli? with Terraform or ArgoCD?

we are trying to deploy to aws eks cluster using https://github.com/unbroken-dome/gradle-helm-plugin Using above plugin, we are creating gradle task and deploying using that gradle task.

LingamEswar commented 1 month ago

I just tested with Helm 3.11.3 and it worked fine. The line in question is: https://github.com/grafana/k8s-monitoring-helm/blob/v0.12.0/charts/k8s-monitoring/templates/tests/test.yaml#L106

Specifically, this section (index .Subcharts "grafana-agent"), which has Helm access the grafana-agent templates within the .Subcharts object. This is needed because we invoke the grafana-agent.fullname template.

With index of untyped nil: that makes me thing that .Subcharts is not defined.

But, i see the grafana-agent chart in the repo list. So if it is already there, why it is showing up an error.

LingamEswar commented 1 month ago

@petewall any update on this?

petewall commented 1 month ago

I'm not familiar with the gradle-helm-plugin. Does the helm install work correctly when using the Helm cli directly?

The error message is not indicating that it can't find the grafana-agent sub chart, it's indicating that it doesn't know what .Subcharts is. That's why I asked about the Helm cli version, since .Subcharts was introduced in version 3.7

petewall commented 1 month ago

Did you try this? Does it work with the Helm CLI?