doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / Create Kubernetes Cluster

Create Kubernetes Cluster

Doctl command syntax to create kubernetes cluster. Copyable examples, output expectations, and common mistakes.

$
Terminal
doctl k c c --count <3> --region <nyc1> --size <s-1vcpu-2gb> --version <latest> <cluster_name>

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
Creating Kubernetes cluster...

ID            Name            Region   Version   Nodes
---------------------------------------------------
abc1234      my-cluster     nyc1     latest    3

Cluster created successfully!

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
k
k|kubernetes
The value supplied for k|kubernetes.
c
c|cluster
The value supplied for c|cluster.
c
c|create
The value supplied for c|create.
<3>
3
The value supplied for 3.
<nyc1>
nyc1
The value supplied for nyc1.
<s-1vcpu-2gb>
s 1vcpu 2gb
The value supplied for s 1vcpu 2gb.
<latest>
latest
The value supplied for latest.
<cluster_name>
cluster name
The value supplied for cluster name.
--count
Command Option
Tool-specific option used by this command invocation.
--region
Command Option
Tool-specific option used by this command invocation.
--size
Command Option
Tool-specific option used by this command invocation.
--version
Command Option
Tool-specific option used by this command invocation.

How To Run

Execution path

  1. Step 1

    Run the command: doctl kubernetes cluster create --count 3 --region nyc1 --size s-1vcpu-2gb --version latest my-cluster

  2. Step 2

    Verify the cluster status with: doctl kubernetes cluster get my-cluster

  3. Step 3

    Access the cluster using kubectl: doctl kubernetes cluster kubeconfig save my-cluster

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.