本节以 Prometheus Node Exporter 为例演示如何运行自己的 DaemonSet。

Prometheus 是流行的系统监控方案,Node Exporter 是 Prometheus 的 agent,以 Daemon 的形式运行在每个被监控节点上。

如果是直接在 Docker 中运行 Node Exporter 容器,命令为:

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)($|/)"

将其转换为 DaemonSet 的 YAML 配置文件 node_exporter.yml:

① 直接使用 Host 的网络。
② 设置容器启动命令。
③ 通过 Volume 将 Host 路径 /proc/sys 和 / 映射到容器中。我们将在后面详细讨论 Volume。

执行 kubectl apply -f node_exporter.yml

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

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

运行自己的 DaemonSet【转】的更多相关文章

  1. 运行自己的 DaemonSet - 每天5分钟玩转 Docker 容器技术(131)

    本节以 Prometheus Node Exporter 为例演示如何运行自己的 DaemonSet. Prometheus 是流行的系统监控方案,Node Exporter 是 Prometheus ...

  2. kubernetes 每个node上只能运行一个副本DaemonSet

    每个node上只能运行一个副本: apiVersion: extensions/v1beta1 kind: DaemonSet #使用DaemonSet的方式运行 metadata: name: ku ...

  3. kubernetes运行应用2之DaemonSet详解

    kubernetes运行应用1之Deployment详解   查看daemonset 如下,k8s自身的 DaemonSet kube-flannel-ds和kube-proxy分别负责在每个结点上运 ...

  4. DaemonSet 案例分析 - 每天5分钟玩转 Docker 容器技术(130)

    本节详细分析两个 k8s 自己的 DaemonSet:kube-flannel-ds 和 kube-proxy . kube-flannel-ds 下面我们通过分析 kube-flannel-ds 来 ...

  5. DaemonSet 案例分析

    本节详细分析两个 k8s 自己的 DaemonSet:kube-flannel-ds 和 kube-proxy . kube-flannel-ds 下面我们通过分析 kube-flannel-ds 来 ...

  6. Kubernetes之DaemonSet

    1.DaemonSet在每个节点上运行一个pod K8s中Replicationcontroller和ReplicaSet都用于在Kubernetes集群上运行部署特定数量的pod.但是,当希望pod ...

  7. centos7下kubernetes(10。kubernetes-daemonset)

    deployment部署得副本pod会分布在各个node上,每个node上可以运行很多个pod. daemonset的不同之处就在于,daemonset可以让每个node上只运行一个pod daemo ...

  8. [转帖]Kubernetes及容器编排的总体介绍【译】

    Kubernetes及容器编排的总体介绍[译] 翻译自The New Stack<Kubernetes 生态环境>作者:JANAKIRAM MSV和 KRISHNAN SUBRAMANIA ...

  9. k8s的DamonSet使用

    Deployment 部署的副本 Pod 会分布在各个 Node 上,每个 Node 都可能运行好几个副本.DaemonSet 的不同之处在于:每个 Node 上最多只能运行一个副本. 1.Daemo ...

随机推荐

  1. node js 判断数组中是否包含某个值

    判断数组中是否包含某个值这里有四种方法.用的测试数据: let arr=["a","b","c"]; let arr2={"a&q ...

  2. Linux 命令中 which、whereis、locate 命令的用法

    which 命令 which 命令的作用是,在 PATH 变量指定的路径中搜索可执行文件的所在位置.它一般用来确认系统中是否安装了指定的软件. (1)命令格式 which 可执行文件名称 wherei ...

  3. linux mysql 查看数据库大小

    SELECT CONCAT(TRUNCATE(SUM(data_length)//,),'MB') AS data_size, CONCAT(TRUNCATE(SUM(max_data_length) ...

  4. TreeView 中 MVVM Command Binding

    <HierarchicalDataTemplate x:Key="TreeNodes" ItemsSource="{Binding Path=Childs,Mode ...

  5. php 基础知识 常见面试题

    1.echo.print_r.print.var_dump之间的区别 * echo.print是php语句,var_dump和print_r是函数 * echo 输出一个或多个字符串,中间以逗号隔开, ...

  6. cmake学习资料收集

    CMake 学习笔记 : https://www.jianshu.com/p/c417e4ab8b30

  7. Lesson 16 The modern city

    What is the author's main argument about the modern city? In the organization of industrial life the ...

  8. ADO.Net实体数据模型添加DB-First/Code First报错

    Authentication method 'caching_sha2_password' not supported by any of the available plugins. 解决办法: 1 ...

  9. 15条MySQL改善经验让系统更稳定

    MySQL 作为目前的主流开源数据库, 既能挑战 “双11”,又能扛起 “618”,比起网红版数据库,MySQL 绝对是实力担当. 1. 为查询缓存优化查询 像 NOW() 和 RAND() 或是其它 ...

  10. 七 Spring的IOC的注解方式

    Spring的IOC的注解方式入门 引入注解约束,配置组件扫描 类上的注解: @Conponent  @Controller @Service @Repository 普通属性的注解   @value ...