apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: es-index-rotator
  namespace: kube-system
spec:
  # 每天1点3分执行
  schedule: "3 1 */1 * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: es-index-rotator
            image: easzlab/es-index-rotator:0.1.3
            # 保留最近30天日志
            command:
            - /bin/rotate.sh
            - "30"
          restartPolicy: OnFailure
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 2
  failedJobsHistoryLimit: 1
