Open ncapps opened 3 years ago
@ncapps let me rephrase your problem to make sure that I understand what you want to achieve: you are using kubelet /metrics
endpoint to collect information about containers and you do not want this endpoint to take non-kubernetes containers into consideration?
@iwankgb Yes, that's correct
AFAIK recommended method is to use standalone cAdvisor rather than rely on endpoint that kubelet exposes. It would give you much more flexibility over cAdvisor configuration.
I'm in the same scenario, namely I'd like to have cadvisor
collect metrics from the root cgroup and not talk to docker at all. We are rolling out cadvisor
to a fleet of hosts where only a subset will be running kubelet
, and at that stage I'm happy if kubelet
exports metrics from docker containers.
edit: a bandaid is to pass --docker /dev/null
to cadvisor
so at least metrics are not augmented with extra labels, which might be undesired. Of course k8s-related containers stats are still exported (e.g. metrics from kubepods.slice
, or all overlay
fs stats)
Summary We have both Kubernetes and Docker running in the same environment. cAdvisor is running as part of the kubelet binary. Kubernetes is using CRI-O as our CRI. Both
/var/lib/docker
and/var/lib/containers
are backed by a ZFS file system.cAdvisor is gathering metrics for the Docker CRI and executes
zfs list
on an interval. This operation is resource intensive. We do not need cAdvisor to gather metrics for the Docker CRI.I would like to be able to disable gathering metrics for the Docker CRI.