apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: vulnerability-exporter
  labels:
    app: vulnerability-exporter
spec:
  serviceName: vulnerability-exporter
  replicas: 1
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: vulnerability-exporter
  template:
    metadata:
      labels:
        app: vulnerability-exporter
    spec:
      serviceAccountName: vulnerability-exporter-account
      containers:
        - name: vulnerability-exporter
          image: ghcr.io/hnts/vulnerability-exporter:v0.1.1
          imagePullPolicy: Always
          args:
            - --scan-interval=3600
            - --used-namespace=vulnerability-exporter
          ports:
            - name: http
              containerPort: 9321
          volumeMounts:
            - name: cache
              mountPath: /var/lib/trivy
      volumes:
        - name: cache
          emptyDir:
            {}