{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","description":"To create a new Kubernetes cluster, send a POST request to\n`/v2/kubernetes/clusters`. The request must contain at least one node pool\nwith at least one worker.\n\nThe request may contain a maintenance window policy describing a time period\nwhen disruptive maintenance tasks may be carried out. Omitting the policy\nimplies that a window will be chosen automatically. See\n[here](https://docs.digitalocean.com/products/kubernetes/how-to/upgrade-cluster/)\nfor details.\n","properties":{"body":{"$ref":"#/definitions/cluster"}},"required":["body"],"additionalProperties":false,"definitions":{"cluster":{"type":"object","properties":{"name":{"type":"string","description":"A human-readable name for a Kubernetes cluster.","examples":["prod-cluster-01"]},"region":{"type":"string","description":"The slug identifier for the region where the Kubernetes cluster is located.","examples":["nyc1"]},"version":{"type":"string","description":"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.","examples":["1.18.6-do.0"]},"cluster_subnet":{"type":"string","description":"The range of IP addresses for the overlay network of the Kubernetes cluster in CIDR notation.","examples":["192.168.0.0/20"]},"service_subnet":{"type":"string","description":"The range of assignable IP addresses for services running in the Kubernetes cluster in CIDR notation.","examples":["192.168.16.0/24"]},"vpc_uuid":{"type":"string","format":"uuid","description":"A string specifying the UUID of the VPC to which the Kubernetes cluster is assigned.<br><br>Requires `vpc:read` scope.","examples":["c33931f2-a26a-4e61-b85c-4e95a2ec431b"]},"worker_subnet_uuid":{"type":"string","format":"uuid","description":"The UUID of the VPC subnet to attach worker nodes to. When omitted on\ncreate, the default subnet for the VPC is used. This value cannot be changed\nafter the cluster is created.\n\n`vpc_uuid` must also be set.\n<br><br>Requires `vpc:read` scope.\n","examples":["cbd79771-23eb-49be-b5ea-59cc56222622"]},"tags":{"type":"array","items":{"type":"string"},"description":"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.","examples":[["k8s","k8s:bd5f5959-5e1e-4205-a714-a914373942af","production","web-team"]]},"node_pools":{"type":"array","description":"An object specifying the details of the worker nodes available to the Kubernetes cluster.","items":{"$ref":"#/definitions/kubernetes_node_pool"}},"maintenance_policy":{"$ref":"#/definitions/maintenance_policy"},"auto_upgrade":{"type":"boolean","default":false,"description":"A boolean value indicating whether the cluster will be automatically upgraded to new patch releases during its maintenance window.","examples":[true]},"isolated_workers":{"type":"boolean","default":false,"description":"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.","examples":[false]},"gpu_operator_ready":{"type":"boolean","default":false,"description":"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.","examples":[false]},"surge_upgrade":{"type":"boolean","default":false,"description":"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.","examples":[true]},"ha":{"type":"boolean","description":"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.","examples":[true]},"control_plane_firewall":{"$ref":"#/definitions/control_plane_firewall"},"cluster_autoscaler_configuration":{"$ref":"#/definitions/cluster_autoscaler_configuration"},"sso":{"$ref":"#/definitions/sso"},"routing_agent":{"$ref":"#/definitions/routing_agent"},"p2p_oci_registry_plugin":{"$ref":"#/definitions/p2p_oci_registry_plugin"},"nfs_csi_plugin":{"$ref":"#/definitions/nfs_csi_plugin"},"amd_gpu_device_plugin":{"$ref":"#/definitions/amd_gpu_device_plugin"},"amd_gpu_device_metrics_exporter_plugin":{"$ref":"#/definitions/amd_gpu_device_metrics_exporter_plugin"},"nvidia_gpu_device_plugin":{"$ref":"#/definitions/nvidia_gpu_device_plugin"},"nvidia_gpu_dra_driver":{"$ref":"#/definitions/nvidia_gpu_dra_driver"},"amd_gpu_dra_driver":{"$ref":"#/definitions/amd_gpu_dra_driver"},"rdma_shared_dev_plugin":{"$ref":"#/definitions/rdma_shared_dev_plugin"},"coredns_autoscaler":{"$ref":"#/definitions/coredns_autoscaler"}},"required":["name","region","version","node_pools"]},"kubernetes_node_pool":{"type":"object","allOf":[{"$ref":"#/definitions/kubernetes_node_pool_size"},{"$ref":"#/definitions/kubernetes_node_pool_base"},{"$ref":"#/definitions/kubernetes_node_pool_gpu_partition"}],"required":["name","size","count"]},"maintenance_policy":{"type":["object","null"],"description":"An object specifying the maintenance window policy for the Kubernetes cluster.","properties":{"start_time":{"type":"string","description":"The start time in UTC of the maintenance window policy in 24-hour clock format / HH:MM notation (e.g., `15:00`).","examples":["12:00"]},"day":{"type":"string","enum":["any","monday","tuesday","wednesday","thursday","friday","saturday","sunday"],"description":"The day of the maintenance window policy. May be one of `monday` through `sunday`, or `any` to indicate an arbitrary week day.","examples":["any"]}}},"control_plane_firewall":{"type":["object","null"],"description":"An object specifying the control plane firewall for the Kubernetes cluster. Control plane firewall is in early availability (invite only).","properties":{"enabled":{"type":"boolean","description":"Indicates whether the control plane firewall is enabled.","examples":[true]},"allowed_addresses":{"type":"array","description":"An array of public addresses (IPv4 or CIDR) allowed to access the control plane.","items":{"type":"string"},"examples":[["1.2.3.4/32","1.1.0.0/16"]]}}},"cluster_autoscaler_configuration":{"type":["object","null"],"description":"An object specifying custom cluster autoscaler configuration.","properties":{"scale_down_utilization_threshold":{"type":"number","description":"Used to customize when cluster autoscaler scales down non-empty nodes by setting the node utilization threshold.","examples":[0.65]},"scale_down_unneeded_time":{"type":"string","description":"Used to customize how long a node is unneeded before being scaled down.","examples":["1m0s"]},"expanders":{"type":"array","items":{"type":"string","enum":["random","priority","least_waste"]},"description":"Customizes expanders used by cluster-autoscaler.\nThe autoscaler will apply each expander from the provided list to narrow down the selection of node types created to scale up,\nuntil either a single node type is left, or the list of expanders is exhausted.\nIf this flag is unset, autoscaler will use its default expander `random`.\nPassing an empty list (_not_ `null`) will unset any previous expander customizations.\n\nAvailable expanders:\n- `random`: Randomly selects a node group to scale.\n- `priority`: Selects the node group with the highest priority as per [user-provided configuration](https://docs.digitalocean.com/products/kubernetes/how-to/autoscale/#configuring-priority-expander)\n- `least_waste`: Selects the node group that will result in the least amount of idle resources.\n","examples":[["priority","random"]]}}},"sso":{"type":["object","null"],"description":"An object specifying Single Sign-On (SSO) configuration for the Kubernetes cluster.","properties":{"enabled":{"type":"boolean","default":false,"description":"Indicates whether SSO authentication is enabled for the cluster.","examples":[true]},"required":{"type":"boolean","default":false,"description":"Indicates whether any non-SSO forms of authentication are disallowed.\nCan only be set to `true` when `enabled` is\n`true`.\n","examples":[false]},"issuer_url":{"type":"string","format":"uri","description":"The OIDC issuer URL for the identity provider. Required when `enabled` is\n`true`.\n","examples":["https://sso.example.com"]},"client_id":{"type":"string","description":"The OIDC client ID registered with the identity provider. Required when\n`enabled` is `true`.\n","examples":["doks-cluster-client"]}}},"routing_agent":{"type":["object","null"],"description":"An object specifying whether the routing-agent component should be enabled for the Kubernetes cluster.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the routing-agent component is enabled.","examples":[true]}}},"p2p_oci_registry_plugin":{"type":["object","null"],"description":"An object specifying whether the Peer-to-peer OCI registry component should be enabled for the Kubernetes cluster.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the Peer-to-peer OCI registry component is enabled.","examples":[true]}}},"nfs_csi_plugin":{"type":["object","null"],"description":"An object specifying whether the NFS CSI plugin should be enabled for the Kubernetes cluster.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the NFS CSI plugin is enabled.","examples":[true]}}},"amd_gpu_device_plugin":{"type":["object","null"],"description":"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.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the AMD GPU Device Plugin is enabled.","examples":[true]}}},"amd_gpu_device_metrics_exporter_plugin":{"type":["object","null"],"description":"An object specifying whether the AMD Device Metrics Exporter should be enabled in the Kubernetes cluster.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the AMD Device Metrics Exporter is enabled.","examples":[true]}}},"nvidia_gpu_device_plugin":{"type":["object","null"],"description":"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.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the Nvidia GPU Device Plugin is enabled.","examples":[true]}}},"nvidia_gpu_dra_driver":{"type":["object","null"],"description":"An object specifying whether the NVIDIA GPU DRA Driver should be enabled in the Kubernetes cluster. Mutually exclusive with `nvidia_gpu_device_plugin`.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the NVIDIA GPU DRA Driver is enabled.","examples":[true]}}},"amd_gpu_dra_driver":{"type":["object","null"],"description":"An object specifying whether the AMD GPU DRA Driver should be enabled in the Kubernetes cluster. Mutually exclusive with `amd_gpu_device_plugin`.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the AMD GPU DRA Driver is enabled.","examples":[true]}}},"rdma_shared_dev_plugin":{"type":["object","null"],"description":"An object specifying whether the RDMA shared device plugin should be enabled in the Kubernetes cluster.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the RDMA shared device plugin is enabled.","examples":[true]}}},"coredns_autoscaler":{"type":["object","null"],"description":"An object specifying whether the Cluster Proportional Autoscaler (CPA) add-on for CoreDNS should be enabled for the Kubernetes cluster.","properties":{"enabled":{"type":"boolean","description":"Indicates whether the CoreDNS Cluster Proportional Autoscaler add-on is enabled.","examples":[true]}}},"kubernetes_node_pool_size":{"type":"object","properties":{"size":{"type":"string","description":"The slug identifier for the type of Droplet used as workers in the node pool.","examples":["s-1vcpu-2gb"]}}},"kubernetes_node_pool_base":{"type":"object","properties":{"name":{"type":"string","description":"A human-readable name for the node pool.","examples":["frontend-pool"]},"count":{"type":"integer","description":"The number of Droplet instances in the node pool.","examples":[3]},"tags":{"type":"array","items":{"type":"string"},"description":"An array containing the tags applied to the node pool. All node pools are automatically tagged `k8s`, `k8s-worker`, and `k8s:$K8S_CLUSTER_ID`. <br><br>Requires `tag:read` scope.","examples":[["k8s","k8s:bd5f5959-5e1e-4205-a714-a914373942af","k8s-worker","production","web-team"]]},"labels":{"type":["object","null"],"description":"An object of key/value mappings specifying labels to apply to all nodes in a pool. Labels will automatically be applied to all existing nodes and any subsequent nodes added to the pool. Note that when a label is removed, it is not deleted from the nodes in the pool.","examples":[null]},"taints":{"type":"array","items":{"$ref":"#/definitions/kubernetes_node_pool_taint"},"description":"An array of taints to apply to all nodes in a pool. Taints will automatically be applied to all existing nodes and any subsequent nodes added to the pool. When a taint is removed, it is deleted from all nodes in the pool."},"auto_scale":{"type":"boolean","description":"A boolean value indicating whether auto-scaling is enabled for this node pool.","examples":[true]},"min_nodes":{"type":"integer","description":"The minimum number of nodes that this node pool can be auto-scaled to. The value will be `0` if `auto_scale` is set to `false`.","examples":[3]},"max_nodes":{"type":"integer","description":"The maximum number of nodes that this node pool can be auto-scaled to. The value will be `0` if `auto_scale` is set to `false`.","examples":[6]}}},"kubernetes_node_pool_gpu_partition":{"type":"object","properties":{"gpu_partition_mode":{"type":"string","enum":["AMD_PARTITION_MODE_SPX_NPS1","AMD_PARTITION_MODE_DPX_NPS2"],"description":"The AMD GPU partition mode for this node pool. Only applicable to AMD GPU sizes that support partitioning. Immutable after the node pool is created. When omitted, the GPUs in the pool are left unpartitioned.","examples":["AMD_PARTITION_MODE_SPX_NPS1"]}}},"kubernetes_node_pool_taint":{"type":"object","properties":{"key":{"type":"string","description":"An arbitrary string. The `key` and `value` fields of the `taint` object form a key-value pair. For example, if the value of the `key` field is \"special\" and the value of the `value` field is \"gpu\", the key value pair would be `special=gpu`.","examples":["priority"]},"value":{"type":"string","description":"An arbitrary string. The `key` and `value` fields of the `taint` object form a key-value pair. For example, if the value of the `key` field is \"special\" and the value of the `value` field is \"gpu\", the key value pair would be `special=gpu`.","examples":["high"]},"effect":{"type":"string","enum":["NoSchedule","PreferNoSchedule","NoExecute"],"description":"How the node reacts to pods that it won't tolerate. Available effect values are `NoSchedule`, `PreferNoSchedule`, and `NoExecute`.","examples":["NoSchedule"]}}}}},"name":"Create a New Kubernetes Cluster","id":"digitalocean.kubernetes_create_cluster","example":{"body":{"name":"prod-cluster-01","region":"nyc1","version":"1.18.6-do.0","node_pools":[]}},"maxRequests":1,"summary":false}}