Closed pharthiphan closed 4 years ago
The easiest way is to add
hostNetwork: true
to pod spec. This will bind port 8080 exposed by daemonset.yaml to host. Then you should be able to scrap the data just by putting host ip and the 8080 port to scrap config.
Thank you, that helped
can we use different port ? ex. port 8082
how to export cadvisor metrics to the external Prometheus server?
I have cadvisor deployed on the k8s cluster
~/kustomize build deploy/kubernetes/overlays/examples_perf | kubectl apply -f -
` kubectl get all -o wide -n cadvisor NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES pod/cadvisor-b2zl5 1/1 Running 0 29m 10.244.3.12 sn86
pod/cadvisor-chk77 1/1 Running 0 29m 10.244.6.9 sn83
pod/cadvisor-crqph 1/1 Running 0 29m 10.244.2.13 sn102
pod/cadvisor-rmlnd 1/1 Running 0 29m 10.244.4.11 sn58
NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE CONTAINERS IMAGES SELECTOR daemonset.apps/cadvisor 4 4 4 4 4 85m cadvisor gcr.io/cadvisor/cadvisor:v0.37.0 app=cadvisor,name=cadvisor
`
for the kube-state-metrics, I have forwarded the port of the kube-state-metrics locally and used it on the Prometheus config.
but not sure how to do that cadvisor!