Skip to content

Commit 7fce9d9

Browse files
jianxiaoguoduanhongyi
authored andcommitted
feat(grafana): data source change to prometheus
1 parent cc2fbff commit 7fce9d9

19 files changed

Lines changed: 66040 additions & 4680 deletions

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ Grafana is a stand alone graphing application. It natively supports Influxdb as
3232
└──────────┘ └─────────┘ └──────────────┘
3333
3434
┌──────────┐ │
35-
│ HOST │
36-
│ Telegraf │───┐
35+
│ HOST │───┐
36+
│ Telegraf │
3737
└──────────┘ │ │
3838
│ ▼
3939
┌──────────┐ │ ┌──────────┐ ┌──────────┐
40-
│ HOST │───┼───▶│ Influxdb │◀──────Wire──────────│ Telegraf │
41-
│ Telegraf │ │ └──────────┘ Protocol └──────────┘
40+
│ HOST │───┼───▶│ Influxdb │◀────────Wire────────│ Telegraf │
41+
│ Telegraf │ │ └──────────┘ Protocol └──────────┘
4242
└──────────┘ │ │
4343
│ │
4444
┌──────────┐ │ ▼

charts/monitor/templates/_helpers.tmpl

Lines changed: 9 additions & 120 deletions
Original file line numberDiff line numberDiff line change
@@ -5,40 +5,25 @@ env:
55
valueFrom:
66
fieldRef:
77
fieldPath: metadata.namespace
8-
{{- if eq .Values.global.influxdbLocation "off-cluster" }}
9-
- name: "INFLUXDB_URL"
8+
{{- if eq .Values.global.prometheusLocation "off-cluster" }}
9+
- name: "PROMETHEUS_URL"
1010
valueFrom:
1111
secretKeyRef:
12-
name: influxdb-creds
12+
name: prometheus-creds
1313
key: url
1414
{{- else }}
15-
- name: "INFLUXDB_URL"
16-
value: http://$(DRYCC_INFLUXDB_SERVICE_HOST):$(DRYCC_INFLUXDB_SERVICE_PORT)
15+
- name: "PROMETHEUS_URL"
16+
value: http://$(DRYCC_PROMETHEUS_SERVICE_HOST):$(DRYCC_PROMETHEUS_SERVICE_PORT)
1717
{{- end }}
18-
- name: "INFLUXDB_BUCKET"
19-
valueFrom:
20-
secretKeyRef:
21-
name: influxdb-creds
22-
key: bucket
23-
- name: "INFLUXDB_ORG"
24-
valueFrom:
25-
secretKeyRef:
26-
name: influxdb-creds
27-
key: org
28-
- name: "INFLUXDB_TOKEN"
29-
valueFrom:
30-
secretKeyRef:
31-
name: influxdb-creds
32-
key: token
3318
- name: "BIND_PORT"
3419
value: "3000"
3520
{{- if not (.Values.grafana.environment.DEFAULT_USER) }}
3621
- name: "DEFAULT_USER"
37-
value: {{ randAlphaNum 32 | b64enc }}
22+
value: {{ randAlphaNum 32 }}
3823
{{- end}}
3924
{{- if not (.Values.grafana.environment.DEFAULT_USER_PASSWORD) }}
4025
- name: "DEFAULT_USER_PASSWORD"
41-
value: {{ randAlphaNum 32 | b64enc }}
26+
value: {{ randAlphaNum 32 }}
4227
{{- end}}
4328
- name: "KUBERNETES_CLUSTER_DOMAIN"
4429
value: {{.Values.global.clusterDomain}}
@@ -77,8 +62,8 @@ env:
7762
- name: DRYCC_PASSPORT_SECRET
7863
value: "{{ .Values.grafana.passportSecret }}"
7964
{{- end }}
80-
- name: "INFLUXDB_LOCATION"
81-
value: {{ .Values.global.influxdbLocation }}
65+
- name: "PROMETHEUS_LOCATION"
66+
value: {{ .Values.global.prometheusLocation }}
8267
- name: "REDIS_LOCATION"
8368
value: {{ .Values.global.redisLocation }}
8469
- name: "RABBITMQ_LOCATION"
@@ -92,99 +77,3 @@ env:
9277
- name: "REGISTRY_LOCATION"
9378
value: {{ .Values.global.registryLocation }}
9479
{{- end }}
95-
96-
{{/* Generate monitor telegraf deployment envs */}}
97-
{{- define "telegraf.deployment.envs" }}
98-
env:
99-
- name: POD_NAMESPACE
100-
valueFrom:
101-
fieldRef:
102-
fieldPath: metadata.namespace
103-
{{- if eq .Values.global.influxdbLocation "off-cluster" }}
104-
- name: "INFLUXDB_URLS_V2"
105-
valueFrom:
106-
secretKeyRef:
107-
name: influxdb-creds
108-
key: url
109-
{{- else }}
110-
- name: "INFLUXDB_URLS_V2"
111-
value: "\"http://$(DRYCC_INFLUXDB_SERVICE_HOST):$(DRYCC_INFLUXDB_SERVICE_PORT)\""
112-
- name: "INFLUXDB_V2_INPUT_URLS"
113-
value: "\"http://$(DRYCC_INFLUXDB_SERVICE_HOST):$(DRYCC_INFLUXDB_SERVICE_PORT)/metrics\""
114-
- name: "ENABLE_INFLUXDB_V2_INPUT"
115-
value: "true"
116-
{{- end }}
117-
- name: "INFLUXDB_BUCKET"
118-
valueFrom:
119-
secretKeyRef:
120-
name: influxdb-creds
121-
key: bucket
122-
- name: "INFLUXDB_ORG"
123-
valueFrom:
124-
secretKeyRef:
125-
name: influxdb-creds
126-
key: org
127-
- name: "INFLUXDB_TOKEN"
128-
valueFrom:
129-
secretKeyRef:
130-
name: influxdb-creds
131-
key: token
132-
- name: "AGENT_QUIET"
133-
value: "true"
134-
- name: "AGENT_BUFFER_LIMIT"
135-
value: "100000"
136-
{{- if eq .Values.global.redisLocation "on-cluster" }}
137-
- name: DRYCC_REDIS_ADDRS
138-
valueFrom:
139-
secretKeyRef:
140-
name: redis-creds
141-
key: addrs
142-
- name: DRYCC_REDIS_PASSWORD
143-
valueFrom:
144-
secretKeyRef:
145-
name: redis-creds
146-
key: password
147-
{{- end }}
148-
{{- if eq .Values.global.storageLocation "on-cluster" }}
149-
- name: DRYCC_STORAGE_LOOKUP
150-
valueFrom:
151-
secretKeyRef:
152-
name: storage-creds
153-
key: lookup
154-
- name: DRYCC_STORAGE_HEALTH
155-
valueFrom:
156-
secretKeyRef:
157-
name: storage-creds
158-
key: health
159-
- name: DRYCC_STORAGE_BUCKET
160-
valueFrom:
161-
secretKeyRef:
162-
name: storage-creds
163-
key: builder-bucket
164-
- name: DRYCC_STORAGE_ENDPOINT
165-
valueFrom:
166-
secretKeyRef:
167-
name: storage-creds
168-
key: endpoint
169-
- name: DRYCC_STORAGE_ACCESSKEY
170-
valueFrom:
171-
secretKeyRef:
172-
name: storage-creds
173-
key: accesskey
174-
- name: DRYCC_STORAGE_SECRETKEY
175-
valueFrom:
176-
secretKeyRef:
177-
name: storage-creds
178-
key: secretkey
179-
- name: DRYCC_STORAGE_PD_ADDRS
180-
valueFrom:
181-
secretKeyRef:
182-
name: storage-meta-creds
183-
key: pd-addrs
184-
- name: DRYCC_STORAGE_TIKV_ADDRS
185-
valueFrom:
186-
secretKeyRef:
187-
name: storage-meta-creds
188-
key: tikv-addrs
189-
{{- end }}
190-
{{- end }}

charts/monitor/templates/monitor-telegraf-daemon.yaml

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -96,40 +96,9 @@ spec:
9696
secretKeyRef:
9797
name: influxdb-creds
9898
key: token
99-
- name: "HOST_PROC"
100-
value: "/rootfs/proc"
101-
- name: "HOST_SYS"
102-
value: "/rootfs/sys"
10399
- name: "AGENT_QUIET"
104100
value: "true"
105101
- name: "AGENT_BUFFER_LIMIT"
106102
value: "100000"
107103
- name: "ENABLE_KUBERNETES"
108104
value: "true"
109-
- name: "ENABLE_BARE_METAL_SERVER"
110-
value: "true"
111-
volumeMounts:
112-
- mountPath: /var/run/docker.sock
113-
name: docker-socket
114-
- name: sysro
115-
mountPath: /rootfs/sys
116-
readOnly: true
117-
- name: procro
118-
mountPath: /rootfs/proc
119-
readOnly: true
120-
- name: varrunutmpro
121-
mountPath: /var/run/utmp
122-
readOnly: true
123-
volumes:
124-
- name: docker-socket
125-
hostPath:
126-
path: /var/run/docker.sock
127-
- name: sysro
128-
hostPath:
129-
path: /sys
130-
- name: procro
131-
hostPath:
132-
path: /proc
133-
- name: varrunutmpro
134-
hostPath:
135-
path: /var/run/utmp

charts/monitor/templates/monitor-telegraf-deployment.yaml

Lines changed: 0 additions & 60 deletions
This file was deleted.

charts/monitor/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ global:
7878
# - on-cluster: Run component within the Kubernetes cluster
7979
# - off-cluster: component is running outside of the cluster and credentials and connection information will be provided.
8080
influxdbLocation: "on-cluster"
81+
prometheusLocation: "on-cluster"
8182
grafanaLocation: "on-cluster"
8283
redisLocation: "on-cluster"
8384
rabbitmqLocation: "on-cluster"

grafana/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Grafana
22

33
## Description
4-
[Grafana](https://grafana.org/) is a graphing application built for time series data. It natively supports influxdb and provides great dashboarding support. This project is focused on provided a grafana installation that can be run within a kubernetes installation. The grafana application is agnostic to [Workflow](https://github.com/drycc/workflow) and can be installed as a stand alone system with the monitoring suite.
4+
[Grafana](https://grafana.org/) is a graphing application built for time series data. It natively supports prometheus and provides great dashboarding support. This project is focused on provided a grafana installation that can be run within a kubernetes installation. The grafana application is agnostic to [Workflow](https://github.com/drycc/workflow) and can be installed as a stand alone system with the monitoring suite.
55

66
## Configuration
77
| ENV Var | Default Value | Description |

0 commit comments

Comments
 (0)