Run your own DaemonSet [turn]

This section Prometheus Node Exporter example to show how to run their own DaemonSet.

Prometheus is a popular system monitoring scheme, Node Exporter Prometheus is the agent, run Daemon in the form of each monitored node.

If you are running Node Exporter container directly in Docker, the command is:

docker run -d \
-v "/proc:/host/proc" \
-v "/sys:/host/sys" \
-v "/:/rootfs" \
--net=host \ prom/node-exporter \
--path.procfs /host/proc \
--path.sysfs /host/sys \
--collector.filesystem.ignored-mount-points "^/(sys|proc|dev|host|etc)($|/)"

Convert it to a YAML configuration file node_exporter.yml DaemonSet of:

① direct use of the Host network.
② Set the container start command.
③ Volume path through the Host  /proc, /sys and  / mapping into the container. Volume We will discuss in detail later.

Execution  kubectl apply -f node_exporter.yml:

DaemonSet node-exporter-daemonset 部署成功,k8s-node1 和 k8s-node2 上分别运行了一个 node exporter Pod。

DaemonSet 就讨论到这里,下一节我们学习另一个 Controller -- Job。

Guess you like

Origin www.cnblogs.com/twobrother/p/11088530.html