kubernetes_cluster
Generated on 15 Jul 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_upgrade bool |
A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window. | |
client_override_options dict |
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. | |
ha bool |
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_policy dict |
An object specifying the maintenance window policy for the Kubernetes cluster. | |
module_override_options dict |
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. | |
name str / required |
A human-readable name for a Kubernetes cluster. | |
node_pools list / elements=dict |
An object specifying the details of the worker nodes available to the Kubernetes cluster. | |
region str / required |
The slug identifier for the region where the Kubernetes cluster is located. | |
state str |
Choices:
|
State of the resource, present to create, absent to destroy. |
surge_upgrade bool |
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. | |
tags list / elements=str |
An array of tags applied to the Kubernetes cluster. All clusters are automatically tagged k8s and k8s:$K8S_CLUSTER_ID . |
|
timeout int |
Default: 300 |
Polling timeout in seconds. |
token str |
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 |
|
version str |
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_uuid str |
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: 3
Return Values
Key | Returned | Description |
---|---|---|
error dict |
failure | DigitalOcean API error. Sample:
|
kubernetes_cluster dict |
always | Kubernetes cluster information. Sample:
|
msg str |
always | Kubernetes cluster result information. Sample:
|