Set up Development DOKS
Introduction
This section will show you how to create a DigitalOcean Kubernetes Cluster (DOKS) cluster that can be used for remote development, targeting the online boutique sample application used as a reference in this guide.
Prerequisites
To complete this section you will need:
- Doctl utility already installed as explained in the Installing Required Tools -> Doctl section.
- Doctl client already set up to work with the DigitalOcean API as explained in the Authenticating with the DigitalOcean API chapter.
Provisioning a Development DOKS Cluster for Microservices
In this step, you will create a new Kubernetes cluster running on the DigitalOcean platform, using the doctl utility.
Following command will create a DigitalOcean Kubernetes cluster named microservices-demo-dev
, with a pool size of 3 nodes
, each having 2 vCPUs
and 4GB
of RAM, in the nyc1
region:
doctl k8s cluster create microservices-demo-dev \
--auto-upgrade=true \
--maintenance-window "saturday=21:00" \
--node-pool "name=basicnp;size=s-2vcpu-4gb;count=3;tag=adoption-journey;label=type=basic" \
--region nyc1
Note
- The example cluster created above is using 3 nodes, each having 2vCPU/4GB size, which amounts to 72$/month.
- For simplicity and consistency through all the guide, the microservices-demo-dev name was picked for the dev cluster. You can choose any name you like, but you need to make sure the naming convention stays consistent.
- It is recommended to use a region for your cluster that is closest to you for faster interaction. Run the following command -
doctl k8s options regions
to check available regions. - Cluster auto upgrade is enabled (
--auto-upgrade=true
). Kubernetes clusters should be auto-upgraded to ensure that they always contain the latest security patches.
Next, you can verify the cluster details. First, fetch your DOKS
cluster ID
:
Finally, check if the kubectl
context was set to point to your DOKS
cluster. The doctl
utility should do this automatically:
For more info on this topic please see this Kubernetes Starter Kit DOKS Creation.
Configuring DOKS for Private Registries
From the command line run the following:
This will configure your DOKS cluster to fetch images from your DOCR created in the Set up a DigitalOcean container registry section
This step can also be achieved via the DigitalOcean cloud console. Please follow this guide.
Next, you will learn how to perform local microservices development using Tilt.