I am trying to display in Grafana the last status phase of a Kubernetes pod, using the metric series produces by the kube-state-metrics project.
Based on public templates I found, it appears that most dashboards are using a Grafana variables with the a query more or less similar to the following:
label_values(kube_pod_status_phase{pod="$pod"}, phase)
and then displaying the resulting variable in a Text panel.
However, I've noticed that the query may return multiple label values, such as "Running", "Pending"..., and that the value displayed will be the first of the list, and not the last status phase of the pod in any way.
What is a proper way to display the last status phase of a Kubernetes pod using a text or singlestat panel in Grafana, using the metrics reported by kube-state-metrics ?
Thanks