knowledge-kitchen / course-notes

App Deployment with Kubernetes on Digital Ocean

Deploying with Kubernetes and Docker on Digital Ocean

Terminology

First a few terms we need to be familiar with. Containers will be placed into pods. Pods are run on nodes. Nodes are grouped into clusters.

Containerize the app

Create a Dockerfile with instructions for creating the image from which containers will be made. At the very least, the Dockerifle should:

Build the image with docker build. Use the -t flag to give this version of the image a name and a tag in the pattern, docker build -t <dockerhub_username>/<image_name>:<tag_name>.

Push the image to a registry

Push the image to the Docker Hub registery with docker push, e.g. docker push <dockerhub_username>/<image_name>:<tag_name>. This assumes you have already logged in to Docker Hub with docker login.

Alternatively, if hosting with DigitalOcean, push your image to the DigitalOcean Container Registry

Set up a Kubernetes cluster

Clusters can be set up either in the DigitalOcean web app or from command line:

Pods are the workloads.. the core of kubernetes.

Deploy at least 3 replicas of container in the cluster

Expose the app to the Internet