doctl kubernetes cluster create
Generated on 9 Apr 2025
from doctl
version
v1.124.0
Usage
doctl kubernetes cluster create <name> [flags]
Aliases
c
Description
Creates a Kubernetes cluster given the specified options and using the specified name. Before creating the cluster, you can use doctl kubernetes options
to see possible values for the various configuration flags.
If no configuration flags are used, a three-node cluster with a single node pool is created in the nyc1
region, using the latest Kubernetes version.
After creating a cluster, a configuration context is added to kubectl and made active so that you can begin managing your new cluster immediately.
Example
The following example creates a cluster named example-cluster
in the nyc1
region with a node pool, using Kubernetes version 1.28.2-do.0
:
doctl kubernetes cluster create example-cluster --region nyc1 --version 1.28.2-do.0 --maintenance-window saturday=02:00 --node-pool "name=example-pool;size=s-2vcpu-2gb;count=5;tag=web;tag=frontend;label=key1=value1;label=key2=label2;taint=key1=value1:NoSchedule;taint=key2:NoExecute"
Flags
Option | Description |
---|---|
--1-clicks |
A comma-separated list of 1-click applications to install on the Kubernetes cluster. Use the doctl kubernetes 1-click list command for a list of available 1-click applications. |
--auto-upgrade |
Enables automatic upgrades to new patch releases during the cluster’s maintenance window. Defaults to false . To enable automatic upgrade, supply --auto-upgrade=true .Default: false |
--cluster-subnet |
The CIDR block to use for the pod network. Must be a valid CIDR block. Defaults to 10.244.0.0/16 . If left empty/default the cluster will be created with a virtual network. If a custom one is provided, the cluster will be created as vpc-native cluster. VPC-native CIDR blocks cannot overlap within an account. |
--control-plane-firewall-allowed-addresses |
A comma-separated list of allowed addresses that can access the control plane. |
--count |
The number of nodes in the default node pool (incompatible with –node-pool) Default: 3 |
--enable-control-plane-firewall |
Creates the cluster with control plane firewall enabled. Defaults to false. To enable the control plane firewall, supply –enable-control-plane-firewall=true. Default: false |
--enable-routing-agent |
Creates the cluster with routing-agent enabled. Defaults to false. To enable routing-agent, supply –enable-routing-agent=true. Default: false |
--ha |
Creates the cluster with a highly-available control plane. Defaults to false. To enable the HA control plane, supply –ha=true. Default: false |
--help , -h |
Help for this command |
--maintenance-window |
Sets the beginning of the schedule for the four hour maintenance window for the cluster. The syntax format is: day=HH:MM , where time is in UTC. Day can be: any , monday , tuesday , wednesday , thursday , friday , saturday , sunday .Default: any=00:00 |
--node-pool |
A comma-separated list of
|
--region |
A slug indicating which region to create the cluster in. Use the doctl kubernetes options regions command for a list of options (required)Default: nyc1 |
--scale-down-unneeded-time |
The unneed time for the cluster autoscaler’s scale-down-unneeded-time. It defines how long a node should be unneeded before it is eligible for scale down. To set the scale-down-unneeded-time to a minute and 30 seconds for example, pass the string ‘1m30s’. |
--scale-down-utilization-threshold |
The threshold value for the cluster autoscaler’s scale-down-utilization-threshold. It is the maximum value between the sum of CPU requests and sum of memory requests of all pods running on the node divided by node’s corresponding allocatable resource, below which a node can be considered for scale down. To set the scale-down-utilization-threshold to 50%, pass the floating point value 0.5. |
--service-subnet |
The CIDR block to use for the service network. Must be a valid CIDR block. Defaults to 10.245.0.0/16 . If left empty/default the cluster will be created with a virtual network. If a custom one is provided, the cluster will be created as vpc-native cluster. VPC-native CIDR blocks cannot overlap within an account. |
--set-current-context |
Sets the current kubectl context to that of the new cluster Default: true |
--size |
The machine size to use when creating nodes in the default node pool (incompatible with –node-pool). Use the doctl kubernetes options sizes command for a list of possible values.Default: s-1vcpu-2gb |
--surge-upgrade |
Enables surge-upgrade for the cluster Default: true |
--tag |
A comma-separated list of tags to apply to the cluster, in addition to the default tags of k8s and k8s:$K8S_CLUSTER_ID . |
--update-kubeconfig |
Adds a configuration context for the new cluster to your kubectl Default: true |
--version |
A slug indicating which Kubernetes version to use when creating the cluster. Use the doctl kubernetes options versions command for a list of optionsDefault: latest |
--vpc-uuid |
The UUID of a VPC network to create the cluster in. Must be the UUID of a valid VPC in the same region specified for the cluster. If a VPC is not specified, the cluster is placed in the default VPC network for the region. |
--wait |
Instructs the terminal to wait for the action to complete before returning control to the user Default: true |
Related Commands
Command | Description |
---|---|
doctl kubernetes cluster | Display commands for managing Kubernetes clusters |
Global Flags
Option | Description |
---|---|
--access-token , -t |
API V2 access token |
--api-url , -u |
Override default API endpoint |
--config , -c |
Specify a custom config file Default: |
--context |
Specify a custom authentication context name |
--http-retry-max |
Set maximum number of retries for requests that fail with a 429 or 500-level error
Default: 5 |
--http-retry-wait-max |
Set the minimum number of seconds to wait before retrying a failed request
Default: 30 |
--http-retry-wait-min |
Set the maximum number of seconds to wait before retrying a failed request
Default: 1 |
--interactive |
Enable interactive behavior. Defaults to true if the terminal supports it (default false)
Default: false |
--output , -o |
Desired output format [text|json] Default: text |
--trace |
Show a log of network activity while performing a command Default: false |
--verbose , -v |
Enable verbose output Default: false |