turbonomic / kubeturbo

138 stars 75 forks source link

how to handle un-running pod #97

Open songbinliu opened 7 years ago

songbinliu commented 7 years ago

In Kubernetes, pods can be in different phases: pending, running, and terminating. In addition, the containers in Pods may be in different status: running, waiting (because of CrashLoopBackOff).

Question Shall we only report the pods that are in running phase, and its containers are in running status?

In current implementation, we report all the running pods can be found by kuberentes.Pods().List() API.
However, in cases that some pods are in running phase, and its containers have been crashed, CPU/Memory usage metrics will be missing for these containers and pods. In these cases, should we set the CPU/Memory usage to be zero, or drop these kinds of Pods in discovery response? In current implementation, we drop the CPU/Memory commodities for the containers/Pods.

songbinliu commented 7 years ago

Another case is that a pod is pending because of not enough resource, then this pod won't be reported to OpsMgr. In this case, OpsMgr will never do anything for this pending Pod.