---
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: descheduler-job
  namespace: kube-system
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          priorityClassName: system-cluster-critical
          containers:
            - name: descheduler
              image: registry.grofer.io/infra/descheduler:master
              volumeMounts:
                - mountPath: /policy-dir
                  name: policy-volume
              command: ["/bin/descheduler"]
              args:
               - --policy-config-file=/policy-dir/policy.yaml
               - --v=1
               - --node-selector
               - team!=infra,team!=infra-large,team!=airflow,team!=jhub
          restartPolicy: "Never"
          serviceAccountName: descheduler-sa
          volumes:
            - name: policy-volume
              configMap:
                name: descheduler-policy-configmap
