-
Notifications
You must be signed in to change notification settings - Fork 15
/
k8s-mon.yml
318 lines (299 loc) · 8.82 KB
/
k8s-mon.yml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
apiserver:
concurrency_limit: 10
user_specified: true
addrs:
- "https://localhost:6443/metrics"
scheme: https
metrics_path: metrics
port: 6443
# bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
bearer_token_file: /root/token
tls_config:
# ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
metrics_white_list:
- apiserver_client_certificate_expiration_seconds
- apiserver_current_inflight_requests
- apiserver_current_inqueue_requests
- apiserver_flowcontrol_current_executing_requests
- apiserver_flowcontrol_current_inqueue_requests
- apiserver_request_duration_seconds
- apiserver_request_total
- apiserver_response_sizes
- apiserver_tls_handshake_errors_total
- authentication_attempts
- authentication_duration_seconds
- etcd_db_total_size_in_bytes
- etcd_object_counts
- etcd_request_duration_seconds
- workqueue_adds_total
- workqueue_longest_running_processor_seconds
- workqueue_queue_duration_seconds
- workqueue_retries_total
- workqueue_work_duration_seconds
kube_stats_metrics:
concurrency_limit: 10
user_specified: true
addrs:
- "http://kube-state-metrics.kube-system:8080/metrics"
metrics_white_list:
tags_white_list:
- namespace
- pod
- pod_name
- container
- container_name
- reason
- secret
- condition
- node
- deployment
- configmap
- daemonset
- endpoint
- replicaset
- statefulset
- persistentvolumeclaim
- persistentvolume
- service
- phase
- type
- status
- resource
- unit
- host_ip
- pod_ip
- cluster_ip
- external_name
- load_balancer_ip
- storageclass
- kernel_version
- os_image
- role
- volume
- access_mode
- volumename
- provisioner
- reclaimPolicy
- volumeBindingMode
- poddisruptionbudget
kube_scheduler:
concurrency_limit: 10
user_specified: true
addrs:
- "https://localhost:10259/metrics"
scheme: https
metrics_path: metrics
port: 10259
# bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
bearer_token_file: /root/token
tls_config:
# ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
metrics_white_list:
- scheduler_e2e_scheduling_duration_seconds
- scheduler_pod_scheduling_duration_seconds
- scheduler_pending_pods
- scheduler_queue_incoming_pods_total
- scheduler_scheduling_algorithm_duration_seconds
- scheduler_pod_scheduling_attempts
tags_white_list:
kube_controller_manager:
concurrency_limit: 10
user_specified: false
addrs:
- "https://localhost:10257/metrics"
port: 10257
scheme: https
metrics_path: metrics
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
metrics_white_list:
- workqueue_adds_total
- workqueue_depth
- workqueue_queue_duration_seconds
- rest_client_requests_total
- rest_client_request_duration_seconds
tags_white_list:
coredns:
concurrency_limit: 10
user_specified: false
addrs:
- "http://kube-dns.kube-system:9153/metrics"
port: 9153
scheme: http
metrics_path: metrics
metrics_white_list:
- coredns_dns_requests_total
- coredns_dns_responses_total
- coredns_cache_entries
- coredns_cache_hits_total
- coredns_cache_misses_total
- coredns_dns_request_duration_seconds
- coredns_dns_response_size_bytes
tags_white_list:
kube_proxy:
concurrency_limit: 10
user_specified: false
addrs:
- "http://127.0.0.1:10249/metrics"
port: 10249
scheme: http
metrics_path: metrics
metrics_white_list:
- kubeproxy_sync_proxy_rules_duration_seconds
- kubeproxy_network_programming_duration_seconds
- rest_client_requests_total
- rest_client_request_latency_seconds
tags_white_list:
kubelet_node:
#hash_mod_num: 2
#hash_mod_shard: 1
concurrency_limit: 10
user_specified: false
addrs:
- "https://127.0.0.1:10250/metrics"
port: 10250
scheme: https
metrics_path: metrics
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
metrics_white_list:
- kubelet_running_pods
- kubelet_running_containers
- volume_manager_total_volumes
- kubelet_node_config_error
- kubelet_runtime_operations_total
- kubelet_runtime_operations_errors_total
- kubelet_runtime_operations_duration_seconds
- storage_operation_duration_seconds
- kubelet_cgroup_manager_duration_seconds
- rest_client_requests_total
- rest_client_request_latency_seconds
tags_white_list:
## end of server-side-mon
kubelet:
identify_mode: "nid" # or "pod_name"
addr: "https://localhost:10250/metrics/cadvisor"
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
tls_config:
#ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecure_skip_verify: true
metrics_white_list:
# cpu metrics
- container_spec_cpu_quota
- container_cpu_usage_seconds_total
- container_cpu_user_seconds_total
- container_cpu_system_seconds_total
- container_cpu_cfs_periods_total
- container_cpu_cfs_throttled_periods_total
- container_cpu_cfs_throttled_seconds_total
# mem metrics
- container_spec_memory_limit_bytes
- container_memory_working_set_bytes
- container_memory_usage_bytes
- container_memory_cache
- container_memory_rss
- container_memory_swap
# fs metrics
- container_fs_usage_bytes
- container_fs_limit_bytes
- container_fs_reads_bytes_total
- container_fs_writes_bytes_total
# network metrics
- container_network_receive_bytes_total
- container_network_receive_errors_total
- container_network_receive_packets_total
- container_network_receive_packets_dropped_total
- container_network_transmit_bytes_total
- container_network_transmit_errors_total
- container_network_transmit_packets_total
- container_network_transmit_packets_dropped_total
# system metrics
- container_processes
- container_threads
- container_file_descriptors
- container_ulimits_soft
- container_sockets
- container_tasks_state
tags_white_list:
- pod
- pod_name
- container
- container_name
- namespace
- device
- state
- interface
- cpu
kube_etcd:
concurrency_limit: 5
user_specified: false
addrs:
- "https://localhost:2379/metrics"
scheme: https
metrics_path: metrics
port: 2379
tls_config:
ca_file: /etc/secrets/etcd-certs/ca.crt
cert_file: /etc/secrets/etcd-certs/healthcheck-client.crt
key_file: /etc/secrets/etcd-certs/healthcheck-client.key
insecure_skip_verify: true
metrics_white_list:
- process_resident_memory_bytes
- etcd_debugging_mvcc_db_compaction_keys_total
- etcd_debugging_mvcc_delete_total
- etcd_debugging_mvcc_keys_total
- etcd_debugging_mvcc_put_total
- etcd_debugging_snap_save_total_duration_seconds
- etcd_disk_backend_commit_duration_seconds
- etcd_disk_wal_fsync_duration_seconds
- etcd_mvcc_db_total_size_in_bytes
- etcd_mvcc_db_total_size_in_use_in_bytes
- etcd_network_client_grpc_received_bytes_total
- etcd_network_client_grpc_sent_bytes_total
- etcd_server_has_leader
- etcd_server_health_failures
- etcd_server_heartbeat_send_failures_total
- etcd_server_id
- etcd_server_is_leader
- etcd_server_leader_changes_seen_total
- etcd_server_proposals_applied_total
- etcd_server_proposals_committed_total
- etcd_server_proposals_failed_total
- etcd_server_proposals_pending
- etcd_server_quota_backend_bytes
- etcd_server_slow_apply_total
- etcd_server_slow_read_indexes_total
- grpc_server_handled_total
- grpc_server_started_total
tags_white_list:
cadvisor:
addr: "http://127.0.0.1:4194/"
identify_mode: "nid"
docker_sock_file: "/var/run/docker.sock"
# 额外添加的tag
append_tags:
# k1: v1
# k2: v2
# 夜莺push的http接口
push_server_addr: "http://localhost:2080/api/collector/push"
# 夜莺nid的标签名字
n9e_nid_label_name: "N9E_NID"
# 多实例时区分的标签名
multi_server_instance_unique_label: "server_addr"
# 采集间隔
collect_step: 30 # 单位秒
# 获取metrics超时时间
time_out_second: 5 # 单位秒
# 服务组件监控nid
server_side_nid: "6"
# 采集模式
collect_mode: "server_side"
# cadvisor_plugin 代表插件形式使用cadvisor raw api
# kubelet_agent 代表agent形式采集每个node的kubelet暴露的容器指标
# server_side 代表集中采集k8s服务组件共6个: apiserver、scheduler、controller-manager、etcd、coredns、kube-stats-metrics