Skip to content

Commit 293dcd5

Browse files
committed
chore(monitor): update grafana dashboard,telegraf inputs.kubernetes
1 parent 640ac80 commit 293dcd5

11 files changed

Lines changed: 49 additions & 30 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ spec:
6060
key: password
6161
{{- else }}
6262
- name: "INFLUXDB_URLS"
63-
value: http://$(DRYCC_MONITOR_INFLUXAPI_SERVICE_HOST):$(DRYCC_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT)
63+
value: http://$(DRYCC_MONITOR_INFLUXDB_API_SERVICE_HOST):$(DRYCC_MONITOR_INFLUXDB_API_SERVICE_PORT_TRANSPORT)
6464
{{- end }}
6565
- name: "BIND_PORT"
6666
value: "3500"

charts/monitor/charts/influxdb/templates/monitor-influxdb-api-certificate.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22
apiVersion: cert-manager.io/v1alpha2
33
kind: Certificate
44
metadata:
5-
name: drycc-monitor-influx-api
5+
name: drycc-monitor-influxdb-api
66
namespace: "{{ .Release.Namespace }}"
77
spec:
8-
secretName: drycc-monitor-influx-api-auto-tls
8+
secretName: drycc-monitor-influxdb-api-auto-tls
99
issuerRef:
1010
name: drycc-cluster-issuer
1111
kind: ClusterIssuer
1212
dnsNames:
13-
- drycc-monitor-influx-api.{{ .Values.global.platform_domain }}
13+
- drycc-monitor-influxdb-api.{{ .Values.global.platform_domain }}
1414
privateKey:
1515
rotationPolicy: Always
1616
{{- end }}

charts/monitor/charts/influxdb/templates/monitor-influxdb-api-ingress.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ apiVersion: networking.k8s.io/v1beta1
22
kind: Ingress
33
metadata:
44
namespace: "{{ .Release.Namespace }}"
5-
name: "drycc-monitor-influx-api-ingress"
5+
name: "drycc-monitor-influxdb-api-ingress"
66
labels:
7-
app: "drycc-monitor-influx-api"
7+
app: "drycc-monitor-influxdb-api"
88
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
99
release: "{{ .Release.Name }}"
1010
heritage: "{{ .Release.Service }}"
@@ -15,7 +15,7 @@ metadata:
1515
{{ end }}
1616
spec:
1717
rules:
18-
- host: drycc-monitor-influx-api.{{ .Values.global.platform_domain }}
18+
- host: drycc-monitor-influxdb-api.{{ .Values.global.platform_domain }}
1919
http:
2020
paths:
2121
{{- if eq .Values.global.ingress_class "gce" "alb" }}
@@ -24,11 +24,11 @@ spec:
2424
- path: /
2525
{{- end }}
2626
backend:
27-
serviceName: drycc-monitor-influx-api
27+
serviceName: drycc-monitor-influxdb-api
2828
servicePort: 80
2929
{{ if .Values.global.cert_manager_enabled }}
3030
tls:
31-
- secretName: drycc-monitor-influx-api-auto-tls
31+
- secretName: drycc-monitor-influxdb-api-auto-tls
3232
hosts:
33-
- drycc-monitor-influx-api.{{ .Values.global.platform_domain }}
33+
- drycc-monitor-influxdb-api.{{ .Values.global.platform_domain }}
3434
{{- end }}

charts/monitor/charts/influxdb/templates/monitor-influxdb-api-svc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
apiVersion: v1
33
kind: Service
44
metadata:
5-
name: drycc-monitor-influx-api
5+
name: drycc-monitor-influxdb-api
66
labels:
77
heritage: drycc
8-
app: drycc-monitor-influx-api
8+
app: drycc-monitor-influxdb-api
99
spec:
1010
ports:
1111
- port: 80

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ spec:
6262
key: password
6363
{{- else }}
6464
- name: "INFLUXDB_URLS"
65-
value: "\"http://$(DRYCC_MONITOR_INFLUXAPI_SERVICE_HOST):$(DRYCC_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT)\""
65+
value: "\"http://$(DRYCC_MONITOR_INFLUXDB_API_SERVICE_HOST):$(DRYCC_MONITOR_INFLUXDB_API_SERVICE_PORT_TRANSPORT)\""
6666
- name: "INFLUXDB_INPUT_URLS"
67-
value: "\"http://$(DRYCC_MONITOR_INFLUXAPI_SERVICE_HOST):$(DRYCC_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT)/debug/vars\""
67+
value: "\"http://$(DRYCC_MONITOR_INFLUXDB_API_SERVICE_HOST):$(DRYCC_MONITOR_INFLUXDB_API_SERVICE_PORT_TRANSPORT)/debug/vars\""
6868
- name: "ENABLE_INFLUXDB_INPUT"
6969
value: "true"
7070
{{- end }}
Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,32 @@
11
{{- if (.Values.global.use_rbac) -}}
22
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
3-
kind: Role
3+
kind: ClusterRole
44
apiVersion: {{ template "rbacAPIVersion" . }}
55
metadata:
6-
name: drycc-monitor-telegraf
6+
name: drycc:influx:stats:viewer
77
labels:
8+
rbac.authorization.k8s.io/aggregate-view-telegraf-stats: "true"
89
app: drycc-monitor-telegraf
910
heritage: drycc
1011
rules:
11-
- apiGroups: [""]
12-
resources: ["pods"]
13-
verbs: ["get"]
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+
---
19+
# Define global role with the default system:aggregate-to-view cluster role and the two rules we just created
20+
kind: ClusterRole
21+
apiVersion: {{ template "rbacAPIVersion" . }}
22+
metadata:
23+
name: drycc:influx:telegraf
24+
aggregationRule:
25+
clusterRoleSelectors:
26+
- matchLabels:
27+
rbac.authorization.k8s.io/aggregate-view-telegraf-stats: "true"
28+
- matchLabels:
29+
rbac.authorization.k8s.io/aggregate-to-view: "true"
30+
rules: [] # Rules are automatically filled in by the controller manager.
1431
{{- end -}}
1532
{{- end -}}
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
{{- if (.Values.global.use_rbac) -}}
22
{{- if (.Capabilities.APIVersions.Has (include "rbacAPIVersion" .)) -}}
3-
kind: RoleBinding
3+
kind: ClusterRoleBinding
44
apiVersion: {{ template "rbacAPIVersion" . }}
55
metadata:
6-
name: drycc-monitor-telegraf
6+
name: drycc:influx:telegraf:viewer
77
labels:
88
app: drycc-monitor-telegraf
99
heritage: drycc
1010
roleRef:
1111
apiGroup: rbac.authorization.k8s.io
12-
kind: Role
13-
name: drycc-monitor-telegraf
12+
kind: ClusterRole
13+
name: drycc:influx:telegraf
1414
subjects:
1515
- kind: ServiceAccount
1616
name: drycc-monitor-telegraf
17+
namespace: drycc
1718
{{- end -}}
1819
{{- end -}}
20+

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\") where container_name =~ /kube.*/",
1102+
"query": "show tag values from kubernetes_pod_container with key in (\"container_name\")",
11031103
"refresh": 1,
11041104
"regex": "",
11051105
"type": "query"

grafana/rootfs/usr/share/grafana/start-grafana

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ GRAFANA_USER=${DEFAULT_USER:-admin}
88
GRAFANA_PASSWD=${DEFAULT_USER_PASSWORD:-admin}
99
GRAFANA_PORT=${BIND_PORT:-3000}
1010

11-
INFLUXDB_HOST=${DRYCC_MONITOR_INFLUXAPI_SERVICE_HOST:-"drycc-monitor-influx-api.drycc.svc.cluster.local"}
12-
INFLUXDB_PORT=${DRYCC_MONITOR_INFLUXAPI_SERVICE_PORT_TRANSPORT:-8086}
11+
INFLUXDB_HOST=${DRYCC_MONITOR_INFLUXDB_API_SERVICE_HOST:-"drycc-monitor-influxdb-api.drycc.svc.cluster.local"}
12+
INFLUXDB_PORT=${DRYCC_MONITOR_INFLUXDB_API_SERVICE_PORT_TRANSPORT:-8086}
1313
INFLUXDB_DATABASE=${INFLUXDB_DATABASE:-kubernetes}
1414
INFLUXDB_USER=${INFLUXDB_USER:-admin}
1515
INFLUXDB_PASSWORD=${INFLUXDB_PASSWORD:-admin}

telegraf/rootfs/config.toml.tpl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@
173173
[[inputs.kubernetes]]
174174
url = {{ .KUBERNETES_URL | quote }}
175175
bearer_token = {{ .KUBERNETES_BEARER_TOKEN_PATH | quote }}
176-
{{ if .KUBERNETES_SSL_CA }} ssl_ca = {{ .KUBERNETES_SSL_CA | quote }} {{ end }}
177-
{{ if .KUBERNETES_SSL_CERT }} ssl_cert = {{ .KUBERNETES_SSL_CERT | quote }} {{ end }}
178-
{{ if .KUBERNETES_SSL_KEY }} ssl_key = {{ .KUBERNETES_SSL_KEY | quote }} {{ end }}
176+
{{ if .KUBERNETES_SSL_CA }}tls_ca = {{ .KUBERNETES_SSL_CA | quote }} {{ end }}
177+
{{ if .KUBERNETES_SSL_CERT }}tls_cert = {{ .KUBERNETES_SSL_CERT | quote }} {{ end }}
178+
{{ if .KUBERNETES_SSL_KEY }}tls_key = {{ .KUBERNETES_SSL_KEY | quote }} {{ end }}
179179
insecure_skip_verify = {{ default true .KUBERNETES_INSECURE_SKIP_VERIFY }}
180180
{{ end }}
181181

0 commit comments

Comments
 (0)