pydo.kubernetes.update_cluster()

Generated on 3 Aug 2026 from pydo version v0.40.0

Usage

client.kubernetes.update_cluster(
    cluster_id="bd5f5959-5e1e-4205-a714-a914373942af",
    body={
        "name": "prod-cluster-01",
        "tags": [...],
        "maintenance_policy": {...},
        ...,
    },
)
Returns JSONRaises HttpResponseError

Description

To update a Kubernetes cluster, send a PUT request to /v2/kubernetes/clusters/{cluster_id} and specify one or more of the attributes below.

Parameters

cluster_id string required

A unique ID that can be used to reference a Kubernetes cluster.

Min: 1

name string required

Example: prod-cluster-01

A human-readable name for a Kubernetes cluster.

tags array of strings optional

Example: ['k8s', 'k8s:bd5f5959-5e1e-4205-a714-a914373942af', 'production', 'web-team']

An array of tags applied to the Kubernetes cluster. All clusters are automatically tagged k8s and k8s:$K8S_CLUSTER_ID.

maintenance_policy object or null optional

An object specifying the maintenance window policy for the Kubernetes cluster.

Show child properties
start_time string optional

Example: 12:00

The start time in UTC of the maintenance window policy in 24-hour clock format / HH:MM notation (e.g., 15:00).

duration string optional read-only

Example: 4h0m0s

The duration of the maintenance window policy in human-readable format.

day string optional

The day of the maintenance window policy. May be one of monday through sunday, or any to indicate an arbitrary week day.

One of: any, monday, tuesday, wednesday, thursday, friday, saturday, sunday

auto_upgrade boolean optional

Example: True

A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window.

Default: False

surge_upgrade boolean optional

Example: True

A boolean value indicating whether surge upgrade is enabled/disabled for the cluster. Surge upgrade makes cluster upgrades fast and reliable by bringing up new nodes before destroying the outdated nodes.

Default: False

ha boolean optional

Example: True

A boolean value indicating whether the control plane is run in a highly available configuration in the cluster. Highly available control planes incur less downtime. The property cannot be disabled. When omitted on create, the default is version-dependent; for DOKS 1.36.0 and later, the default is true; for earlier versions, the default is false.

control_plane_firewall object or null optional

An object specifying the control plane firewall for the Kubernetes cluster. Control plane firewall is in early availability (invite only).

Show child properties
enabled boolean optional

Example: True

Indicates whether the control plane firewall is enabled.

allowed_addresses array of strings optional

Example: ['1.2.3.4/32', '1.1.0.0/16']

An array of public addresses (IPv4 or CIDR) allowed to access the control plane.

cluster_autoscaler_configuration object or null optional

An object specifying custom cluster autoscaler configuration.

Show child properties
scale_down_utilization_threshold number optional

Example: 0.65

Used to customize when cluster autoscaler scales down non-empty nodes by setting the node utilization threshold.

scale_down_unneeded_time string optional

Example: 1m0s

Used to customize how long a node is unneeded before being scaled down.

expanders array of strings optional

Example: ['priority', 'random']

Customizes expanders used by cluster-autoscaler.
The autoscaler will apply each expander from the provided list to narrow down the selection of node types created to scale up,
until either a single node type is left, or the list of expanders is exhausted.
If this flag is unset, autoscaler will use its default expander random.
Passing an empty list (_not_ null) will unset any previous expander customizations.

Available expanders:
- random: Randomly selects a node group to scale.
- priority: Selects the node group with the highest priority as per user-provided configuration
- least_waste: Selects the node group that will result in the least amount of idle resources.

sso object or null optional

An object specifying Single Sign-On (SSO) configuration for the Kubernetes cluster.

Show child properties
enabled boolean optional

Example: True

Indicates whether SSO authentication is enabled for the cluster.

Default: False

required boolean optional

Example: False

Indicates whether any non-SSO forms of authentication are disallowed.
Can only be set to true when enabled is
true.

Default: False

issuer_url string optional

Example: https://sso.example.com

The OIDC issuer URL for the identity provider. Required when enabled is
true.

client_id string optional

Example: doks-cluster-client

The OIDC client ID registered with the identity provider. Required when
enabled is true.

routing_agent object or null optional

An object specifying whether the routing-agent component should be enabled for the Kubernetes cluster.

Show child properties
enabled boolean optional

Example: True

Indicates whether the routing-agent component is enabled.

p2p_oci_registry_plugin object or null optional

An object specifying whether the Peer-to-peer OCI registry component should be enabled for the Kubernetes cluster.

Show child properties
enabled boolean optional

Example: True

Indicates whether the Peer-to-peer OCI registry component is enabled.

amd_gpu_device_plugin object or null optional

An object specifying whether the AMD GPU Device Plugin should be enabled in the Kubernetes cluster. It's enabled by default for clusters with an AMD GPU node pool.

Show child properties
enabled boolean optional

Example: True

Indicates whether the AMD GPU Device Plugin is enabled.

amd_gpu_device_metrics_exporter_plugin object or null optional

An object specifying whether the AMD Device Metrics Exporter should be enabled in the Kubernetes cluster.

Show child properties
enabled boolean optional

Example: True

Indicates whether the AMD Device Metrics Exporter is enabled.

nvidia_gpu_device_plugin object or null optional

An object specifying whether the Nvidia GPU Device Plugin should be enabled in the Kubernetes cluster. It's enabled by default for clusters with an Nvidia GPU node pool.

Show child properties
enabled boolean optional

Example: True

Indicates whether the Nvidia GPU Device Plugin is enabled.

rdma_shared_dev_plugin object or null optional

An object specifying whether the RDMA shared device plugin should be enabled in the Kubernetes cluster.

Show child properties
enabled boolean optional

Example: True

Indicates whether the RDMA shared device plugin is enabled.

coredns_autoscaler object or null optional

An object specifying whether the Cluster Proportional Autoscaler (CPA) add-on for CoreDNS should be enabled for the Kubernetes cluster.

Show child properties
enabled boolean optional

Example: True

Indicates whether the CoreDNS Cluster Proportional Autoscaler add-on is enabled.

Request Sample

Show Request Sample
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req = {
  "name": "prod-cluster-01",
  "tags": [
    "k8s",
    "k8s:bd5f5959-5e1e-4205-a714-a914373942af",
    "production",
    "web-team"
  ],
  "maintenance_policy": {
    "start_time": "12:00",
    "day": "any"
  },
  "auto_upgrade": True,
  "surge_upgrade": True,
  "ha": True
}

resp = client.kubernetes.update_cluster(cluster_id="1fd32a", body=req)

Response Example

Show Response Example
{
  "kubernetes_cluster": {
    "id": "bd5f5959-5e1e-4205-a714-a914373942af",
    "name": "prod-cluster-01",
    "region": "nyc1",
    "version": "1.18.6-do.0",
    "cluster_subnet": "10.244.0.0/16",
    "service_subnet": "10.245.0.0/16",
    "vpc_uuid": "c33931f2-a26a-4e61-b85c-4e95a2ec431b",
    "ipv4": "68.183.121.157",
    "endpoint": "https://bd5f5959-5e1e-4205-a714-a914373942af.k8s.ondigitalocean.com",
    "tags": [
      "production",
      "web-team",
      "k8s",
      "k8s:bd5f5959-5e1e-4205-a714-a914373942af"
    ],
    "node_pools": [
      {
        "id": "cdda885e-7663-40c8-bc74-3a036c66545d",
        "name": "frontend-pool",
        "size": "s-1vcpu-2gb",
        "count": 3,
        "tags": [
          "production",
          "web-team",
          "k8s",
          "k8s:bd5f5959-5e1e-4205-a714-a914373942af",
          "k8s:worker"
        ],
        "labels": null,
        "taints": [],
        "auto_scale": false,
        "min_nodes": 0,
        "max_nodes": 0,
        "nodes": [
          {
            "id": "478247f8-b1bb-4f7a-8db9-2a5f8d4b8f8f",
            "name": "adoring-newton-3niq",
            "status": {
              "state": "running"
            },
            "droplet_id": "205545370",
            "created_at": "2018-11-15T16:00:11Z",
            "updated_at": "2018-11-15T16:00:11Z"
          },
          {
            "id": "ad12e744-c2a9-473d-8aa9-be5680500eb1",
            "name": "adoring-newton-3nim",
            "status": {
              "state": "running"
            },
            "droplet_id": "205545371",
            "created_at": "2018-11-15T16:00:11Z",
            "updated_at": "2018-11-15T16:00:11Z"
          },
          {
            "id": "e46e8d07-f58f-4ff1-9737-97246364400e",
            "name": "adoring-newton-3ni7",
            "status": {
              "state": "running"
            },
            "droplet_id": "205545372",
            "created_at": "2018-11-15T16:00:11Z",
            "updated_at": "2018-11-15T16:00:11Z"
          }
        ]
      },
      {
        "id": "f49f4379-7e7f-4af5-aeb6-0354bd840778",
        "name": "backend-pool",
        "size": "g-4vcpu-16gb",
        "count": 2,
        "tags": [
          "production",
          "web-team",
          "k8s",
          "k8s:bd5f5959-5e1e-4205-a714-a914373942af",
          "k8s:worker"
        ],
        "labels": {
          "service": "backend",
          "priority": "high"
        },
        "taints": [],
        "auto_scale": true,
        "min_nodes": 2,
        "max_nodes": 5,
        "nodes": [
          {
            "id": "3385619f-8ec3-42ba-bb23-8d21b8ba7518",
            "name": "affectionate-nightingale-3nif",
            "status": {
              "state": "running"
            },
            "droplet_id": "205545373",
            "created_at": "2018-11-15T16:00:11Z",
            "updated_at": "2018-11-15T16:00:11Z"
          },
          {
            "id": "4b8f60ff-ba06-4523-a6a4-b8148244c7e6",
            "name": "affectionate-nightingale-3niy",
            "status": {
              "state": "running"
            },
            "droplet_id": "205545374",
            "created_at": "2018-11-15T16:00:11Z",
            "updated_at": "2018-11-15T16:00:11Z"
          }
        ]
      }
    ],
    "maintenance_policy": {
      "start_time": "00:00",
      "duration": "4h0m0s",
      "day": "any"
    },
    "auto_upgrade": true,
    "status": {
      "state": "running"
    },
    "created_at": "2018-11-15T16:00:11Z",
    "updated_at": "2018-11-15T16:00:11Z",
    "surge_upgrade": true,
    "registry_enabled": false,
    "registries": [
      "registry-a",
      "registry-b"
    ],
    "ha": false,
    "control_plane_firewall": {
      "enabled": true,
      "allowed_addresses": [
        "1.2.3.4/32",
        "1.1.0.0/16"
      ]
    },
    "cluster_autoscaler_configuration": {
      "scale_down_utilization_threshold": 0.65,
      "scale_down_unneeded_time": "1m",
      "expanders": [
        "priority",
        "random"
      ]
    },
    "sso": {
      "enabled": true,
      "required": false,
      "issuer_url": "https://sso.example.com",
      "client_id": "doks-cluster-client"
    },
    "routing_agent": {
      "enabled": false
    },
    "amd_gpu_device_plugin": {
      "enabled": false
    },
    "amd_gpu_device_metrics_exporter_plugin": {
      "enabled": false
    },
    "nvidia_gpu_device_plugin": {
      "enabled": false
    },
    "rdma_shared_dev_plugin": {
      "enabled": false
    },
    "coredns_autoscaler": {
      "enabled": false
    },
    "p2p_oci_registry_plugin": {
      "enabled": false
    }
  }
}

More Information

See /v2/kubernetes/clusters/{cluster_id} in the API reference for additional detail on responses, headers, parameters, and more.

We can't find any results for your search.

Try using different keywords or simplifying your search terms.