Deploy Kubernetes on Digital Ocean: mini practical guide

Deploy Kubernetes on Digital Ocean: the helpful mini guide

DigitalOcean Kubernetes (DOKS) is a managed Kubernetes service (link to Kubernetes Cloud Services article) that enables deployment of Kubernetes clusters without the complexities of control plane and infrastructure management. The clusters are compatible with standard Kubernetes toolchains and integrate natively with DigitalOcean Load Balancer and block storage volumes.

Deploy Kubernetes su Digital Ocean step by step

You can create a DigitalOcean Kubernetes cluster at any time from the DigitalOcean control panel by opening the Create menu in the upper right corner.

Il menu di creazione

Tag alt =  Deploy Kubernetes

On the Create menu, click Kubernetes to go to the Create a cluster page. On this page you will choose a version of Kubernetes, a data center region, and a cluster capacity for your cluster.

Select a version of Kubernetes

The latest version of the patch for the three most recent secondary versions of Kubernetes is available for creating new clusters. The latest stable version is selected by default.

Choose a region of the datacenter

Choose the region for your cluster. The control plane and worker nodes of your cluster will be in the same region.

If you plan to use block storage volumes for permanent data storage, choose a region that supports such volumes. If you add a Load Balancer to your deployment, it will automatically be placed in the same cluster region.

VPC Network

In the VPC Network section, choose a VPC network for the cluster. You can choose one that you have created or use the default network for the data center area.

VPC creates an additional network interface that can only be accessed by other resources within the same VPC network. All this prevents traffic from being routed outside the data center over the public Internet.

Choose cluster capacity

To create a cluster, you must add a node pool with at least one worker node. Specify the following fields for the node pool:

  • Name of node pool. Choose a name for the node pool after you create it. You should know that the nodes within this pool inherit this naming scheme when they are created. Not only that, if you rename the node pool later, the nodes will inherit the new naming scheme only when they are recreated (when you recycle the nodes or resize the node pool).
  • Machine type (droplet). You will have several plans to choose from: Basic (Standard CPU, Intel Premium CPU, or AMD Premium CPU), General Purpose, or CPU-optimized Droplet.
  • Node plan. Choose the specific plan you want for your worker nodes. 
  • To take advantage of different resource capabilities, you can create additional node pools with the “Add additional node pools” button and assign pods to node pools with the appropriate scheduling constraints.
  • Number of nodes. Choose how many nodes to include in the node pool. By default three worker nodes are already selected precisely because this is the minimum number to “guarantee high availability.”

At the bottom of this section, you will see the monthly charge for your cluster based on the resources you have chosen. When you create the cluster, billing is done for each type of resource (e.g., worker node, block storage, load balancer). 

Add tags

Clusters automatically have three tags :

  • k8s
  • The specific cluster ID, such as k8s:EXAMPLEc-3515-4a0c-91a3-2452eEXAMPLE
  • The type of resource, (e.g., k8s:worker).

You can also add custom tags to a cluster and its node pools on the Overview and Nodes pages. Any custom tags added to nodes in a node pool (e.g., from the Droplet page), are removed to maintain consistency between the node pool and its worker nodes.

Choose a name

By default, cluster names begin with k8s, followed by the Kubernetes version, data center region, and cluster ID. You can customize the cluster name, which will also be used in the tag.

Select the project

The new cluster belongs to your default project. You can assign the cluster to a different project.

You can also edit the project after creating the cluster. Go to the Kubernetes page in the control panel . From the cluster’s More menu, select Move To in and select the project to which you want to move the cluster.

Associated resources, such as load balancers and storage volumes, also move when you move the cluster to a different project.

Create the cluster

After entering the other settings, creating the cluster by clicking the Create cluster button is super easy. Cluster creation can take several minutes to complete.

Once the cluster has been provisioned, you can use kubectl, the official Kubernetes command-line client, specifically to manage the cluster.

In conclusion

The setup of Kubernetes on Digital Ocean is very simple and is done through the graphical user interface of the Digital Ocean administrative panel. We encourage you to read the official Kubernetes and Digital Ocean documentation for further details.

Share: Facebook Twitter Linkedin