apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: &name nsenter
  labels:
    app: *name
spec:
  selector:
    matchLabels:
      app: *name
  template:
    metadata:
      labels:
        app: *name
    spec:
      hostNetwork: true
      hostPID: true
      containers:
      - image: alexeldeib/nsenter:latest
        imagePullPolicy: Always
        name: *name
        args: ["${ACTION}"]
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
          limits:
            cpu: 100m
            memory: 100Mi
        securityContext:
          privileged: true
          # capabilities:
          #   add: ["SYS_PTRACE", "SYS_RAWIO"]
        volumeMounts:
        - name: actions
          mountPath: "/opt/actions"
        - name: hostmount
          mountPath: "/mnt/actions"
      volumes:
      - name: hostmount
        hostPath:
          path: /opt/actions
          type: DirectoryOrCreate
      - name: actions
        configMap:
          name: nsenter-actions
