Model deployment with Kubernetes

Kubernetes is an orchestration system for automating container deployment. We can use it to host any Docker containers.

image.png

The main unit of abstraction in Kubernetes is a pod, a pod can contains a single Docker images. The Pods live on a node and these can contain several pods. To deploy an application, we define a deployment, this we allow to specify how many pods the application should have and which image should be used.

If we add more pods this we’ll able to take attention to more request. This can also happen automatically and this process is called horizontal autoscaling.

A service is the entry point to the pods. Like a web service, clients interact with the service, not individual pods. The service handles the requests by routing them to one of the pods in the deployment.

But, how can the users interact with the service inside the cluster? Simply, the answer was name ingress.

image.png

The ingress processes the request from the client, and then the service routes it to one of the pods.

Creating a Kubernetes cluster

To create a Kubernetes cluster, we have multiples options:

For this chapter, we’ll use Kind, which will let us create a Kubernetes cluster. To do this, we need three tools:

Once you have installed kind, we can create the cluster.

kind create cluster

image.png