DaemonSet是一种资源对象,用于管理在集群中每个NODE上仅运行一份Pod的副本实例。
这种用法适合一些有这种需求的应用。
1.在每个Node上运行一个Ceph存储的Daemon进程。
2.在每个Node上运行一个日志采集程序,例如fluentd。
3.在每个Node运行一个健康程序,采集NODE的运行性能数据。
下面例子定义为在每台Node上启动一个fluentd容器,配置文件fluentd-ds.yaml的内容如下,挂载了物理机的两个目录“/var/log”和“/var/lib/docker/containers”:
生成DaemonSet之后,可以在kubectl get daemonset --namespace=kube-system和kubectl get pods --namespace=kube-system看到现象。
注意这里的挂载和资源分配值得学习。