Skip to content

Kubernetes on DigitalOcean

IMO, the easiest Kubernetes cloud provider to experiment with is DigitalOcean (this is a referral link). I've included instructions below to start a basic cluster.

Kubernetes on Digital Ocean

Ingredients

  1. DigitalOcean account, either linked to a credit card or (my preference for a trial) topped up with $5 credit from PayPal. (yes, this is a referral link, making me some 💰 to buy 🍷)
  2. Geek-Fu required : 🐱 (easy - even has screenshots!)

Preparation

Create DigitalOcean Account

Create a project, and then from your project page, click Manage -> Kubernetes (LTD) in the left-hand panel:

Kubernetes on Digital Ocean Screenshot #1

Until DigitalOcean considers their Kubernetes offering to be "production ready", you'll need the additional step of clicking on Enable Limited Access:

Kubernetes on Digital Ocean Screenshot #2

The Enable Limited Access button changes to read Create a Kubernetes Cluster . Cleeeek it:

Kubernetes on Digital Ocean Screenshot #3

When prompted, choose some defaults for your first node pool (your pool of "compute" resources for your cluster), and give it a name. In more complex deployments, you can use this concept of "node pools" to run certain applications (like an inconsequential nightly batch job) on a particular class of compute instance (such as cheap, preemptible instances)

Kubernetes on Digital Ocean Screenshot #4

That's it! Have a sip of your 🍷, a bite of your 🧀, and wait for your cluster to build. While you wait, follow the instructions to setup kubectl (if you don't already have it)

Kubernetes on Digital Ocean Screenshot #5

DigitalOcean will provide you with a "kubeconfig" file to use to access your cluster. It's at the bottom of the page (illustrated below), and easy to miss (in my experience).

Kubernetes on Digital Ocean Screenshot #6

Release the kubectl!

Save your kubeconfig file somewhere, and test it our by running kubectl --kubeconfig=<PATH TO KUBECONFIG> get nodes 1

Example output:

[davidy:~/Downloads] 130 % kubectl --kubeconfig=penguins-are-the-sexiest-geeks-kubeconfig.yaml get nodes
NAME                  STATUS    ROLES     AGE       VERSION
festive-merkle-8n9e   Ready     <none>    20s       v1.13.1
[davidy:~/Downloads] %

In the example above, my nodes were being deployed. Repeat the command to see your nodes spring into existence:

[davidy:~/Downloads] % kubectl --kubeconfig=penguins-are-the-sexiest-geeks-kubeconfig.yaml get nodes
NAME                  STATUS    ROLES     AGE       VERSION
festive-merkle-8n96   Ready     <none>    6s        v1.13.1
festive-merkle-8n9e   Ready     <none>    34s       v1.13.1
[davidy:~/Downloads] %

[davidy:~/Downloads] % kubectl --kubeconfig=penguins-are-the-sexiest-geeks-kubeconfig.yaml get nodes
NAME                  STATUS    ROLES     AGE       VERSION
festive-merkle-8n96   Ready     <none>    30s       v1.13.1
festive-merkle-8n9a   Ready     <none>    17s       v1.13.1
festive-merkle-8n9e   Ready     <none>    58s       v1.13.1
[davidy:~/Downloads] %

That's it. You have a beautiful new kubernetes cluster ready for some action!

Chef's notes 📓


  1. Do you live in the CLI? Install the kubectl autocompletion for bash or zsh to make your life much easier! 

Tip your waiter (sponsor) 👏

Did you receive excellent service? Want to compliment the chef? (..and support development of current and future recipes!) Sponsor me on Github / Ko-Fi / Patreon, or see the contribute page for more (free or paid) ways to say thank you! 👏

Employ your chef (engage) 🤝

Is this too much of a geeky PITA? Do you just want results, stat? I do this for a living - I'm a full-time Kubernetes contractor, providing consulting and engineering expertise to businesses needing short-term, short-notice support in the cloud-native space, including AWS/Azure/GKE, Kubernetes, CI/CD and automation.

Learn more about working with me here.

Flirt with waiter (subscribe) 💌

Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated.

Your comments? 💬