<p>I am working with kubernetes and <code>kubectl</code> commands, and am able to get a list of namespaces, and then can get the resources inside those namespaces.  Question is, is there an <em>effective</em> way to monitor all resources (CRDs especially) in a certain namespace for changes? I know I could do this:</p>
<pre><code>kubectl get myobjecttype -n &lt;user-account-1&gt;
</code></pre>
<p>and then check timestamps with a separate command, but that seems resource-taxing.</p>

Oliver Williams
<p>You might be looking for the Kubernetes <a href="https://kubernetes.io/docs/reference/using-api/api-concepts/#efficient-detection-of-changes" rel="nofollow noreferrer">Watch API</a>.</p>
<p>In fact, you make a List request (see API reference for e.g. <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.21/#list-pod-v1-core" rel="nofollow noreferrer">Pods</a>) and add the <code>watch=1</code> query parameter to get a continuous stream of changes to the specified resources.</p>
<p><code>kubectl</code> also supports watches with the <code>-w/--watch</code> flag:</p>
<pre class="lang-sh prettyprint-override"><code>kubectl get myobjecttype -n &lt;user-account-1&gt; -w
</code></pre>
