如何在使用Helm

时间:2018-04-30 15:18:43

标签: kubernetes grafana prometheus kubernetes-helm

我正在使用 Helm Kubernetes 部署(Grafana和Prometheus)。我为这两个文件指定了 values.yaml 文件。它的效果非常好。

由于我已将 Grafana 数据源从默认 sqlite3 更改为 PostgreSQL ,因此数据源配置现已存储在 PostgreSQL数据库< /强>

嗯,问题是我的 values.yaml文件* for ** 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 web界面的连接 - 这不是我需要的。如何正确指定此部分?

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

1 个答案:

答案 0 :(得分:1)

在节数据源之后删除“ {}”。 像这样

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