From 2b9135d5dcbeeecfd61c65ce0136304c594a130e Mon Sep 17 00:00:00 2001 From: Simon Lundkvist Date: Wed, 11 Sep 2024 09:34:11 +0200 Subject: [PATCH] fix: fix cluster status panels --- .../dashboards/kubernetesstatus-dashboard.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/helmfile.d/charts/grafana-dashboards/dashboards/kubernetesstatus-dashboard.json b/helmfile.d/charts/grafana-dashboards/dashboards/kubernetesstatus-dashboard.json index af9c3b29d..ec6aea29f 100644 --- a/helmfile.d/charts/grafana-dashboards/dashboards/kubernetesstatus-dashboard.json +++ b/helmfile.d/charts/grafana-dashboards/dashboards/kubernetesstatus-dashboard.json @@ -1016,7 +1016,7 @@ "targets": [ { "exemplar": true, - "expr": "count(kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) - (count(kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"cpu\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) or vector(0))", + "expr": "count(kube_pod_container_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\"} and on (pod, namespace, cluster) kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) - (count(kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"cpu\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) or vector(0))", "interval": "", "legendFormat": "", "refId": "A" @@ -1079,7 +1079,7 @@ "targets": [ { "exemplar": true, - "expr": "count(kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) - (count(kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"memory\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) or vector(0))", + "expr": "count(kube_pod_container_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\"} and on (pod, namespace, cluster) kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) - (count(kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"memory\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) or vector(0))", "interval": "", "legendFormat": "", "refId": "A" @@ -1175,7 +1175,7 @@ "targets": [ { "exemplar": true, - "expr": "count by (pod, namespace, cluster) (kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) unless on (pod, namespace, cluster) kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"cpu\", node=~\"$node\"}", + "expr": "count by (pod, namespace, cluster) (kube_pod_container_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\"} and on (pod, namespace, cluster) kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) unless on (pod, namespace, cluster) kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"cpu\", node=~\"$node\"}", "format": "table", "instant": true, "interval": "", @@ -1288,7 +1288,7 @@ "targets": [ { "exemplar": true, - "expr": "count by (pod, namespace, cluster) (kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) unless on (pod, namespace, cluster) kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"memory\", node=~\"$node\"}", + "expr": "count by (pod, namespace, cluster) (kube_pod_container_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\"} and on (pod, namespace, cluster) kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1) unless on (pod, namespace, cluster) kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", resource=\"memory\", node=~\"$node\"}", "format": "table", "instant": true, "interval": "", @@ -1390,7 +1390,7 @@ "targets": [ { "exemplar": false, - "expr": "sum by (node, cluster) (kube_pod_container_resource_requests{cluster=~\"$cluster\", node=~\"$node\", namespace=~\"$namespace\", resource=\"cpu\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1 ) / sum by (node, cluster) (kube_node_status_allocatable{cluster=~\"$cluster\", node=~\"$node\", resource=\"cpu\"})", + "expr": "sum by (node, cluster) (kube_pod_container_resource_requests{cluster=~\"$cluster\", namespace=~\"$namespace\", resource=\"cpu\"} and on (pod, namespace, cluster) kube_pod_info{cluster=~\"$cluster\", namespace=~\"$namespace\", namespace!~\"^${systemNamespaces}\", node=~\"$node\"} and on (pod, namespace, cluster) kube_pod_status_phase{phase=\"Running\", cluster=~\"$cluster\", namespace=~\"$namespace\"} == 1 ) / sum by (node, cluster) (kube_node_status_allocatable{cluster=~\"$cluster\", node=~\"$node\", resource=\"cpu\"})", "interval": "", "legendFormat": " {{node}} - {{cluster}}", "refId": "A"