categraf/k8s/scrape_with_token.yaml

99 lines
3.0 KiB
YAML
Raw Normal View History

2022-07-15 16:53:18 +08:00
global:
scrape_interval: 15s
external_labels:
cluster: test
replica: 0
scrape_configs:
2022-07-26 12:12:23 +08:00
#- job_name: "categraf-out"
# static_configs:
# - targets: ["172.16.6.171:8080"]
2022-07-15 16:53:18 +08:00
- job_name: "apiserver"
metrics_path: "/metrics"
kubernetes_sd_configs:
- role: endpoints
2022-07-17 15:09:23 +08:00
# apiserver lvs address or service ip:port eg. https://172.31.0.1:443
2022-07-15 16:53:18 +08:00
api_server: "https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS}"
bearer_token_file: /path/to/token
tls_config:
insecure_skip_verify: true
scheme: https
tls_config:
insecure_skip_verify: true
bearer_token_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: "controller-manager"
metrics_path: "/metrics"
kubernetes_sd_configs:
- role: endpoints
api_server: "https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS}"
bearer_token_file: /path/to/token
tls_config:
insecure_skip_verify: true
scheme: https
tls_config:
insecure_skip_verify: true
bearer_token_file: /path/to/token
relabel_configs:
- source_labels:
[
__meta_kubernetes_namespace,
__meta_kubernetes_service_name,
__meta_kubernetes_endpoint_port_name,
]
action: keep
regex: kube-system;kube-controller-manager;https
- job_name: "scheduler"
metrics_path: "/metrics"
kubernetes_sd_configs:
- role: endpoints
api_server: "https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS}"
bearer_token_file: /path/to/token
tls_config:
insecure_skip_verify: true
scheme: https
tls_config:
insecure_skip_verify: true
bearer_token_file: /path/to/token
relabel_configs:
- source_labels:
[
__meta_kubernetes_namespace,
__meta_kubernetes_service_name,
__meta_kubernetes_endpoint_port_name,
]
action: keep
regex: kube-system;kube-scheduler;https
2022-07-15 16:53:18 +08:00
- job_name: "coredns"
metrics_path: "/metrics"
kubernetes_sd_configs:
- role: endpoints
2022-07-17 15:09:23 +08:00
# apiserver lvs address or service ip:port eg. https://172.31.0.1:443
2022-07-15 16:53:18 +08:00
api_server: "https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS}"
2022-07-17 15:09:23 +08:00
bearer_token_file: /path/to/token
2022-07-15 16:53:18 +08:00
tls_config:
insecure_skip_verify: true
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:
2022-07-26 12:05:50 +08:00
- url: 'http://${NSERVER_ADDR}/prometheus/v1/write'