Skip to content

Commit 94bffce

Browse files
authored
feat: add grafana deployment (#181)
1 parent 662a3f0 commit 94bffce

File tree

10 files changed

+4685
-2
lines changed

10 files changed

+4685
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
- name: Testing add greptime helm repo
2828
run: |
2929
helm repo add greptime https://greptimeteam.github.io/helm-charts/
30+
helm repo add grafana https://grafana.github.io/helm-charts/
3031
helm search repo greptime
3132
3233
- uses: actions/setup-python@v4
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dependencies:
2+
- name: grafana
3+
repository: https://grafana.github.io/helm-charts
4+
version: 8.5.8
5+
digest: sha256:b179fe8efb2cf11a027a8c49ee1cba728dab1be054f625c92fc9fdfffd0f1ab5
6+
generated: "2024-10-26T14:46:51.314884+08:00"

charts/greptimedb-cluster/Chart.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: greptimedb-cluster
33
description: A Helm chart for deploying GreptimeDB cluster in Kubernetes.
44
type: application
5-
version: 0.2.23
5+
version: 0.2.24
66
appVersion: 0.9.5
77
home: https://github.com/GreptimeTeam/greptimedb
88
sources:
@@ -17,3 +17,9 @@ maintainers:
1717
- name: zyy17
1818
1919
url: https://github.com/zyy17
20+
21+
dependencies:
22+
- name: grafana
23+
version: "8.5.8"
24+
repository: https://grafana.github.io/helm-charts
25+
condition: grafana.enabled

charts/greptimedb-cluster/README.md

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A Helm chart for deploying GreptimeDB cluster in Kubernetes.
44

5-
![Version: 0.2.23](https://img.shields.io/badge/Version-0.2.23-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square)
5+
![Version: 0.2.24](https://img.shields.io/badge/Version-0.2.24-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.9.5](https://img.shields.io/badge/AppVersion-0.9.5-informational?style=flat-square)
66

77
## Source Code
88

@@ -69,6 +69,12 @@ If you set `storage.s3.root` as `mycluser`, then the data layout will be:
6969
helm uninstall mycluster -n default
7070
```
7171

72+
## Requirements
73+
74+
| Repository | Name | Version |
75+
|------------|------|---------|
76+
| https://grafana.github.io/helm-charts | grafana | 8.5.8 |
77+
7278
## Values
7379

7480
| Key | Type | Default | Description |
@@ -177,6 +183,27 @@ helm uninstall mycluster -n default
177183
| frontend.replicas | int | `1` | Frontend replicas |
178184
| frontend.service | object | `{}` | Frontend service |
179185
| frontend.tls | object | `{}` | Frontend tls configure |
186+
| grafana | object | `{"adminPassword":"gt-operator","adminUser":"admin","dashboardProviders":{"dashboardproviders.yaml":{"apiVersion":1,"providers":[{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-metrics","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-metrics"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-logs","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-logs"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-slow-queries","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-slow-queries"},"orgId":1,"type":"file"}]}},"dashboardsConfigMaps":{"greptimedb-cluster-logs":"greptimedb-cluster-logs-dashboard","greptimedb-cluster-metrics":"greptimedb-cluster-metrics-dashboard","greptimedb-cluster-slow-queries":"greptimedb-cluster-slow-queries-dashboard"},"datasources":{"datasources.yaml":{"datasources":[{"access":"proxy","isDefault":true,"name":"greptimedb-metrics","type":"prometheus","url":"http://mycluster-monitor-standalone.default.svc.cluster.local:4000/v1/prometheus"},{"access":"proxy","database":"public","name":"greptimedb-logs","type":"mysql","url":"mycluster-monitor-standalone.default.svc.cluster.local:4002"}]}},"enabled":false,"image":{"registry":"docker.io","repository":"grafana/grafana","tag":"11.1.3"},"initChownData":{"enabled":false},"persistence":{"accessModes":["ReadWriteOnce"],"enabled":true,"size":"10Gi"},"service":{"annotations":{},"enabled":true,"type":"ClusterIP"}}` | Deploy grafana for monitoring. |
187+
| grafana.adminPassword | string | `"gt-operator"` | The default admin password for grafana. |
188+
| grafana.adminUser | string | `"admin"` | The default admin username for grafana. |
189+
| grafana.dashboardProviders | object | `{"dashboardproviders.yaml":{"apiVersion":1,"providers":[{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-metrics","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-metrics"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-logs","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-logs"},"orgId":1,"type":"file"},{"disableDeletion":false,"editable":true,"name":"greptimedb-cluster-slow-queries","options":{"path":"/var/lib/grafana/dashboards/greptimedb-cluster-slow-queries"},"orgId":1,"type":"file"}]}}` | The grafana dashboard providers. |
190+
| grafana.dashboardsConfigMaps | object | `{"greptimedb-cluster-logs":"greptimedb-cluster-logs-dashboard","greptimedb-cluster-metrics":"greptimedb-cluster-metrics-dashboard","greptimedb-cluster-slow-queries":"greptimedb-cluster-slow-queries-dashboard"}` | The grafana dashboards configmaps that will be created to store the dashboards. |
191+
| grafana.datasources | object | `{"datasources.yaml":{"datasources":[{"access":"proxy","isDefault":true,"name":"greptimedb-metrics","type":"prometheus","url":"http://mycluster-monitor-standalone.default.svc.cluster.local:4000/v1/prometheus"},{"access":"proxy","database":"public","name":"greptimedb-logs","type":"mysql","url":"mycluster-monitor-standalone.default.svc.cluster.local:4002"}]}}` | The grafana datasources. |
192+
| grafana.enabled | bool | `false` | Enable grafana deployment. It needs to enable monitoring `monitoring.enabled: true` first. |
193+
| grafana.image | object | `{"registry":"docker.io","repository":"grafana/grafana","tag":"11.1.3"}` | The grafana image. |
194+
| grafana.image.registry | string | `"docker.io"` | The grafana image registry. |
195+
| grafana.image.repository | string | `"grafana/grafana"` | The grafana image repository. |
196+
| grafana.image.tag | string | `"11.1.3"` | The grafana image tag. |
197+
| grafana.initChownData | object | `{"enabled":false}` | Init chown data for grafana. |
198+
| grafana.initChownData.enabled | bool | `false` | Enable init chown data for grafana. |
199+
| grafana.persistence | object | `{"accessModes":["ReadWriteOnce"],"enabled":true,"size":"10Gi"}` | The grafana persistence configuration. |
200+
| grafana.persistence.accessModes | list | `["ReadWriteOnce"]` | The access modes for the grafana persistence. |
201+
| grafana.persistence.enabled | bool | `true` | Whether to enable the persistence for grafana. |
202+
| grafana.persistence.size | string | `"10Gi"` | The storage size for the grafana persistence. |
203+
| grafana.service | object | `{"annotations":{},"enabled":true,"type":"ClusterIP"}` | The grafana service configuration. |
204+
| grafana.service.annotations | object | `{}` | The annotations for the grafana service. |
205+
| grafana.service.enabled | bool | `true` | Whether to create the service for grafana. |
206+
| grafana.service.type | string | `"ClusterIP"` | The type of the service. |
180207
| grpcServicePort | int | `4001` | GreptimeDB grpc service port |
181208
| httpServicePort | int | `4000` | GreptimeDB http service port |
182209
| image.pullSecrets | list | `[]` | The image pull secrets |
Lines changed: 293 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
{
2+
"annotations": {
3+
"list": [
4+
{
5+
"builtIn": 1,
6+
"datasource": {
7+
"type": "grafana",
8+
"uid": "-- Grafana --"
9+
},
10+
"enable": true,
11+
"hide": true,
12+
"iconColor": "rgba(0, 211, 255, 1)",
13+
"name": "Annotations & Alerts",
14+
"type": "dashboard"
15+
}
16+
]
17+
},
18+
"editable": true,
19+
"fiscalYearStartMonth": 0,
20+
"graphTooltip": 0,
21+
"id": 2,
22+
"links": [],
23+
"panels": [
24+
{
25+
"datasource": {
26+
"default": false,
27+
"type": "mysql",
28+
"uid": "${datasource}"
29+
},
30+
"gridPos": {
31+
"h": 20,
32+
"w": 24,
33+
"x": 0,
34+
"y": 0
35+
},
36+
"id": 1,
37+
"options": {
38+
"dedupStrategy": "none",
39+
"enableLogDetails": true,
40+
"prettifyLogMessage": false,
41+
"showCommonLabels": false,
42+
"showLabels": false,
43+
"showTime": true,
44+
"sortOrder": "Descending",
45+
"wrapLogMessage": false
46+
},
47+
"targets": [
48+
{
49+
"dataset": "greptime_private",
50+
"datasource": {
51+
"type": "mysql",
52+
"uid": "${datasource}"
53+
},
54+
"editorMode": "code",
55+
"format": "table",
56+
"rawQuery": true,
57+
"rawSql": "SELECT `timestamp`, CONCAT('[', `level`, ']', ' ', `target`, ' ', `message`),\n `role`,\n `pod`,\n `pod_ip`,\n `namespace`,\n `cluster`,\n `err`,\n `file`,\n `module_path`\nFROM\n `_gt_logs`\nWHERE\n (\n \"$level\" = \"'all'\"\n OR `level` IN ($level)\n ) \n AND (\n \"$role\" = \"'all'\"\n OR `role` IN ($role)\n )\n AND (\n \"$pods\" = \"'all'\"\n OR `pod` IN ($pods)\n )\n AND (\n \"$search\" = \"\"\n OR MATCHES(`message`, \"$search\")\n )\n AND $__timeFilter(`timestamp`)\nORDER BY\n `timestamp`\nLIMIT $limit;\n",
58+
"refId": "A",
59+
"sql": {
60+
"columns": [
61+
{
62+
"parameters": [],
63+
"type": "function"
64+
}
65+
],
66+
"groupBy": [
67+
{
68+
"property": {
69+
"type": "string"
70+
},
71+
"type": "groupBy"
72+
}
73+
],
74+
"limit": 50
75+
}
76+
}
77+
],
78+
"title": "Logs",
79+
"type": "logs"
80+
}
81+
],
82+
"schemaVersion": 39,
83+
"tags": [],
84+
"templating": {
85+
"list": [
86+
{
87+
"current": {
88+
"selected": false,
89+
"text": "greptimedb-cluster-logs",
90+
"value": "ddxce12e8bl6oe"
91+
},
92+
"hide": 0,
93+
"includeAll": false,
94+
"multi": false,
95+
"name": "datasource",
96+
"options": [],
97+
"query": "mysql",
98+
"queryValue": "",
99+
"refresh": 1,
100+
"regex": "",
101+
"skipUrlSync": false,
102+
"type": "datasource"
103+
},
104+
{
105+
"allValue": "'all'",
106+
"current": {
107+
"selected": true,
108+
"text": [
109+
"All"
110+
],
111+
"value": [
112+
"$__all"
113+
]
114+
},
115+
"hide": 0,
116+
"includeAll": true,
117+
"label": "level",
118+
"multi": true,
119+
"name": "level",
120+
"options": [
121+
{
122+
"selected": true,
123+
"text": "All",
124+
"value": "$__all"
125+
},
126+
{
127+
"selected": false,
128+
"text": "INFO",
129+
"value": "INFO"
130+
},
131+
{
132+
"selected": false,
133+
"text": "ERROR",
134+
"value": "ERROR"
135+
},
136+
{
137+
"selected": false,
138+
"text": "WARN",
139+
"value": "WARN"
140+
},
141+
{
142+
"selected": false,
143+
"text": "DEBUG",
144+
"value": "DEBUG"
145+
},
146+
{
147+
"selected": false,
148+
"text": "TRACE",
149+
"value": "TRACE"
150+
}
151+
],
152+
"query": "INFO,ERROR,WARN,DEBUG,TRACE",
153+
"queryValue": "",
154+
"skipUrlSync": false,
155+
"type": "custom"
156+
},
157+
{
158+
"allValue": "'all'",
159+
"current": {
160+
"selected": true,
161+
"text": [
162+
"All"
163+
],
164+
"value": [
165+
"$__all"
166+
]
167+
},
168+
"hide": 0,
169+
"includeAll": true,
170+
"label": "role",
171+
"multi": true,
172+
"name": "role",
173+
"options": [
174+
{
175+
"selected": true,
176+
"text": "All",
177+
"value": "$__all"
178+
},
179+
{
180+
"selected": false,
181+
"text": "datanode",
182+
"value": "datanode"
183+
},
184+
{
185+
"selected": false,
186+
"text": "frontend",
187+
"value": "frontend"
188+
},
189+
{
190+
"selected": false,
191+
"text": "meta",
192+
"value": "meta"
193+
}
194+
],
195+
"query": "datanode,frontend,meta",
196+
"queryValue": "",
197+
"skipUrlSync": false,
198+
"type": "custom"
199+
},
200+
{
201+
"allValue": "'all'",
202+
"current": {
203+
"selected": true,
204+
"text": [
205+
"All"
206+
],
207+
"value": [
208+
"$__all"
209+
]
210+
},
211+
"datasource": {
212+
"type": "mysql",
213+
"uid": "${datasource}"
214+
},
215+
"definition": "SELECT DISTINCT pod FROM _gt_logs WHERE (\"$role\" = \"'all'\" OR `role` IN ($role))",
216+
"hide": 0,
217+
"includeAll": true,
218+
"multi": true,
219+
"name": "pods",
220+
"options": [],
221+
"query": "SELECT DISTINCT pod FROM _gt_logs WHERE (\"$role\" = \"'all'\" OR `role` IN ($role))",
222+
"refresh": 1,
223+
"regex": "",
224+
"skipUrlSync": false,
225+
"sort": 0,
226+
"type": "query"
227+
},
228+
{
229+
"current": {
230+
"selected": true,
231+
"text": "1000",
232+
"value": "1000"
233+
},
234+
"hide": 0,
235+
"includeAll": false,
236+
"label": "limit",
237+
"multi": false,
238+
"name": "limit",
239+
"options": [
240+
{
241+
"selected": true,
242+
"text": "1000",
243+
"value": "1000"
244+
},
245+
{
246+
"selected": false,
247+
"text": "3000",
248+
"value": "3000"
249+
},
250+
{
251+
"selected": false,
252+
"text": "5000",
253+
"value": "5000"
254+
}
255+
],
256+
"query": "1000,3000,5000",
257+
"queryValue": "",
258+
"skipUrlSync": false,
259+
"type": "custom"
260+
},
261+
{
262+
"current": {
263+
"selected": false,
264+
"text": "",
265+
"value": ""
266+
},
267+
"hide": 0,
268+
"label": "search",
269+
"name": "search",
270+
"options": [
271+
{
272+
"selected": true,
273+
"text": "",
274+
"value": ""
275+
}
276+
],
277+
"query": "",
278+
"skipUrlSync": false,
279+
"type": "textbox"
280+
}
281+
]
282+
},
283+
"time": {
284+
"from": "now-6h",
285+
"to": "now"
286+
},
287+
"timepicker": {},
288+
"timezone": "browser",
289+
"title": "GreptimeDB Cluster Logs",
290+
"uid": "edx5veo4rd3wge",
291+
"version": 4,
292+
"weekStart": ""
293+
}

0 commit comments

Comments
 (0)