<p>I am trying to write a .net core application to run in a kubernetes pod.  This application needs to know if the cluster has been unable to schedule any pods. </p>

<p>I have tried getting deployment data from </p>

<pre><code>kubectl get --raw /apis/apps/v1/namespaces/default/deployments
</code></pre>

<p>I can see the <code>unavailableReplicas</code> number and the <code>MinimumReplicasUnavailable</code> message.  </p>

<p>Are these valid metrics to watch for the cluster status? </p>

<p>Is there a way to query the cluster as a whole instead of by deployment? </p>

leemicw
<p>If you are looking for the images in each node in the cluster you can try</p>

<pre><code>kubectl get nodes -o json
</code></pre>

<p>which will return a json object or using <strong>--field-selector</strong> as shown below.</p>

<pre><code>kubectl get pods --all-namespaces --field-selector=status.phase==Pending
</code></pre>

<p>and using api </p>

<pre><code>kubectl get --raw /api/v1/pods?fieldSelector=status.phase==Pending
</code></pre>
