import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="<id>", data={
"type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS,
"attributes": {
"worker_count": 5,
},
})
# Handle response
print(res)Scales the worker nodes or control plane nodes of a Kubernetes cluster. The cluster must be in Provisioned phase to accept updates.
Exactly one of worker_count or control_plane_count must be provided per request. You cannot scale workers and control plane nodes in the same request.
When scaling up, the API validates that sufficient server stock is available for the requested delta (e.g., scaling from 2 to 5 workers checks for 3 available servers).
When scaling from 0 workers, you must provide a worker_plan since there is no existing configuration to inherit the plan from.
Control plane scaling has a minimum of 1 node. You cannot scale control plane nodes to zero.
Returns 202 Accepted when a scaling operation is triggered. Poll the GET endpoint to monitor progress. Returns 200 OK if the requested count matches the current count (no-op).
import latitudesh_python_sdk
from latitudesh_python_sdk import Latitudesh
import os
with Latitudesh(
bearer=os.getenv("LATITUDESH_BEARER", ""),
) as latitudesh:
res = latitudesh.kubernetes_clusters.update_kubernetes_cluster(kubernetes_cluster_id="<id>", data={
"type": latitudesh_python_sdk.UpdateKubernetesClusterType.KUBERNETES_CLUSTERS,
"attributes": {
"worker_count": 5,
},
})
# Handle response
print(res)The cluster ID (format: kc_
Show child attributes
OK - No change needed
Show child attributes
Was this page helpful?