<p>I'm trying to understand what does <code>kubectl rollout status &lt;deployment name&gt;</code> do.</p>
<p>I'm using k8s-node-api, and from this thread (<a href="https://github.com/kubernetes-client/javascript/issues/536" rel="nofollow noreferrer">https://github.com/kubernetes-client/javascript/issues/536</a>), the maintainer suggest using k8s-watch api to watch for changes in the deployment, but I'm not sure what to check.</p>
<p>Questions:</p>
<ol>
<li>How to make sure the new deployment succeed?</li>
<li>How to make the the new deployment failed?</li>
<li>Is it safe to assume that if the spec/containers/0/image changes to something different than what I'm expecting, it means there is a new deployment and I should stop watching?</li>
</ol>
<ul>
<li>My questions are probably ambiguous because I'm new to k8s.</li>
</ul>
<p>Any guidance will be great!</p>
<hr />
<p>I can't use <code>Kubectl</code> - I'm writing a code that does that based on what <code>kubectl</code> does.</p>

<p>As we have discussed in comment section I have mentioned that to check any object and processes in Kubernetes you have to use kubectl - see: <a href="https://kubernetes.io/docs/reference/kubectl/overview/" rel="nofollow noreferrer">kubernetes.io/docs/reference/kubectl/overview</a>.
Take a look how to execute proper command to gain required information - <a href="https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#rollout" rel="nofollow noreferrer">kubectl-rollout</a>.
If you want to check how rollout process looks from backgroud look at the source code - <a href="https://github.com/kubernetes/kubectl/blob/master/pkg/cmd/rollout/rollout.go" rel="nofollow noreferrer">src-code-rollout-kubernetes</a>.</p>
<p>Pay attention on that if you are using <code>node-api</code>:</p>
<blockquote>
<p>The node-api group was migrated to a built-in API in the &gt; <a href="https://github.com/kubernetes/api" rel="nofollow noreferrer">k8s.io/api</a> repo with the v1.14
release. This repo is no longer maintained, and no longer synced
with core kubernetes as of the v1.18 release.</p>
</blockquote>
