Как автоматически подключить Grafana (с PostgreSQL вместо SQLite 3) к Prometheus при использовании Helm

Я использую Helm специально для развертывания Kubernetes (Grafana и Prometheus). Я указал файлы values.yaml для них обоих. Работает потрясающе.

Поскольку я изменил источник данных Grafana с sqlite3 по умолчанию на PostgreSQL, конфигурация источника данных теперь хранится в базе данных PostgreSQL. .

Проблема в том, что в моем файле values.yaml * для ** Grafana я указал источник данных следующим образом:

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

К сожалению, это не действует, и мне приходится настраивать подключение к веб-интерфейсу Grafana вручную, а это не то, что мне нужно. Как правильно указать этот раздел?

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

person user2156115    schedule 30.04.2018    source источник


Ответы (1)


удалите '{}' после источников данных раздела. нравится

    datasources:
      datasources.yaml:
        apiVersion: 1
        datasources:
        - name: Prometheus
          type: prometheus
          url: http://prometheus-server
          access: proxy
          isDefault: true
person NINJACOREjZ    schedule 16.11.2018