Skip to Content
Kubernetes Cookbook - Second Edition
book

Kubernetes Cookbook - Second Edition

by Hideto Saito, Hui-Chuan Chloe Lee, Ke-Jou Carol Hsu
May 2018
Intermediate to advanced
554 pages
13h 51m
English
Packt Publishing
Content preview from Kubernetes Cookbook - Second Edition

Pod recovery by StatefulSet

StatefulSet behaves differently to DaemonSet during Pod recreation. In StatefulSet managed Pods, the Pod name is always consisted to assign an ordered number such as hdfs-datanode-0, hdfs-datanode-1 andhdfs-datanode-2, and if you delete one of them, a new Pod will take over the same Pod name.

To simulate this, let's delete one DataNode (hdfs-datanode-1) to see how StatefulSet recreates a Pod:

$ kubectl get podsNAME              READY     STATUS    RESTARTS   AGEhdfs-datanode-0   1/1       Running   0          3mhdfs-datanode-1   1/1       Running   0          2mhdfs-datanode-2   1/1       Running   0          2mhdfs-namenode-0   1/1       Running   0          23m //delete DataNode-1$ kubectl delete pod hdfs-datanode-1pod "hdfs-datanode-1" deleted //DataNode-1 is Terminating$ kubectl get podsNAME READY STATUS ...
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 Cookbook

Kubernetes Cookbook

Sébastien Goasguen, Michael Hausenblas
DevOps with Kubernetes - Second Edition

DevOps with Kubernetes - Second Edition

Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu

Publisher Resources

ISBN: 9781788837606Supplemental Content