Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm Installation Fails Due to Template Execution Error #1258

Open
cnadav opened this issue Feb 20, 2025 · 2 comments
Open

Helm Installation Fails Due to Template Execution Error #1258

cnadav opened this issue Feb 20, 2025 · 2 comments

Comments

@cnadav
Copy link

cnadav commented Feb 20, 2025

Issue Description

Attempting to install grafana/k8s-monitoring using Helm fails with a template execution error related to the secrets.kubernetesSecretName function. The error suggests a type mismatch in .object.secret, expecting a map[string]interface{} but receiving an interface{}.

Helm Command Used

helm repo add grafana https://grafana.github.io/helm-charts && \
helm repo update && \
helm upgrade --install --version ^2 --atomic --timeout 300s grafana-k8s-monitoring grafana/k8s-monitoring \
  --namespace "grafana-monitoring" --values grafana-monitoring.yaml

Error Output

"grafana" already exists with the same configuration, skipping
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "grafana" chart repository
Update Complete. ⎈Happy Helming!⎈
Release "grafana-k8s-monitoring" does not exist. Installing it now.
Error: template: k8s-monitoring/templates/validations.yaml:10:6: executing "k8s-monitoring/templates/validations.yaml" at <include (printf "features.%s.validate" $feature) $>: 
error calling include: template: k8s-monitoring/templates/features/_feature_cluster_metrics.tpl:120:38: executing "features.clusterMetrics.validate" at <include "secrets.kubernetesSecretName" (dict "Values" $.Values "Chart" $.Chart "Release" $.Release "object" $destination)>: 
error calling include: template: k8s-monitoring/templates/secrets/_helpers.tpl:151:52: executing "secrets.kubernetesSecretName" at <.object.secret>: 
wrong type for value; expected map[string]interface {}; got interface {}

Additional Context

The grafana-monitoring.yaml file was generated from the Grafana Cloud configuration step.

@petewall
Copy link
Collaborator

Hmm... This is interesting. I can't reproduce with the default config generated. Can you share your values.yaml file?
The validation that is failing is about helping determine how to configure the OpenCost section.

@cnadav
Copy link
Author

cnadav commented Feb 23, 2025

Hmm... This is interesting. I can't reproduce with the default config generated. Can you share your values.yaml file? The validation that is failing is about helping determine how to configure the OpenCost section.

Sure, here is the file content (I've omitted some data related to the project):

cluster:
name: dev-kubernetes
destinations:

  • name: <>
    type: prometheus
    url: https://<>.grafana.net/api/prom/push
    auth:
    type: basic
    username: "2225419"
    password: <>
  • name:<>-logs
    type: loki
    url: https://<>.grafana.net/loki/api/v1/push
    auth:
    type: basic
    username: "1108387"
    password: <>
  • name: <>-traces
    type: otlp
    url: https://<>.grafana.net:443
    protocol: grpc
    auth:
    type: basic
    username: "1102702"
    password: <>
    metrics:
    enabled: false
    logs:
    enabled: false
    traces:
    enabled: true
  • name: <>-profiles
    type: pyroscope
    url: https://<>.grafana.net:443
    auth:
    type: basic
    username: "1150588"
    password: <>
    clusterMetrics:
    enabled: true
    opencost:
    enabled: true
    metricsSource: <>
    opencost:
    exporter:
    defaultClusterId: dev-kubernetes
    prometheus:
    existingSecretName: <>-grafana-k8s-monitoring
    external:
    url: https://<>.grafana.net/api/prom
    kepler:
    enabled: true
    clusterEvents:
    enabled: true
    podLogs:
    enabled: true
    applicationObservability:
    enabled: true
    receivers:
    otlp:
    grpc:
    enabled: true
    port: 4317
    http:
    enabled: true
    port: 4318
    zipkin:
    enabled: true
    port: 9411
    processors:
    grafanaCloudMetrics:
    enabled: true
    autoInstrumentation:
    enabled: true
    profiling:
    enabled: true
    integrations:
    alloy:
    instances:
    • name: alloy
      labelSelectors:
      app.kubernetes.io/name:
      - alloy-metrics
      - alloy-singleton
      - alloy-logs
      - alloy-receiver
      - alloy-profiles
      alloy-metrics:
      enabled: true
      alloy-singleton:
      enabled: true
      alloy-logs:
      enabled: true
      alloy-receiver:
      enabled: true
      alloy:
      extraPorts:
    • name: otlp-grpc
      port: 4317
      targetPort: 4317
      protocol: TCP
    • name: otlp-http
      port: 4318
      targetPort: 4318
      protocol: TCP
    • name: zipkin
      port: 9411
      targetPort: 9411
      protocol: TCP
      alloy-profiles:
      enabled: true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants