POST
/v2/kubernetes/clustersCreate a New Kubernetes Cluster
To 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.
- IdempotentThe SDK sends
Idempotency-Key, so a retried request is only applied once.
idstringoptional
A unique ID that can be used to identify and reference a Kubernetes cluster.
namestringrequired
A human-readable name for a Kubernetes cluster.
regionstringrequired
The slug identifier for the region where the Kubernetes cluster is located.
versionstringrequired
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.
cluster_subnetstringoptional
The range of IP addresses for the overlay network of the Kubernetes cluster in CIDR notation.
service_subnetstringoptional
The range of assignable IP addresses for services running in the Kubernetes cluster in CIDR notation.
vpc_uuidstringoptional
A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned.<br><br>Requires `vpc:read` scope.
worker_subnet_uuidstringoptional
The UUID of the VPC subnet to attach worker nodes to. When omitted on
create, the default subnet for the VPC is used. This value cannot be changed
after the cluster is created.
`vpc_uuid` must also be set.
<br><br>Requires `vpc:read` scope.
ipv4stringoptional
The public IPv4 address of the Kubernetes master node. This will not be set if high availability is configured on the cluster (v1.21+)
endpointstringoptional
The base URL of the API server on the Kubernetes master node.
tagsarray<string>optional
An array of tags to apply to the Kubernetes cluster. All clusters are automatically tagged `k8s` and `k8s:$K8S_CLUSTER_ID`. <br><br>Requires `tag:read` and `tag:create` scope, as well as `tag:delete` if existing tags are getting removed.
node_poolsarray<object>required
An object specifying the details of the worker nodes available to the Kubernetes cluster.
maintenance_policyobjectoptional
An object specifying the maintenance window policy for the Kubernetes cluster.
auto_upgradebooleanoptional
A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window.
isolated_workersbooleanoptional
A boolean value indicating whether worker nodes in the cluster are not assigned public IP addresses. When omitted on create, the default value is false. When enabled, a NAT gateway must exist in the VPC where the cluster is created.
gpu_operator_readybooleanoptional
A boolean value indicating whether GPU nodes in the cluster are launched with images that do not include pre-installed GPU drivers, allowing GPU drivers to be managed by a GPU operator instead. Mutually exclusive with other GPU-related cluster options, such as `nvidia_gpu_dra_driver` and `amd_gpu_dra_driver`. When omitted on create, the default value is false.
statusobjectoptional
An object containing a `state` attribute whose value is set to a string indicating the current status of the cluster.
created_atstringoptional
A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was created.
updated_atstringoptional
A time value given in ISO8601 combined date and time format that represents when the Kubernetes cluster was last updated.
surge_upgradebooleanoptional
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.
habooleanoptional
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.
registry_enabledbooleanoptional
A boolean value indicating whether GPU nodes in the cluster are launched with images that do not include pre-installed GPU drivers, allowing GPU drivers to be managed by a GPU operator instead. Mutually exclusive with other GPU-related cluster options, such as `nvidia_gpu_dra_driver` and `amd_gpu_dra_driver`. When omitted on create, the default value is false.
control_plane_firewallobjectoptional
An object specifying the control plane firewall for the Kubernetes cluster. Control plane firewall is in early availability (invite only).
cluster_autoscaler_configurationobjectoptional
An object specifying custom cluster autoscaler configuration.
ssoobjectoptional
An object specifying Single Sign-On (SSO) configuration for the Kubernetes cluster.
routing_agentobjectoptional
An object specifying whether the routing-agent component should be enabled for the Kubernetes cluster.
p2p_oci_registry_pluginobjectoptional
An object specifying whether the Peer-to-peer OCI registry component should be enabled for the Kubernetes cluster.
nfs_csi_pluginobjectoptional
An object specifying whether the NFS CSI plugin should be enabled for the Kubernetes cluster.
amd_gpu_device_pluginobjectoptional
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.
amd_gpu_device_metrics_exporter_pluginobjectoptional
An object specifying whether the AMD Device Metrics Exporter should be enabled in the Kubernetes cluster.
nvidia_gpu_device_pluginobjectoptional
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.
nvidia_gpu_dra_driverobjectoptional
An object specifying whether the NVIDIA GPU DRA Driver should be enabled in the Kubernetes cluster. Mutually exclusive with `nvidia_gpu_device_plugin`.
amd_gpu_dra_driverobjectoptional
An object specifying whether the AMD GPU DRA Driver should be enabled in the Kubernetes cluster. Mutually exclusive with `amd_gpu_device_plugin`.
rdma_shared_dev_pluginobjectoptional
An object specifying whether the RDMA shared device plugin should be enabled in the Kubernetes cluster.
coredns_autoscalerobjectoptional
An object specifying whether the Cluster Proportional Autoscaler (CPA) add-on for CoreDNS should be enabled for the Kubernetes cluster.
201The response will be a JSON object with a key called `kubernetes_cluster`. The
value of this will be an object containing the standard attributes of a
Kubernetes cluster.
The IP address and cluster API server endpoint will not be available until the
cluster has finished provisioning. The initial value of the cluster's
`status.state` attribute will be `provisioning`. When the cluster is ready,
this will transition to `running`.
kubernetes_clusterobjectoptional
401Authentication failed due to invalid credentials.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
429The API rate limit has been exceeded.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
500There was a server error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
defaultThere was an unexpected error.
idstringrequired
A short identifier corresponding to the HTTP status code returned. For example, the ID for a response returning a 404 status code would be "not_found."
messagestringrequired
A message providing additional information about the error, including details to help resolve it when possible.
request_idstringoptional
Optionally, some endpoints may include a request ID that should be provided when reporting bugs or opening support tickets to help identify the issue.
Error handling
A 401 is returned: Authentication failed due to invalid credentials. A 429 is returned: The API rate limit has been exceeded. A 500 is returned: There was a server error. Any other status is an error: There was an unexpected error.