kubernetes_cluster
Generated on 18 Nov 2025
from digitalocean.cloud version
v1.2.1
Synopsis
Create or delete Kubernetes clusters. View the API documentation at https://docs.digitalocean.com/reference/api/api-reference/#tag/Kubernetes.
Requirements
- pydo >= 0.1.3
- azure-core >= 1.26.1
Parameters
| Parameter | Choices / Default | Description |
|---|---|---|
auto_upgradebool |
A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window. | |
client_override_optionsdict |
Client override options (developer use). For example, can be used to override the DigitalOcean API endpoint for an internal test suite. If provided, these options will knock out existing options. | |
habool |
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. | |
maintenance_policydict |
An object specifying the maintenance window policy for the Kubernetes cluster. | |
module_override_optionsdict |
Module override options (developer use). Can be used to override module options to support experimental or future options. If provided, these options will knock out existing options. | |
namestr / required |
A human-readable name for a Kubernetes cluster. | |
node_poolslist / elements=dict |
An object specifying the details of the worker nodes available to the Kubernetes cluster. | |
regionstr / required |
The slug identifier for the region where the Kubernetes cluster is located. | |
statestr |
Choices:
|
State of the resource, present to create, absent to destroy. |
surge_upgradebool |
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. | |
tagslist / elements=str |
An array of tags applied to the Kubernetes cluster. All clusters are automatically tagged k8s and k8s:$K8S_CLUSTER_ID. |
|
timeoutint |
Default: 300 |
Polling timeout in seconds. |
tokenstr |
DigitalOcean API token. There are several environment variables which can be used to provide this value. DIGITALOCEAN_ACCESS_TOKEN, DIGITALOCEAN_TOKEN, DO_API_TOKEN, DO_API_KEY, DO_OAUTH_TOKEN and OAUTH_TOKEN |
|
versionstr |
The 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_uuidstr |
A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned. |
Examples
- name: Create Kubernetes cluster
digitalocean.cloud.kubernetes_cluster:
token: "{{ token }}"
state: present
name: prod-cluster-01
region: nyc1
version: "1.18.6-do.0"
node_pools:
- size: s-1vcpu-2gb
name: worker-pool
count: 3Return Values
| Key | Returned | Description |
|---|---|---|
errordict |
failure | DigitalOcean API error. Sample: |
kubernetes_clusterdict |
always | Kubernetes cluster information. Sample: |
msgstr |
always | Kubernetes cluster result information. Sample: |