-
Notifications
You must be signed in to change notification settings - Fork 10
/
prometheus-configmap.yml
37 lines (35 loc) · 1.24 KB
/
prometheus-configmap.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
apiVersion: v1
kind: ConfigMap
metadata:
name: prometheus
data:
prometheus.yml: |-
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: kubernetes
kubernetes_sd_configs:
- api_server: 'https://kubernetes'
role: pod
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
relabel_configs:
- source_labels:
- __meta_kubernetes_pod_name
target_label: container_label_io_kubernetes_pod_name
- source_labels:
- __meta_kubernetes_namespace
target_label: container_label_io_kubernetes_pod_namespace
- source_labels:
- __meta_kubernetes_pod_container_port_number
target_label: container_label_port
# - source_labels:
# - container_label_io_kubernetes_pod_name
# target_label: exported_container_label_io_kubernetes_pod_name
# - source_labels:
# - container_label_io_kubernetes_pod_namespace
# target_label: exported_container_label_io_kubernetes_pod_namespace