Skip to content

Commit

Permalink
docs: add postgresql datasource example (#1076)
Browse files Browse the repository at this point in the history
Co-authored-by: Hubert Stefanski <35736504+HubertStefanski@users.noreply.github.com>
  • Loading branch information
krzwiatrzyk and hubeadmin authored Jul 4, 2023
1 parent f42b7ee commit 3a468ae
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/datasource_types/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: "Datasource types"
linkTitle: "Datasource types"
---

This example shows different types of datasources and how to configure them.

{{< readfile file="prometheus.yaml" code="true" lang="yaml" >}}
{{< readfile file="postgresql.yaml" code="true" lang="yaml" >}}
26 changes: 26 additions & 0 deletions examples/datasource_types/postgresql.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: postgresql
namespace: grafana
spec:
instanceSelector:
matchLabels:
dashboards: "grafana"
datasource:
name: postgresql
type: postgres
database: postgres
editable: false
jsonData:
connMaxLifetime: 14400
maxIdleConns: 2
maxOpenConns: 0
postgresVersion: 1400
sslmode: disable
timescaledb: false
access: proxy
secureJsonData:
password: postgres
url: postgresql.namespace.svc:5432
user: postgres
18 changes: 18 additions & 0 deletions examples/datasource_types/prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaDatasource
metadata:
name: prometheus
spec:
instanceSelector:
matchLabels:
dashboards: "grafana"
datasource:
name: prom1
type: prometheus
access: proxy
url: http://prometheus-service:9090
isDefault: true
jsonData:
'tlsSkipVerify': true
'timeInterval': "5s"
editable: true

0 comments on commit 3a468ae

Please sign in to comment.