29 Jul 2024 08:02 AM - last edited on 29 Jul 2024 08:57 AM by MaciejNeumann
I'm looking for a way to determine if requested pods is equal to the running pods for specific apps in a specific namespace on a specific Kubernetes cluster.
Ideally if running pods = 0 we throw an alert with status CRITICAL,
and if we run bear minimum 1 pod ( or more ) of mentioned app we alert with status WARN, when the Running pods is less than the requested pods.
Kind rgds,
Peter
Solved! Go to Solution.
29 Jul 2024 09:20 AM
Hello,
Please check the below query, this will list the desired pod and the running pods. you can modify it to make basic calculations on it, like (desired - running) and is the result is 0 so you are fine.
fetch dt.entity.cloud_application_instance, from: -30m
| fields id, pod.id = id, pod.name = entity.name, pod.desired_containers = record(desiredContainersCount),pod.running_containers = record(runningContainersCount)
Thanks,
Islam