apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: appsentinels-sniffer-daemonset
  namespace: appsentinels
  labels:
    app: appsentinels-sniffer
spec:
  selector:
    matchLabels:
      app: appsentinels-sniffer
  template:
    metadata:
      labels:
        app: appsentinels-sniffer
    spec:    
      hostNetwork: true
      containers:
      - name: sniffer-sensor
        image: "docker.io/appsentinels/ng-controller:latest"
        imagePullPolicy: Always
        securityContext:
          privileged: true
        resources:
          limits:
            cpu: 2
            memory: 2Gi
          requests:
            cpu: 1
            memory: 1Gi          
        env:
        - name: REMOTE_CONTROLLER_SERVER_NAME
          value: "edge controller hostname"
        - name: REMOTE_CONTROLLER_SERVER_PORT
          value: "9004"
        - name: ENVIRONMENT
          value: <current environment>
        - name: SNIFFER_SENSOR_INSTANCE
          value: "<sniffer sensor instance name eg: cluster-1-sensor>"
        - name: TAP_INTERFACE
          value: default  # Please modify according to deployment
        - name: TAP_FILTER
          value: tcp-and-port-not-22-and-port-not-443-and-port-not-9004-and-port-not-9101 # Please modify according to deployment
        - name: RELAY_PROTOCOL
          value: http
      tolerations:
      - operator: Exists
        effect: NoExecute
      - operator: Exists
        effect: NoSchedule
      #nodeSelector:
      #  node-role.kubernetes.io/worker: "true"  # Selects only worker nodes, if labeled as "worker"
