---
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: aqua-scanner
  name: aqua-scanner
spec:
  replicas: 1
  selector:
    matchLabels:
      app: aqua-scanner
  template:
    metadata:
      labels:
        app: aqua-scanner
      name: aqua-scanner
    spec:
      serviceAccount: aqua-sa
      restartPolicy: Always
      containers:
      - name: aqua-scanner
        image: registry.aquasec.com/scanner:5.0
        imagePullPolicy: Always
        args:
        - daemon
        - --direct-cc
        - --user
        - scanner
        - --password
        - '{AQUA_SCANNER_PASSWORD}'
        - --host
        - http://aqua-web:8080
        env:
        - name: AQUA_SCANNER_LOGICAL_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        ports:
        - containerPort: 8080
          protocol: TCP
        volumeMounts:
        - mountPath: /var/run/docker.sock
          name: docker-socket-mount
      volumes:
      - name: docker-socket-mount
        hostPath:
          path: /var/run/docker.sock
