Solution ReplicaSet and its predecessor ReplicationController are control structures responsi‐ ble for making sure a specific number of Pods are running. These controllers con‐ stantly monitor the list of running Pods and make sure the actual number of Pods always matches the desired number. In that regard, a DaemonSet is a similar con‐ struct and is responsible for ensuring that a certain number of Pods are always run‐ ning. The difference is that the first two run a specific number of Pods, usually driven by the application requirements of high availability and user load, irrespective of the node count. On the other hand, a DaemonSet is not driven by consumer load in deciding how many Pod instances to run and where to run. Its main purpose is to keep running a single Pod on every node or specific nodes. Let’s see such a DaemonSet definition next in Example 9-1. 74  |  Chapter 9: Daemon Service Example 9-1. DaemonSet resource apiVersion : extensions/v1beta1 kind : DaemonSet metadata : name : random-refresher spec : selector : matchLabels : app : random-refresher template : metadata : labels : app : random-refresher spec : nodeSelector : feature : hw-rng containers : -  image : k8spatterns/random-generator:1.0 name : random-generator command : - sh - -c - >- "while true; do  java -cp / RandomRunner /host_dev/random 100000; sleep 30; done" volumeMounts : -  mountPath : /host_dev name : devices volumes : -  name : devices