<p>I need to know a way to scale down all the deployments on a kubernetes namespace except for one with a specific string inside the name since it has dependencies. This on an AzureCLI task inside of an azure pipeline. Any ideas?</p>
<p>Something like:
If name contains &quot;randomname&quot; then do not scale up/down the service.</p>
<p>I did try some exceptions but still not working.</p>

<p>You can add a <em>label</em> on the one you want to exclude, and then use queries using <a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#api" rel="nofollow noreferrer">labels and selectors</a> to apply operations on the selected set of resources.</p>
