apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: descheduler-job
  namespace: kube-system
spec:
  schedule: "1 * * * *"
  jobTemplate:
    spec:
      template:
        metadata:
          name: descheduler-pod
          annotations:
            scheduler.alpha.kubernetes.io/critical-pod: ""
        spec:
          containers:
            - name: descheduler
              image: gcr.io/wakashiyo-playground/descheduler:0.0.1
              volumeMounts:
                - mountPath: /policy-dir
                  name: policy-volume
              command:
                [
                  "/bin/descheduler",
                  "--policy-config-file",
                  "/policy-dir/policy.yaml",
                  "-v",
                  "1",
                ]
          restartPolicy: "Never"
          serviceAccountName: descheduler-sa
          volumes:
            - name: policy-volume
              configMap:
                name: descheduler-policy-configmap
