Skip to main content

clusters

Overview

Nameclusters
TypeResource
Iddigitalocean.kubernetes.clusters

Fields

NameDatatypeDescription
idstringA unique ID that can be used to identify and reference a Kubernetes cluster.
namestringA human-readable name for a Kubernetes cluster.
auto_upgradebooleanA boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window.
cluster_subnetstringThe range of IP addresses in the overlay network of the Kubernetes cluster in CIDR notation.
created_atstringA time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was created.
endpointstringThe base URL of the API server on the Kubernetes master node.
habooleanA 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.
ipv4stringThe public IPv4 address of the Kubernetes master node. This will not be set if high availability is configured on the cluster (v1.21+)
maintenance_policyobjectAn object specifying the maintenance window policy for the Kubernetes cluster.
node_poolsarrayAn object specifying the details of the worker nodes available to the Kubernetes cluster.
regionstringThe slug identifier for the region where the Kubernetes cluster is located.
registry_enabledbooleanA read-only boolean value indicating if a container registry is integrated with the cluster.
service_subnetstringThe range of assignable IP addresses for services running in the Kubernetes cluster in CIDR notation.
statusobjectAn object containing a state attribute whose value is set to a string indicating the current status of the cluster.
surge_upgradebooleanA 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.
tagsarrayAn array of tags applied to the Kubernetes cluster. All clusters are automatically tagged k8s and k8s:$K8S_CLUSTER_ID.
updated_atstringA time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated.
versionstringThe slug identifier for the version of Kubernetes used for the cluster. If set to a minor version (e.g. "1.14"), the latest version within it will be used (e.g. "1.14.6-do.1"); if set to "latest", the latest published version will be used. See the /v2/kubernetes/options endpoint to find all currently available versions.
vpc_uuidstringA string specifying the UUID of the VPC to which the Kubernetes cluster is assigned.

Methods

NameAccessible byRequired ParamsDescription
get_clusterSELECTcluster_idTo show information about an existing Kubernetes cluster, send a GET request
to /v2/kubernetes/clusters/$K8S_CLUSTER_ID.
list_clustersSELECTTo list all of the Kubernetes clusters on your account, send a GET request
to /v2/kubernetes/clusters.
create_clusterINSERTdata__name, data__node_pools, data__region, data__versionTo create a new Kubernetes cluster, send a POST request to
/v2/kubernetes/clusters. The request must contain at least one node pool
with at least one worker.

The request may contain a maintenance window policy describing a time period
when disruptive maintenance tasks may be carried out. Omitting the policy
implies that a window will be chosen automatically. See
here
for details.
delete_clusterDELETEcluster_idTo delete a Kubernetes cluster and all services deployed to it, send a DELETE
request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID.

A 204 status code with no body will be returned in response to a successful
request.
_get_clusterEXECcluster_idTo show information about an existing Kubernetes cluster, send a GET request
to /v2/kubernetes/clusters/$K8S_CLUSTER_ID.
_list_clustersEXECTo list all of the Kubernetes clusters on your account, send a GET request
to /v2/kubernetes/clusters.
destroy_associatedResourcesDangerousEXECcluster_idTo delete a Kubernetes cluster with all of its associated resources, send a
DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/dangerous.
A 204 status code with no body will be returned in response to a successful request.
destroy_associatedResourcesSelectiveEXECcluster_idTo delete a Kubernetes cluster along with a subset of its associated resources,
send a DELETE request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources/selective.

The JSON body of the request should include load_balancers, volumes, or
volume_snapshots keys each set to an array of IDs for the associated
resources to be destroyed.

The IDs can be found by querying the cluster's associated resources endpoint.
Any associated resource not included in the request will remain and continue
to accrue changes on your account.
get_kubeconfigEXECcluster_idThis endpoint returns a kubeconfig file in YAML format. It can be used to
connect to and administer the cluster using the Kubernetes command line tool,
kubectl, or other programs supporting kubeconfig files (e.g., client libraries).

The resulting kubeconfig file uses token-based authentication for clusters
supporting it, and certificate-based authentication otherwise. For a list of
supported versions and more information, see "How to Connect to a DigitalOcean
Kubernetes Cluster with kubectl
".

To retrieve a kubeconfig file for use with a Kubernetes cluster, send a GET
request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig.

Clusters supporting token-based authentication may define an expiration by
passing a duration in seconds as a query parameter to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/kubeconfig?expiry_seconds=$DURATION_IN_SECONDS.
If not set or 0, then the token will have a 7 day expiry. The query parameter
has no impact in certificate-based authentication.
list_associatedResourcesEXECcluster_idTo list the associated billable resources that can be destroyed along with a cluster, send a GET request to the /v2/kubernetes/clusters/$K8S_CLUSTER_ID/destroy_with_associated_resources endpoint.
update_clusterEXECcluster_id, data__nameTo update a Kubernetes cluster, send a PUT request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID and specify one or more of the
attributes below.
upgrade_clusterEXECcluster_idTo immediately upgrade a Kubernetes cluster to a newer patch release of
Kubernetes, send a POST request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrade.
The body of the request must specify a version attribute.

Available upgrade versions for a cluster can be fetched from
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades.