Hello everyone,
I need some feedback and help to create into my Grafana a dashboard where I can check all image version of my containers into Kubernetes.
Actually I created a new Panel with a type TABLE, as Data source I use my PROMETHEUS.
In Metrics browser on A, I make the following request : kube_pod_container_info{image!=“”}
Here the result :
name | container | container_id | endpoint | image | image_id | instance | job | namespace | pod | service | uid |
---|---|---|---|---|---|---|---|---|---|---|---|
kube_pod_container_info | application-controller | containerd://… | http | myregistry.local/argoproj/argocd:v2.5.4 | myregistry.local/argoproj/argocd@sha256:91d377251 | 10.50.20.30:8080 | kube-state-metrics | argocd | argocd-application-controller-0 | argocd-application-controller-0 | 2fc |
But at the end, my goal will be obtain this following table :
Registry | Project | Version | Namespace | Number image inside namespace |
---|---|---|---|---|
myregistry.local | argoproj | v2.5.4 | argocd | 1 |
Actually, I deleted succesfully all duplicate images by changing value in Metrics Browser by :
count(kube_pod_container_info{image_spec!=“”}) by (image_spec)
I guess I can kept the output result in futhure for my column “Number image inside namespace”.
I also succesfully hidden the “Time” by Adding “Overrides” > “Hide in table” and select “Time” Field.
I saw I can rename my column with other overide “Display name” so, no problem to get custom column like Registry, Project, Version.
Actually I’m stuck on cutting output… I guess I have to make regex on my output myregistry.local/argoproj/argocd:v2.5.4 but how can I do this ?
I see inside “Transform” some settings like “Etract Fields” and “Rename by Regex”, it is the good way ?
And I’m worried about the fact I want a count of all image per namespace.
For example :
If I got 4x images argocd:v2.5.4 in the namespace “argocd” and 2x images argocd:v2.5.4 inside the namespace “test”, I waiting something like that :
Registry | Project | Version | Namespace | Number image inside namespace |
---|---|---|---|---|
myregistry.local | argoproj | v2.5.4 | argocd | 4 |
myregistry.local | argoproj | v2.5.4 | test | 2 |
How can I get into it? Should I create specific variables to the dashboard ?
Many thanks in advance!