google / cadvisor

Analyzes resource usage and performance characteristics of running containers.
Other
16.99k stars 2.31k forks source link

image label inconsistent #2435

Open hseffler opened 4 years ago

hseffler commented 4 years ago

I am looking at metrics exported by cadvisor as embedded in kubelet from k8s 1.13.5.

On any random worker node the image-label seems to have one of the following values

From looking at the deployments that brought those containers there, all were deployed by tag, partly from public, mostly from a private registry.

For building queries the image-label should be consitent for all containers.

dashpole commented 4 years ago

This is container runtime dependent. Which runtime are you using? The code for docker to set this is here: https://github.com/google/cadvisor/blob/master/container/docker/handler.go#L221

hseffler commented 4 years ago

Yes, it's docker. Is there any reason why docker would it report the image in use so differently?

dashpole commented 4 years ago

Here is the docker container Config we have to work with: https://godoc.org/github.com/docker/docker/api/types/container#Config. I assume they do that for simplicity (just return what users sent them), and also not to confuse users (e.g. "why did my image change from tag to sha when I inspect?").

origama commented 3 years ago

Is there any mitigation for this, is this bug going to be kept in consideration?