Forrest logo
back to the doctl tool

doctl-kubernetes-cluster:tldr:5ecd8

doctl-kubernetes-cluster: Create a Kubernetes cluster.
$ doctl kubernetes cluster create --count ${3} --region ${nyc1} --size ${s-1vcpu-2gb} --version ${latest} ${cluster_name}
try on your machine

This command is used to create a new Kubernetes cluster using the DigitalOcean command-line interface (CLI) tool, doctl.

Here's the breakdown of each part of the command:

  • doctl kubernetes cluster create: This is the base command to create a Kubernetes cluster using doctl.

  • --count ${3}: This flag specifies the number of worker nodes to create in the cluster. In this case, it uses the value stored in the variable ${3}. You would need to replace ${3} with the actual number you want.

  • --region ${nyc1}: This flag specifies the region where the cluster will be created. It uses the value stored in the variable ${nyc1}. You need to replace ${nyc1} with the desired region, like nyc1 for New York region.

  • --size ${s-1vcpu-2gb}: This flag sets the size of each worker node in the cluster. It uses the value stored in the variable ${s-1vcpu-2gb}. You need to replace ${s-1vcpu-2gb} with the desired size, like s-1vcpu-2gb for a machine with 1 vCPU and 2GB RAM.

  • --version ${latest}: This flag specifies the Kubernetes version to use in the cluster. It uses the value stored in the variable ${latest}. You can replace ${latest} with the desired version or keep it as ${latest} to use the latest stable version.

  • ${cluster_name}: This is the name you provide for your Kubernetes cluster. You need to replace ${cluster_name} with your desired cluster name.

Putting it all together, the command creates a Kubernetes cluster with a specified number of worker nodes, in a specific region, with a certain node size and version, and assigns it the provided cluster name.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the doctl tool