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

bug: Grafana datasource not deploying #1875

Closed
beasteers opened this issue Dec 17, 2024 · 3 comments
Closed

bug: Grafana datasource not deploying #1875

beasteers opened this issue Dec 17, 2024 · 3 comments

Comments

@beasteers
Copy link

Chart name and version
chart: victoria-metrics-k8s-stack
version: v0.31.0

Describe the bug
Grafana datasource doesn't deploy by default:

    message: 'Helm upgrade failed for release monitoring/victoria-metrics with chart
      victoria-metrics-k8s-stack@0.31.0: YAML parse error on victoria-metrics-k8s-stack/templates/grafana/datasource.yaml:
      error converting YAML to JSON: yaml: line 6: did not find expected key'

It's missing a default value for grafana.sidecar.datasources.label: grafana_datasource

By default it does this:

apiVersion: v1
kind: ConfigMap
metadata:
  name: release-name-victoria-metrics-k8s-stack-grafana-ds
  namespace: monitoring
  labels:
    : "1"

Custom values
Please provide only custom values (excluding default ones):

    grafana:
      enabled: false
      forceDeployDatasource: true
      sidecar:
        datasources:
          label: grafana_datasource  # <<< MISSING
@AndrewChubatiuk
Copy link
Collaborator

hey @beasteers
how do you deploy a chart? please share cmd flags you're passing to Helm or spec in case of fluxcd, argocd, etc

@beasteers
Copy link
Author

I suspect it's because I disabled the grafana subchart and used forceDeployDatasource.

Just a guess, but perhaps normally it pulls this value (label: grafana_datasource) from the grafana subchart. It might be worth setting a default value here:

{{ $.Values.grafana.sidecar.datasources.label }}: "1"

Here's our full Flux HelmRelease.

apiVersion: helm.toolkit.fluxcd.io/v2beta1
kind: HelmRelease
metadata:
  name: victoria-metrics
  namespace: monitoring
spec:
  interval: 15m0s
  releaseName: victoria-metrics
  targetNamespace: monitoring
  chart:
    spec:
      chart: victoria-metrics-k8s-stack
      version: "0.31.0"
      sourceRef:
        kind: HelmRepository
        name: victoria-metrics
        namespace: cluster-config
  install:
    remediation:
      retries: 3
  values:
    defaultDashboards:
      enabled: true

    defaultDatasources:
      victoriametrics:
        datasources:
          - name: Prometheus
            type: prometheus
            isDefault: false

    prometheus-operator-crds:
      enabled: true

    grafana:
      enabled: false
      forceDeployDatasource: true
      sidecar:
        datasources:
          label: grafana_datasource

    prometheus-node-exporter:
      enabled: true
    kube-state-metrics:
      enabled: true
    kubeScheduler:
      enabled: true
    kubelet:
      enabled: true
    kubeApiServer:
      enabled: false #true
    coreDns:
      enabled: false #true
    kubeEtcd:
      enabled: false #true
    kubeControllerManager:
      enabled: false
    kubeDns:
      enabled: false
    kubeProxy:
      enabled: false

    vmsingle:
      spec:
        retentionPeriod: "2w"
        replicaCount: 1
        storage:
          storageClassName: ssd-retain
          accessModes: ["ReadWriteOnce"]
          resources:
            requests:
              storage: 25Gi
        resources:
          requests:
            cpu: 100m
            memory: 600Mi
          limits:
            cpu: 500m
            memory: 600Mi

@AndrewChubatiuk
Copy link
Collaborator

copied grafana.sidecar.datasources.label default value from grafana subchart to cover this case, will be available in the next release

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