diff --git a/conf/in_cluster_scrape.yaml b/conf/in_cluster_scrape.yaml index ced04b9..60aa7f1 100644 --- a/conf/in_cluster_scrape.yaml +++ b/conf/in_cluster_scrape.yaml @@ -15,7 +15,6 @@ scrape_configs: - role: endpoints scheme: https tls_config: - ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt insecure_skip_verify: true authorization: credentials_file: /var/run/secrets/kubernetes.io/serviceaccount/token diff --git a/conf/out_of_cluster_scrape.yaml b/conf/out_of_cluster_scrape.yaml new file mode 100644 index 0000000..78f8623 --- /dev/null +++ b/conf/out_of_cluster_scrape.yaml @@ -0,0 +1,47 @@ +global: + scrape_interval: 15s + #external_labels: + # cluster: test + # replica: 0 + +scrape_configs: + - job_name: "categraf-out" + static_configs: + - targets: ["172.16.6.171:8080"] + - job_name: "categraf-out-apiserver" + metrics_path: "/metrics" + kubernetes_sd_configs: + - role: endpoints + kubeconfig_file: /path/to/.kube/config + scheme: https + tls_config: + insecure_skip_verify: true + authorization: + credentials_file: /path/to/token + relabel_configs: + - source_labels: + [ + __meta_kubernetes_namespace, + __meta_kubernetes_service_name, + __meta_kubernetes_endpoint_port_name, + ] + action: keep + regex: default;kubernetes;https + - job_name: "categraf-out-coredns" + metrics_path: "/metrics" + kubernetes_sd_configs: + - role: endpoints + kubeconfig_file: /path/to/.kube/config + scheme: http + relabel_configs: + - source_labels: + [ + __meta_kubernetes_namespace, + __meta_kubernetes_service_name, + __meta_kubernetes_endpoint_port_name, + ] + action: keep + regex: kube-system;kube-dns;metrics + +remote_write: + - url: 'http://172.31.62.213/prometheus/v1/write' diff --git a/conf/prometheus.toml b/conf/prometheus.toml index f28bf41..a1704fb 100644 --- a/conf/prometheus.toml +++ b/conf/prometheus.toml @@ -1,5 +1,5 @@ [prometheus] - enable=true + enable=false scrape_config_file="/path/to/in_cluster_scrape.yaml" ## log level, debug warn info error log_level="info"