Skip to Content
Hands-On Microservices with Kubernetes
book

Hands-On Microservices with Kubernetes

by Gigi Sayfan
July 2019
Intermediate to advanced
502 pages
14h
English
Packt Publishing
Content preview from Hands-On Microservices with Kubernetes

Understanding a StatefulSet

At its core, a StatefulSet is a controller that manages a set of pods with some extra properties, such as ordering and uniqueness. The StatefulSet allows its set of pods to be deployed and scaled, while preserving their special properties. StatefulSets reached general availability (GA) status in Kubernetes 1.9. You can think of a StatefulSet as a souped-up deployment. Let's take a look at a sample StatefulSet for the user service, which uses a relational PostgresDB as its data store:

apiVersion: apps/v1kind: StatefulSetmetadata:  name: user-dbspec:  selector:    matchLabels:      svc: user      app: postgres  serviceName: user-db  replicas: 1  template:    metadata:      labels:        svc: user        app: postgres    spec: terminationGracePeriodSeconds: ...
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 Microservices

Kubernetes Microservices

Richard Chesterwood
Cloud Native DevOps with Kubernetes

Cloud Native DevOps with Kubernetes

John Arundel, Justin Domingus
Microservices: Up and Running

Microservices: Up and Running

Ronnie Mitra, Irakli Nadareishvili

Publisher Resources

ISBN: 9781789805468Supplemental Content