Agent socket CSI driver

Embed
Preview of the card
<a href="https://watchtowerops.net/docs/csi"><img src="https://watchtowerops.net/docs/_api/public/orgs/aa5959cb-1a0b-4a9a-bc9a-913e7ac31cd9/spaces/b7aac181-9916-4805-b253-becc5fd2ca62/pages/8f5d0b19-a571-4be5-8b3a-49afe1d93066/social-card.svg?v=3e7ae33eec8b" alt="Agent socket CSI driver" width="600" height="315"></a>

Enable with --set csi.enabled=true on the watchtower-agent chart. It installs a CSIDriver (socket.csi.watchtower.io, ephemeral volumes only) and a per-node DaemonSet running wt-agent -mode csi. A pod then reaches the node agent's unix sockets without a hostPath:

volumes:
  - name: wt
    csi:
      driver: socket.csi.watchtower.io
      readOnly: true
      volumeAttributes: { socketDir: /var/run/wt-agent }   # optional, default socketRoot
containers:
  - volumeMounts: [{ name: wt, mountPath: /var/run/wt-agent }]

Point the agent's modules.dogstatsd.socket at a path below csi.socketRoot (default /var/run/wt-agent); the agent DaemonSet mounts that directory too. The driver bind-mounts the node directory into the pod (read-only when the volume is), and refuses any socketDir outside socketRoot, so a pod cannot use it to mount arbitrary host paths. It registers itself with the kubelet; no node-driver-registrar sidecar. The driver pod is privileged (mount(2)); it serves only a unix socket and reads no secret. Code: go/agent/csi.

Updated