Skip to content

Commit 83f76d0

Browse files
committed
style(monitor): format charts and dashboard
1 parent 293dcd5 commit 83f76d0

4 files changed

Lines changed: 24 additions & 21 deletions

File tree

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{{- if (.Values.global.use_rbac) -}}
2+
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
3+
kind: ClusterRole
4+
apiVersion: {{ template "rbacAPIVersion" . }}
5+
metadata:
6+
name: drycc:drycc-monitor-telegraf
7+
labels:
8+
rbac.authorization.k8s.io/aggregate-view-telegraf-stats: "true"
9+
app: drycc-monitor-telegraf
10+
heritage: drycc
11+
rules:
12+
- apiGroups: ["metrics.k8s.io"]
13+
resources: ["pods"]
14+
verbs: ["get", "list", "watch"]
15+
- apiGroups: [""]
16+
resources: ["pods", "nodes/proxy", "nodes/stats"]
17+
verbs: ["get", "list", "watch"]
18+
{{- end -}}
19+
{{- end -}}

charts/monitor/charts/telegraf/templates/monitor-telegraf-rolebinding.yaml renamed to charts/monitor/charts/telegraf/templates/monitor-telegraf-clusterrolebinding.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@
33
kind: ClusterRoleBinding
44
apiVersion: {{ template "rbacAPIVersion" . }}
55
metadata:
6-
name: drycc:influx:telegraf:viewer
6+
name: drycc:drycc-monitor-telegraf
77
labels:
88
app: drycc-monitor-telegraf
99
heritage: drycc
1010
roleRef:
1111
apiGroup: rbac.authorization.k8s.io
1212
kind: ClusterRole
13-
name: drycc:influx:telegraf
13+
name: drycc:drycc-monitor-telegraf
1414
subjects:
1515
- kind: ServiceAccount
1616
name: drycc-monitor-telegraf
17-
namespace: drycc
17+
namespace: {{ .Release.Namespace }}
1818
{{- end -}}
1919
{{- end -}}
2020

charts/monitor/charts/telegraf/templates/monitor-telegraf-role.yaml renamed to charts/monitor/templates/monitor-clusterrole.yaml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,10 @@
11
{{- if (.Values.global.use_rbac) -}}
22
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
3-
kind: ClusterRole
4-
apiVersion: {{ template "rbacAPIVersion" . }}
5-
metadata:
6-
name: drycc:influx:stats:viewer
7-
labels:
8-
rbac.authorization.k8s.io/aggregate-view-telegraf-stats: "true"
9-
app: drycc-monitor-telegraf
10-
heritage: drycc
11-
rules:
12-
- apiGroups: ["metrics.k8s.io"]
13-
resources: ["pods"]
14-
verbs: ["get", "list", "watch"]
15-
- apiGroups: [""]
16-
resources: ["nodes/proxy", "nodes/stats"]
17-
verbs: ["get", "list", "watch"]
18-
---
193
# Define global role with the default system:aggregate-to-view cluster role and the two rules we just created
204
kind: ClusterRole
215
apiVersion: {{ template "rbacAPIVersion" . }}
226
metadata:
23-
name: drycc:influx:telegraf
7+
name: drycc:drycc-monitor
248
aggregationRule:
259
clusterRoleSelectors:
2610
- matchLabels:

grafana/rootfs/usr/share/grafana/api/dashboards/kube_health.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1099,7 +1099,7 @@
10991099
"selected": false
11001100
}
11011101
],
1102-
"query": "show tag values from kubernetes_pod_container with key in (\"container_name\")",
1102+
"query": "show tag values from kubernetes_pod_container with key in (\"container_name\") where namespace =~ /kube-*/ or container_name =~ /kube.*/",
11031103
"refresh": 1,
11041104
"regex": "",
11051105
"type": "query"

0 commit comments

Comments
 (0)