Scale and Upgrade Clusters
Both scaling and upgrading use PATCH /tenants/{tenant}/clusters/{name}. The endpoint is asynchronous: it returns immediately, and the change is rolled out in the background. See
Reference: update cluster for
the full schema.
Scale a cluster
Section titled “Scale a cluster”Update the resource limits on an existing cluster. Only the fields you include are changed.
export KUPE_TENANT="<tenant>"export KUPE_CLUSTER="production"
curl -X PATCH \ -H "Authorization: Bearer $KUPE_API_KEY" \ -H "Content-Type: application/json" \ "https://api.kupe.cloud/api/v1/tenants/$KUPE_TENANT/clusters/$KUPE_CLUSTER" \ -d '{ "resources": { "cpu": "8", "memory": "32Gi", "storage": "200Gi" } }'Resource values use Kubernetes quantity format (8, 500m, 32Gi, 200Gi).
Upgrade the Kubernetes version
Section titled “Upgrade the Kubernetes version”curl -X PATCH \ -H "Authorization: Bearer $KUPE_API_KEY" \ -H "Content-Type: application/json" \ "https://api.kupe.cloud/api/v1/tenants/$KUPE_TENANT/clusters/$KUPE_CLUSTER" \ -d '{"version": "1.32"}'This triggers an asynchronous version change. Poll status.phase and status.kubernetesVersion to track progress.
Optimistic locking with If-Match
Section titled “Optimistic locking with If-Match”To avoid overwriting concurrent changes, pass the ETag value from a previous GET in
the If-Match header. The request fails with 412 Precondition Failed if the cluster has
been modified since you read it.
# 1. GET the current state and capture the ETagETAG=$(curl -sD - -o /dev/null \ -H "Authorization: Bearer $KUPE_API_KEY" \ "https://api.kupe.cloud/api/v1/tenants/$KUPE_TENANT/clusters/$KUPE_CLUSTER" \ | awk -F': ' '/^[Ee][Tt][Aa][Gg]:/ {gsub(/\r/,""); print $2}')
# 2. PATCH with the ETagcurl -X PATCH \ -H "Authorization: Bearer $KUPE_API_KEY" \ -H "Content-Type: application/json" \ -H "If-Match: $ETAG" \ "https://api.kupe.cloud/api/v1/tenants/$KUPE_TENANT/clusters/$KUPE_CLUSTER" \ -d '{"version": "1.32"}'If-Match is optional, but recommended for any read-modify-write workflow that runs from
multiple places (humans and CI, multiple pipeline runs, etc.).
What can be changed
Section titled “What can be changed”Only version, resources, and alerts are mutable. To change name, displayName, or type, create a new cluster and move workloads over.