【问题标题】:Can we access node/host process from the Kubernetes pod?我们可以从 Kubernetes pod 访问节点/主机进程吗?
【发布时间】:2020-06-21 14:21:10
【问题描述】:

有没有办法从 Kubernetes pod 访问底层主机/节点的进程,就像我们使用 hostPath 卷挂载访问主机/节点的文件系统一样?

PS:我正在尝试借助在 Kubernetes 上部署为 pod 的 auditbeat 来监控节点进程。

【问题讨论】:

    标签: elasticsearch kubernetes elastic-stack elastic-beats


    【解决方案1】:

    我相信你要找的是hostPID: true in the PodSpec:

    spec:
      hostPID: true
      containers:
      - name: show-init
        command:
        - ps
        - -p
        - "1"
    

    理论上应该输出“/sbin/init”,因为它在主机的 PID 命名空间中运行

    【讨论】:

      猜你喜欢
      • 2022-01-24
      • 2020-07-08
      • 2021-10-09
      • 1970-01-01
      • 2019-01-21
      • 2019-08-09
      • 2016-08-03
      • 1970-01-01
      • 2019-05-02
      相关资源
      最近更新 更多