apiVersion: apps/v1
kind: Deployment
metadata:
  name: clair
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      component: clair
  strategy:
    rollingUpdate:
      maxSurge: 25%
      maxUnavailable: 25%
    type: RollingUpdate
  template:
    metadata:
      labels:
        component: clair
    spec:
      containers:
      - env:
        - name: CLAIR_CONF
          value: /clair/config.yaml
        - name: CLAIR_MODE
          value: combo
        image: goiaba.news:5000/quay/clair:latest
        imagePullPolicy: IfNotPresent
        name: clair
        ports:
        - containerPort: 8080
          name: http
          protocol: TCP
        - containerPort: 8089
          name: introspection
          protocol: TCP
        readinessProbe:
          failureThreshold: 3
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: 8080
          timeoutSeconds: 1
        resources:
          limits:
            cpu: "4"
            memory: 16Gi
          requests:
            cpu: "2"
            memory: 2Gi
        startupProbe:
          failureThreshold: 300
          periodSeconds: 10
          successThreshold: 1
          tcpSocket:
            port: introspection
          timeoutSeconds: 1
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /clair/
          name: clair-config
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      serviceAccount: clair
      serviceAccountName: clair
      terminationGracePeriodSeconds: 30
      volumes:
      - name: clair-config
        secret:
          defaultMode: 420
          secretName: clair-config
