You have a DigitalOcean account and doctl authenticated. Now comes the moment you've been working toward: creating your first production Kubernetes cluster in the cloud.
This isn't Docker Desktop running locally. This is real cloud infrastructure—virtual machines in a DigitalOcean data center, a managed Kubernetes control plane, and a Load Balancer endpoint accessible from anywhere on the internet.
The command takes 5-10 minutes to complete. By the end of this lesson, kubectl get nodes will show nodes running in a real data center, not your laptop.
Before running the command, you need to decide three things:
The Task API is a FastAPI application with Dapr sidecar. It doesn't need massive resources:
The principle: Start with the smallest size that works, scale up when metrics prove you need it.
Kubernetes distributes workloads across nodes. With 3 nodes:
Minimum viable cluster: 2 nodes works but leaves no margin. 3 is the production starting point.
Choose the region closest to your users. DigitalOcean regions:
For learning, any region works. For production, proximity reduces latency.
Run this command to create your DOKS cluster:
Output:
This takes 5-10 minutes. The --wait flag blocks until the cluster is fully running.
List available Kubernetes versions:
Output:
List available node sizes:
Output:
List available regions for Kubernetes:
Output:
After provisioning completes, verify the cluster is healthy.
Output:
You now have 3 worker nodes running in DigitalOcean's data center. These are real virtual machines.
Output:
Key components:
All pods should be Running with no restarts.
Output:
The control plane URL shows this is a managed DOKS cluster—DigitalOcean handles control plane availability.
When doctl created the cluster, it automatically:
Output:
The * marks your current context. You're now connected to DOKS, not Docker Desktop.
To switch back to Docker Desktop for local testing:
Output:
To switch back to DOKS:
Output:
If you need to reconfigure kubectl credentials (new machine, expired tokens):
Output:
This regenerates tokens and updates your local kubeconfig.
Your cluster is now costing money. Know what you're paying:
Go to cloud.digitalocean.com/account/billing and set:
If you're done learning for the day, delete the cluster:
You can reprovision in 5-10 minutes. Don't pay for idle clusters.
Your context isn't set correctly. Run:
Your DigitalOcean token expired or doctl isn't authenticated. Re-authenticate:
Sometimes node provisioning is slow. Check status in DigitalOcean dashboard or run:
If status is provisioning, wait. If status is error, delete and retry.
DigitalOcean may have capacity constraints in a region. Try:
You now have:
This is real cloud infrastructure. The kubectl commands you learned in a previous Module work identically here. The difference: these nodes are in a data center, not your laptop.
In the next Chapter, you'll configure the cloud Load Balancer and DNS—making your cluster accessible from the internet.
Explore your DOKS cluster with AI assistance.
What you're learning: Node pool management for heterogeneous workloads—running different pod types on different node sizes.
What you're learning: Cluster lifecycle management—keeping Kubernetes current without disrupting running workloads.
What you're learning: Safe multi-cluster workflows that prevent production incidents.
You built a multi-cloud-deployer skill in a previous Module. Test and improve it based on what you learned.
Does your skill produce the correct doctl kubernetes cluster create command with --region ams3, --size s-4vcpu-8gb, and --count 2?
Ask yourself:
If you found gaps: