<p>I've been exploring the <a href="https://github.com/kubernetes-client/java" rel="noreferrer">Kubernetes-Client/Java library</a> and I can't figure out the API call to get all the deployments.</p>

<p>I'm looking for the K8-Client/Java API call for this command:</p>

<pre><code>kubectl get deployments
NAME             DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
appservice1       3         3         3            3           5d
appservice2       3         3         3            3           1d
appservice3       1         1         1            1           22d
</code></pre>

<p><strong>More specifically, I'm interested in determining the number of desired &amp; current pods for each deployment (like above).</strong></p>

<p>You can find all methods of the Kubernetes java client here:
<a href="https://github.com/kubernetes-client/java/tree/master/kubernetes/docs" rel="nofollow noreferrer">https://github.com/kubernetes-client/java/tree/master/kubernetes/docs</a></p>
<p>What you're searching for is the <code>listNamespacedDeployment</code> or <code>listDeploymentForAllNamespaces</code>.</p>
<p>The return type of those methods is <code>V1DeploymentList</code> so you'll find the <code>V1DeploymentStatus</code> which is containing all information about the current number of pods controlled by the deployment.</p>
