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

Add postgresql datasource example #1076

Merged
merged 2 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
hubeadmin marked this conversation as resolved.
Show resolved Hide resolved
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