To add an additional node pool to a Kubernetes clusters, send a POST request
to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools
with the following
attributes.
Name | Type | Required | Description | Default Value |
---|---|---|---|---|
cluster_id |
string | True | A unique ID that can be used to reference a Kubernetes cluster. | |
body |
JSON or IO[bytes] | True |
import os
from pydo import Client
client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))
req = {
"size": "s-1vcpu-2gb",
"count": 3,
"name": "new-pool",
"tags": [
"frontend"
],
"auto_scale": True,
"min_nodes": 3,
"max_nodes": 6
}
resp = client.kubernetes.add_node_pool(cluster_id="ba9d8da", body=req)
See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.