apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: trivy-scanner
  name: trivy-scanner
spec:
  replicas: 1
  selector:
    matchLabels:
      app: trivy-scanner
  template:
    metadata:
      labels:
        app: trivy-scanner
      annotations:
        prometheus.io/port: "9115"
        prometheus.io/scrape: "true"
    spec:
      securityContext:
        fsGroup: 10001
      serviceAccountName: trivy-scanner
#      imagePullSecrets:
#      - name: regcred
      containers:
      - name: trivy-scanner
        image: devopstales/trivy-scanner:2.1
        imagePullPolicy: Always
#        env:
#        - name: GITHUB_TOKEN
#          value: MY-TOKEN-FROM-GITHUB
        volumeMounts:
        - name: operator-config
          mountPath: /etc/trivy-scanner/
        - name: cache
          mountPath: "/home/kube-trivy-exporter/trivy-cache"
#        - name: config-json
#          mountPath: "/home/kube-trivy-exporter/.docker"
        ports:
          - containerPort: 9115
      volumes:
      - configMap:
          name: trivy-scanner-config
        name: operator-config
      - name: cache
        persistentVolumeClaim:
            claimName: "trivy-cache"
#      - name: config-json
#        secret:
#          secretName: config-json
