Kubernetes 允许K8S守护程序存在于全局pid命名空间中

Kubernetes 允许K8S守护程序存在于全局pid命名空间中,kubernetes,linux-namespaces,daemonset,Kubernetes,Linux Namespaces,Daemonset,我试图将守护程序配置为在全局pid命名空间上运行,从而能够查看主机中的其他进程,包括容器的进程 我找不到实现这一目标的方法。 一般来说,我要查找的是仅在主机级别上靠近sidecar容器的shareProcessNamespace属性。有一个属性允许该属性-hostPID:true 因此,yaml文件应该如下所示: apiVersion: apps/v1 kind: DaemonSet metadata: name: busybox spec: selector: matchLab

我试图将守护程序配置为在全局pid命名空间上运行,从而能够查看主机中的其他进程,包括容器的进程

我找不到实现这一目标的方法。
一般来说,我要查找的是仅在主机级别上靠近sidecar容器的shareProcessNamespace属性。

有一个属性允许该属性-
hostPID:true

因此,yaml文件应该如下所示:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: busybox
spec:
  selector:
    matchLabels:
      name: busybox
  template:
    metadata:
      labels:
        name: busybox
    spec:
      hostPID: true
      containers:
      - name: busybox
        image: busybox
        command: [ "sh", "-c", "sleep 1h" ]
更多信息请访问:


有一个属性允许此操作-
hostPID:true

因此,yaml文件应该如下所示:

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: busybox
spec:
  selector:
    matchLabels:
      name: busybox
  template:
    metadata:
      labels:
        name: busybox
    spec:
      hostPID: true
      containers:
      - name: busybox
        image: busybox
        command: [ "sh", "-c", "sleep 1h" ]
更多信息请访问: