---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    run: modsecurity-spoa
  name: modsecurity-spoa
  namespace: ingress-controller
spec:
  selector:
    matchLabels:
      run: modsecurity-spoa
  template:
    metadata:
      labels:
        run: modsecurity-spoa
    spec:
      volumes:
      - name: varlog
        emptyDir: {}
      containers:
      - name: modsecurity-spoa
        image: quay.io/jcmoraisjr/modsecurity-spoa
        args:
        - -n
        - "1"
        ports:
        - containerPort: 12345
          hostPort: 12345
          name: spop
          protocol: TCP
        volumeMounts:
        - name: varlog
          mountPath: /var/log
      - name: audit-log
        image: busybox
        args: [/bin/sh, -c, 'tail -n+1 -f /var/log/modsec_audit.log']
        volumeMounts:
        - name: varlog
          mountPath: /var/log
      hostNetwork: true
      nodeSelector:
        waf: modsec
  updateStrategy:
    type: RollingUpdate
