@@ -11,41 +11,44 @@ data:
1111 {{- (tpl .Values.vmagent.prometheus $) | nindent 4 }}
1212 {{- else }}
1313 global:
14- ## How frequently to scrape targets by default
15- ##
1614 scrape_interval: 1m
17- ## How long until a scrape request times out
18- ##
1915 scrape_timeout: 10s
2016 scrape_configs:
2117 - job_name: vmagent
2218 static_configs:
2319 - targets: ["localhost:8429"]
20+ - job_name: "controller-nodes"
21+ scheme: http
22+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
23+ kubernetes_sd_configs:
24+ - role: node
25+ relabel_configs:
26+ - target_label: __address__
27+ replacement: drycc-controller-api.{{.Release.Namespace}}.svc.{{.Values.global.clusterDomain}}:80
28+ - source_labels: [__meta_kubernetes_node_name]
29+ regex: (.+)
30+ target_label: __metrics_path__
31+ replacement: /v2/nodes/$1/proxy/metrics
32+ - job_name: "controller-nodes-cadvisor"
33+ scheme: http
34+ bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
35+ kubernetes_sd_configs:
36+ - role: node
37+ relabel_configs:
38+ - target_label: __address__
39+ replacement: drycc-controller-api.{{.Release.Namespace}}.svc.{{.Values.global.clusterDomain}}:80
40+ - source_labels: [__meta_kubernetes_node_name]
41+ regex: (.+)
42+ target_label: __metrics_path__
43+ replacement: /v2/nodes/$1/proxy/metrics/cadvisor
2444 - job_name: "kubernetes-apiservers"
2545 kubernetes_sd_configs:
2646 - role: endpoints
27- # Default to scraping over https. If required, just disable this or change to
28- # `http`.
2947 scheme: https
30- # This TLS & bearer token file config is used to connect to the actual scrape
31- # endpoints for cluster components. This is separate to discovery auth
32- # configuration because discovery & scraping are two separate concerns in
33- # Prometheus. The discovery auth config is automatic if Prometheus runs inside
34- # the cluster. Otherwise, more config options have to be provided within the
35- # <kubernetes_sd_config>.
3648 tls_config:
3749 ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
38- # If your node certificates are self-signed or use a different CA to the
39- # master CA, then you need to disable certificate verification. Note that
40- # certificate verification is an integral part of a secure infrastructure
41- # so this should only be disabled in a controlled environment. You can
42- # enable certificate verification by commenting the line below.
43- #
4450 insecure_skip_verify: true
4551 bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
46- # Keep only the default/kubernetes service endpoints for the https port. This
47- # will add targets for each API server which Kubernetes adds an endpoint to
48- # the default/kubernetes service.
4952 relabel_configs:
5053 - source_labels:
5154 [
5659 action: keep
5760 regex: default;kubernetes;https
5861 - job_name: "kubernetes-nodes"
59- # Default to scraping over https. If required, just disable this or change to
60- # `http`.
6162 scheme: https
62- # This TLS & bearer token file config is used to connect to the actual scrape
63- # endpoints for cluster components. This is separate to discovery auth
64- # configuration because discovery & scraping are two separate concerns in
65- # Prometheus. The discovery auth config is automatic if Prometheus runs inside
66- # the cluster. Otherwise, more config options have to be provided within the
67- # <kubernetes_sd_config>.
6863 tls_config:
6964 ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
70- # If your node certificates are self-signed or use a different CA to the
71- # master CA, then you need to disable certificate verification. Note that
72- # certificate verification is an integral part of a secure infrastructure
73- # so this should only be disabled in a controlled environment. You can
74- # enable certificate verification by commenting the line below.
75- #
7665 insecure_skip_verify: true
7766 bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
7867 kubernetes_sd_configs:
@@ -87,32 +76,13 @@ data:
8776 target_label: __metrics_path__
8877 replacement: /api/v1/nodes/$1/proxy/metrics
8978 - job_name: "kubernetes-nodes-cadvisor"
90- # Default to scraping over https. If required, just disable this or change to
91- # `http`.
9279 scheme: https
93- # This TLS & bearer token file config is used to connect to the actual scrape
94- # endpoints for cluster components. This is separate to discovery auth
95- # configuration because discovery & scraping are two separate concerns in
96- # Prometheus. The discovery auth config is automatic if Prometheus runs inside
97- # the cluster. Otherwise, more config options have to be provided within the
98- # <kubernetes_sd_config>.
9980 tls_config:
10081 ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
101- # If your node certificates are self-signed or use a different CA to the
102- # master CA, then disable certificate verification below. Note that
103- # certificate verification is an integral part of a secure infrastructure
104- # so this should only be disabled in a controlled environment. You can
105- # disable certificate verification by uncommenting the line below.
106- #
10782 insecure_skip_verify: true
10883 bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
10984 kubernetes_sd_configs:
11085 - role: node
111- # This configuration will work only on kubelet 1.7.3+
112- # As the scrape endpoints for cAdvisor have changed
113- # if you are using older version you need to change the replacement to
114- # replacement: /api/v1/nodes/$1:4194/proxy/metrics
115- # more info here https://github.com/coreos/prometheus-operator/issues/633
11686 relabel_configs:
11787 - action: labelmap
11888 regex: __meta_kubernetes_node_label_(.+)
0 commit comments