-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice-monitor.yaml
130 lines (130 loc) · 2.86 KB
/
service-monitor.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
---
# Below Service Monitor is Mandatory as it monitors the prometheus agent itself
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: prometheus-agent
labels:
managed-by: last9
namespace: last9-monitoring
spec:
selector:
matchLabels:
app: prometheus-agent
endpoints:
- interval: 30s
- port: web
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: kube-state-metrics
labels:
app.kubernetes.io/name: kube-state-metrics
managed-by: last9
namespace: last9-monitoring
spec:
namespaceSelector:
any: true
selector:
matchLabels:
app.kubernetes.io/name: kube-state-metrics
endpoints:
- interval: 30s
port: http-metrics
metricRelabelings:
- sourceLabels: [ __name__, exported_container ]
regex: ".*;(.+)"
targetLabel: container
- sourceLabels: [ __name__, exported_namespace ]
regex: ".*;(.+)"
targetLabel: namespace
- sourceLabels: [ __name__, exported_pod ]
regex: ".*;(.+)"
targetLabel: pod
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: kubelet
labels:
k8s-app: kubelet
managed-by: last9
namespace: last9-monitoring
spec:
jobLabel: k8s-app
endpoints:
- port: https-metrics
scheme: https
interval: 30s
tlsConfig:
insecureSkipVerify: true
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
- port: https-metrics
scheme: https
path: /metrics/cadvisor
interval: 30s
honorLabels: true
tlsConfig:
insecureSkipVerify: true
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
selector:
matchLabels:
k8s-app: kubelet
namespaceSelector:
matchNames:
- kube-system
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: node-exporter
labels:
managed-by: last9
namespace: last9-monitoring
spec:
selector:
matchLabels:
app.kubernetes.io/name: prometheus-node-exporter
endpoints:
- interval: 30s
- port: http-metrics
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: node-exporter
labels:
managed-by: last9
namespace: last9-monitoring
spec:
selector:
matchLabels:
app.kubernetes.io/name: prometheus-node-exporter
namespaceSelector:
matchNames:
- monitoring
endpoints:
- interval: 30s
- port: http-metrics
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: metrics-server
labels:
k8s-app: metrics-server
namespace: last9-monitoring
spec:
selector:
matchLabels:
k8s-app: metrics-server
namespaceSelector:
matchNames:
- kube-system
endpoints:
- port: https
interval: 30s
scheme: https
tlsConfig:
insecureSkipVerify: true