Skip to content

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.

Update the resource limits on an existing cluster. Only the fields you include are changed.

Terminal window
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).

Terminal window
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.

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.

Terminal window
# 1. GET the current state and capture the ETag
ETAG=$(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 ETag
curl -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.).

Only version, resources, and alerts are mutable. To change name, displayName, or type, create a new cluster and move workloads over.