how to speedup creation a Kubernetes cluster

It took me about 4 minutes to create a Kubernetes cluster with a single node using doctl, is there a faster way to do it? Because I want to create a new Kubernetes cluster every time I run gitlab ci.

$ time doctl kubernetes cluster create integrating-test-cluster  --region=sfo3 --size=s-2vcpu-4gb --count=1 Notice: Cluster is provisioning, waiting for cluster to be running ...................................................... Notice: Cluster created, fetching credentials Notice: Adding cluster credentials to kubeconfig file found in  Notice: Setting current-context to do-sfo3-integrating-test-cluster ID                                      Name Region Version Auto Upgrade Status Node Pools 791f4e7e-8cd9-4939-af8e-a300e68fa460    integrating-test-cluster sfo3 1.28.2-do.0 false running integrating-test-cluster-default-pool doctl kubernetes cluster create integrating-test-cluster --region=sfo3    0.17s user 0.07s system 0% cpu 4:58.89 total

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 11, 2023

Hi there,

Indeed, creating a Kubernetes cluster involves a series of complex operations that can take a few minutes. I believe that there isn’t much that you can do to speed up the creation of the cluster itself, but what you could do instead is to use a pre-provisioned cluster.

If the CI time is crucial what you could do is, instead of creating a new cluster for each CI run. For example, consider pre-provisioning a pool of clusters and reusing them across runs. This approach will significantly reduce the time spent in each CI pipeline waiting for cluster creation.

You can pre-provision your pool of clusters at the beginning of the working day and then bring them down once you are done for the day.

If you still would like to see a reduction in the creation time, the best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.

But on another note, 4 minutes is actually pretty good. Speaking from experience, creating a managed cluster on AWS for example takes around 15 minutes or so, and on Azure, it takes between 15-20 minutes. In most cases, the initial creation of a Kubernetes cluster tends to take a bit longer due to the setup of various components and integrations.

Hope that helps!

- Bobby.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel