3

I am using Helm as for Kubernetes deployment (Grafana and Prometheus) specifically. I have specified values.yaml files for both of them. It works amazingly.

Since I have changed Grafana datasource from default sqlite3 to PostgreSQL - data-source configuration is now stored in PostgreSQL database.

Well, the problem is that in my values.yaml file* for **Grafana I have specified datasource as following:

datasources: {}
datasources.yaml:
  apiVersion: 1
  datasources:
  - name: on-premis
    type: prometheus
    url: http://prom-helmf-ns-monitoring-prometheus-server
    access: direct
    isDefault: true
...
...


grafana.ini:
  paths:
    data: /var/lib/grafana/data
    logs: /var/log/grafana
    plugins: /var/lib/grafana/plugins
  analytics:
    check_for_updates: true
  log:
    mode: console
  grafana_net:
    url: https://grafana.net
  database:
  ## You can configure the database connection by specifying type, host, name, user and password
  ## # as separate properties or as on string using the URL property.
  ## # Either "mysql", "postgres" or "sqlite3", it's your choice
    type: postgres
    host: qa.com:5432
    name: grafana
    user: grafana
    # If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;"""
    password: passwd
    ssl_mode: disable

Unfortunately this does not take an effect and I have to configure connection to in Grafana web interface manually - which is not what I need. How do I specify this section correctly?

datasources: {}
datasources.yaml:
  apiVersion: 1
  datasources:
  - name: on-premis
    type: prometheus
    url: http://prom-helmf-ns-monitoring-prometheus-server
    access: direct
    isDefault: true

1 Answer 1

1

remove '{}' after section datasources. like this

    datasources:
      datasources.yaml:
        apiVersion: 1
        datasources:
        - name: Prometheus
          type: prometheus
          url: http://prometheus-server
          access: proxy
          isDefault: true
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.