We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Nodes

In a production environment, you'll have multiple nodes (machines) in your cluster. For this course, we've been using a single-node practice cluster. The nice thing about Kubernetes is that almost everything you do with it is abstracted away from the underlying infrastructure with the kubectl CLI.

All the commands we've been using work the same way on a multi-node production cluster.

Ways to Deploy to Production

There are several popular ways to deploy a Kubernetes cluster to production:

GKE, EKS, AKS

These are all managed Kubernetes services, offered by the big 3 cloud providers. They're all pretty similar, and the nice thing about a managed offering is that it can be configured to handle autoscaling at the node level. This means that you can set up your cluster to automatically add and remove nodes based on the load of your cluster.

Node-level autoscaling is different from pod-level autoscaling! Pod-level autoscaling manages the number of pods in a cluster of machines. Node-level autoscaling manages the number of machines in a cluster.

Manual Setup

You can also set up your own cluster manually. Deploying manually was much more popular before the managed services were released, but it's still a viable option if you want more control over your cluster.

I've worked on teams where a cloud engineering team has custom scripts that configure a cluster on top of standard EC2 instances. Then they have their own autoscaling scripts that add and remove nodes based on the load of the cluster. That setup was still in the cloud, but Kubernetes doesn't have to be. You can run it on physical machines in your own on-premises network if you want.

Node Types

Broadly speaking, there are two types of machines in a production Kubernetes cluster:

  • Control Plane

  • Worker Nodes

The control plane is responsible for managing the cluster. It's where the API server, scheduler, and controller manager live. The control plane used to be called "master nodes", but that term is deprecated now. When you hear the word "node" used in isolation, it's usually referring to worker nodes. In fact, because we use GKE to run Boot.dev, when I run:

kubectl get nodes

I get back:

NAME                                       STATUS   ROLES    AGE     VERSION
gk3-kube-prod-nap-1cmjprlt-92e1dc91-jmi8   Ready    <none>   5d21h   v1.25.12-gke.500
gk3-kube-prod-nap-1cmjprlt-dfe4d6de-cq0k   Ready    <none>   5d21h   v1.25.12-gke.500

These are my worker nodes. They're the machines that are actually running my containers. The control plane is fully managed by GKE, so I don't have to worry about it. That's usually fine because as the load on my cluster increases, I'm mostly concerned with scaling out my worker nodes and making sure they're healthy. The control plane is fairly static.