The replica Pods deployed by the Deployment will be distributed on each Node, and each Node may run several replicas. The difference with DaemonSets is that there is at most one replica running on each Node.
Typical application scenarios of DaemonSet are:
-
Run a storage daemon, such as glusterd or ceph, on each node of the cluster.
-
Run a log collection daemon, such as flunentd or logstash, on each node.
-
Run a monitoring daemon, such as Prometheus Node Exporter or collectd, on each node.
In fact, Kubernetes itself is using DaemonSet to run system components. Execute the following command:
kubectl get daemonset --namespace=kube-system
DaemonSet kube-flannel-ds
and kube-proxy
are responsible for running the flannel and kube-proxy components on each node respectively.
Because flannel and kube-proxy are system components, you need to --namespace=kube-system
specify namespace on the command line kube-system
. default
If not specified, only resources in the default namespace will be returned .
In the next section, we analyze kube-flannel-ds
and kube-proxy
these two DaemonSets in detail.
books:
1. "Play with Docker container technology in 5 minutes a day"
https://item.jd.com/16936307278.html
2. "Play with OpenStack in 5 minutes a day"
https://item.jd.com/12086376.html