-
Notifications
You must be signed in to change notification settings - Fork 160
Open
Description
Currently, only a few hardcoded labels make it into the containerd container labels section, for example:
# ctr --address /run/containerd/containerd.sock -n k8s.io containers info e4d35794a41cb3998eef8b0cec0d233a64b021582fabee90885ef0aaaa767ebd
{
"ID": "e4d35794a41cb3998eef8b0cec0d233a64b021582fabee90885ef0aaaa767ebd",
"Labels": {
"io.cri-containerd.kind": "container",
"io.kubernetes.container.name": "xxxxx",
"io.kubernetes.pod.name": "xxxxx-5658cff946-lkwdx",
"io.kubernetes.pod.namespace": "yyyyy",
"io.kubernetes.pod.uid": "c4d0196a-2d04-4841-917c-5f4aaaabe9b9"
},
It makes it impossible to read custom labels defined in pod's metadata->labels for using them in metrics collection, for example, cadvisor, which has a bunch of related issues open: https://github.com/google/cadvisor/issues?q=is%3Aissue%20state%3Aopen%20in%3Atitle%20label%20
These labels are apparently hardcoded in https://github.com/kubernetes/kubelet/blob/master/pkg/types/labels.go
Would it be feasible to extend it to automatically add whatever is available in the metadata labels section?
Metadata
Metadata
Assignees
Labels
No labels