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
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