I have a eks cluster in a public subnet. Prometheus server is running on an ec2 instance in the same subnet. I am unable to find a way to monitor this cluster on prometheus. Are there any configurations I might be missing? Please suggest what checks I should do. Could not find any blog/doc that could help resolve my problem.
You need to get the base64 token which has access to kubernetes api, which you can get it from secrets. your configuration should look like this, ofcourse the base64 token will be big this is just dummy one.
- job_name: ekscluster
kubernetes_sd_configs:
- role: node
api_server: https://ekscluster.sk1.us-east-1.eks.amazonaws.com
tls_config:
insecure_skip_verify: true
bearer_token: "asdaaasdakjfafua09famdn23423sxfsdd3e2342"
bearer_token: "asdaaasdakjfafua09famdn23423sxfsdd3e2342"
scheme: https
tls_config:
insecure_skip_verify: true
relabel_configs:
- separator: ;
regex: __meta_kubernetes_node_label_(.+)
replacement: $1
action: labelmap
- separator: ;
regex: (.*)
target_label: __address__
replacement: ekscluster.sk1.us-east-1.eks.amazonaws.com
action: replace
- source_labels: [__meta_kubernetes_node_name]
separator: ;
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
action: replace
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.