---
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: openfaas/faas-idler:0.3.0
          imagePullPolicy: Always
          env:
            - name: gateway_url
              value: "http://gateway.openfaas:8080/"
            - name: prometheus_host
              value: "prometheus.openfaas"
            - name: prometheus_port
              value: "9090"
            - name: inactivity_duration
              value: 30m
            - name: reconcile_interval
              value: 2m
          command:
            - /home/app/faas-idler
            - -dry-run=true
          volumeMounts:
            - name: auth
              readOnly: true
              mountPath: "/var/secrets/"
      volumes:
        - name: auth
          secret:
            secretName: basic-auth
      nodeSelector:
        beta.kubernetes.io/arch: amd64
