Skip to Content
Kubernetes: Up and Running
book

Kubernetes: Up and Running

by Kelsey Hightower, Brendan Burns, Joe Beda
September 2017
Intermediate to advanced content levelIntermediate to advanced
269 pages
4h 38m
English
O'Reilly Media, Inc.
Content preview from Kubernetes: Up and Running

Chapter 8. ReplicaSets

Previously, we covered how to run individual containers as Pods. But these pods are essentially one-off singletons. More often than not, you want multiple replicas of a container running at a particular time. There are a variety of reasons for this type of replication:

Redundancy

Multiple running instances mean failure can be tolerated.

Scale

Multiple running instances mean that more requests can be handled.

Sharding

Different replicas can handle different parts of a computation in parallel.

Of course, you could manually create multiple copies of a Pod using multiple different (though largely similar) Pod manifests, but doing so is both tedious and error-prone. Logically, a user managing a replicated set of Pods considers them as a single entity to be defined and managed. This is precisely what a ReplicaSet is. A ReplicaSet acts as a cluster-wide Pod manager, ensuring that the right types and number of Pods are running at all times.

Because ReplicaSets make it easy to create and manage replicated sets of Pods, they are the building blocks used to describe common application deployment patterns and provide the underpinnings of self-healing for our applications at the infrastructure level. Pods managed by ReplicaSets are automatically rescheduled under certain failure conditions such as node failures and network partitions.

The easiest way to think of a ReplicaSet is that it combines a cookie cutter and a desired number of cookies into a single API ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes in Action

Kubernetes in Action

Marko Luksa
Kubernetes: Up and Running, 2nd Edition

Kubernetes: Up and Running, 2nd Edition

Brendan Burns, Joe Beda, Kelsey Hightower
Core Kubernetes

Core Kubernetes

Jay Vyas, Christopher Love
GitOps and Kubernetes

GitOps and Kubernetes

Todd Ekenstam, Billy Yuen, Jesse Suen, Alex Matyushentsev

Publisher Resources

ISBN: 9781491935668Errata PageSupplemental Content