6 Scaling applications across multiple Pods with controllers

 

The basic idea for scaling applications is simple: run more Pods. Kubernetes abstracts networking and storage away from the compute layer, so you can run many Pods, which are copies of the same app, and just plug them into the same abstractions. Kubernetes calls those Pods replicas, and in a multinode cluster, they’ll be distributed across many nodes. This gives you all the benefits of scale: greater capacity to handle load and high availability in case of failure—all in a platform that can scale up and down in seconds.

Kubernetes also provides some alternative scaling options to meet different application requirements, and we’ll work through them all in this chapter. The one you’ll use most often is the Deployment controller, which is actually the simplest, but we’ll spend time on the others, too, so you understand how to scale different types of applications in your cluster.

6.1 How Kubernetes runs apps at scale

The Pod is the unit of compute in Kubernetes, and you learned in chapter 2 that you don’t usually run Pods directly; instead, you define another resource to manage them for you. That resource is a controller, and we’ve used Deployment controllers ever since. A controller spec includes a Pod template, which it uses to create and replace Pods. It can use that same template to create many replicas of a Pod.

6.2 Scaling for load with Deployments and ReplicaSets

6.3 Scaling for high availability with DaemonSets

6.4 Understanding object ownership in Kubernetes

6.5 Lab

sitemap