<p>I'm trying to scale up/down some deployments over HTTP and also list the deployments on my cluster. I'm able to list pods, but can't figure out the deployments piece. </p>

<p><code>http://localhost:8080/api/v1/namespaces/default/deployments</code> </p>

<pre><code>{
    "kind": "Status",
    "apiVersion": "v1",
    "metadata": {},
    "status": "Failure",
    "message": "the server could not find the requested resource",
    "reason": "NotFound",
    "details": {},
    "code": 404
}
</code></pre>

Ryan
<p>Deployments are in the <code>apps/v1</code> namespace, and you need to include <code>apps</code> in the URL.  The <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#list-deployment-v1-apps" rel="nofollow noreferrer">API documentation for the "list deployments" endpoint</a> gives the URL as</p>

<pre><code>GET /apis/apps/v1/namespaces/{namespace}/deployments
</code></pre>

<p>You can use the normal read-modify-write sequence to change the <code>replicas:</code> field in a deployment spec to scale it.</p>

<p>There is also <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.18/#replace-scale-deployment-v1-apps" rel="nofollow noreferrer">a dedicated endpoint to scale deployments</a>, though it's slightly underdocumented.  <a href="https://stackoverflow.com/questions/41792851/manage-replicas-count-for-deployment-using-kubernetes-api">Manage replicas count for deployment using Kubernetes API
</a> suggests reading and patching the scale resource, or there is an example with a minimal JSON payload.</p>
