---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: faas-idler
  namespace: "openfaas"
  labels:
    app: openfaas
    component: faas-idler
spec:
  replicas: 1
  selector:
    matchLabels:
      app: faas-idler
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "false"
      labels:
        app: faas-idler
    spec:
      containers:
        - name: faas-idler
          resources:
            requests:
              memory: 64Mi
          image: ghcr.io/openfaas/faas-idler-pro:0.4.4
          imagePullPolicy: Always
          command:
           - "/usr/bin/faas-idler"
           - -read-only=false
           - "-license-file=/var/secrets/license/license"
          env:
            - name: gateway_url
              value: "http://gateway.openfaas:8080/"
            - name: prometheus_host
              value: "prometheus.openfaas"
            - name: prometheus_port
              value: "9090"
            - name: inactivity_duration
              value: 3m
            - name: reconcile_interval
              value: 2m
          volumeMounts:
            - name: auth
              readOnly: true
              mountPath: "/var/secrets/"
            - name: openfaas-license
              readOnly: true
              mountPath: "/var/secrets/license"
      volumes:
        - name: auth
          secret:
            secretName: basic-auth
        - name: openfaas-license
          secret:
            secretName: openfaas-license
