Kubernetes Quickstart

DigitalOcean Kubernetes (DOKS) is a managed Kubernetes service. Deploy Kubernetes clusters with a fully managed control plane, high availability, autoscaling, and native integration with DigitalOcean Load Balancers and volumes. DOKS clusters are compatible with standard Kubernetes toolchains and the DigitalOcean API and CLI.

Create Clusters

To create a Kubernetes cluster:

  1. From the Create menu in the control panel, click Kubernetes.
  2. Choose a datacenter region.
  3. Select a Kubernetes version. The latest version is selected by default and is the best choice if you have no specific need for an earlier version.
  4. Customize the default node pool, choose the node pool names, and add additional node pools.
  5. Optionally, enable high availability to increase the uptime of your cluster with a 99.95% SLA.
  6. Optionally, add a database operator to automatically link new databases to your cluster.
  7. Name the cluster, select the project you want the cluster to belong to, and optionally add a tag. Any tags you choose will be applied to the cluster and its worker nodes.
  8. Click Create Cluster. Provisioning the cluster takes several minutes.
  9. Download the cluster configuration file by clicking Actions, then Download Config from the cluster home page.

Once the cluster is created, use kubectl to manage it.

To get started with DigitalOcean Kubernetes, see our Build and Deploy Your First Image to Your First Cluster tutorial.

Install a 1-Click App to a New or Existing Kubernetes Cluster

You can add a variety of preconfigured apps and stacks to a new or existing Kubernetes cluster.

  1. Navigate to the Marketplace tab of your cluster in the Kubernetes section of the control panel.
  2. Click Install to install one of the recommended apps or search for an app in the search field.

Alternatively, locate the app you want to install in the DigitalOcean Marketplace and click Install App on the upper right. Select whether to install the app on a new or existing cluster.

For more details about the 1-Click Apps, see Manage 1-Click Applications.

Use the Kubernetes Dashboard for Your Cluster

The Kubernetes Dashboard provides a web-based user interface where you can deploy containerized applications, troubleshoot your application, manage your cluster resources (such as Deployments, Jobs, DaemonSets, etc), get an overview of applications running on your cluster, initiate a rolling update, restart a pod, and more.

  1. Navigate to the Marketplace tab of your cluster in the Kubernetes section of the control panel.
  2. Search for the Kubernetes Dashboard 1-Click App and install it.
  3. Download the kubeconfig file for the cluster from the control panel. In the Configuration section of the Overview tab of the cluster, click Download Config File. The kubeconfig file is required for authenticating access to the dashboard.
  4. Port-forward the Kubernetes Dashboard to your local machine:
    export POD_NAME=$(kubectl get pods -n kubernetes-dashboard -l "app.kubernetes.io/name=kubernetes-dashboard,app.kubernetes.io/instance=kubernetes-dashboard" -o jsonpath="{.items[0].metadata.name}")
    kubectl -n kubernetes-dashboard port-forward $POD_NAME 8443:8443
  5. Log into the dashboard. In your local web browser, access and provide your Kubernetes cluster credentials.

You can explore your cluster’s resources, view pod details, manage deployments, and monitor the health of your cluster using the dashboard. For more details, see Web UI (Dashboard) in the Kubernetes documentation.

Edit Nodes and Node Pools for an Existing Cluster

You can create additional node pools and add and remove nodes from a node pool at any time.

To edit the size of an existing node pool:

  1. Open the cluster’s More menu and select View Nodes.
  2. Next to the node pool which you’d like to resize, click the button, then click Resize or Autoscale.
  3. Use the + and - controls to adjust the size of the pool, then click the Update Node Count to confirm.

To add additional node pools:

  1. Open the cluster’s More menu and select View Nodes.
  2. Click Add Node Pool.
  3. Select the name, type, size, and number of Droplets in the pool. Click Add Node Pool(s) to add additional node pools.
  4. Click Save to save your changes and provision your new nodes.

Recycle Nodes

If a worker node isn’t functioning properly, you can destroy and replace it with a new node of the same type with the Recycle option.

  1. Open the cluster’s menu and select View Nodes.

  2. Click the name of the node pool with the problem node.

  3. Open the menu next to the problem node and select Recycle.

  4. Optionally, if you want to skip draining the node before removing it, uncheck the Drain node when replacing checkbox.

    By default, the workloads are drained from the node before the node is removed. Skipping node draining is useful when you know that a drain will fail because the workload is broken or cannot gracefully terminate.

  5. Click Recycle to confirm the action.

Recycling a worker node replaces the underlying Droplet with a newly provisioned one. Attached volumes will be detached and reattached to the new Droplet, but any data stored locally on the original Droplet’s disk will be lost.

Destroy Clusters

To delete an entire cluster:

  1. Open the cluster’s More menu and select Destroy.
  2. Click Destroy.
  3. Select the associated volumes and load balancers to delete.
  4. Enter the name of the cluster, then click Destroy to confirm.

Destroying a cluster does not delete DigitalOcean Load Balancers or volumes associated with the cluster.