Front of deployment elk+filebeat Too many logs are generated , Easy to burst disk , So add a cronjob Regularly clean up the index before a certain time , as follows :

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: es-clean-cronjob
  namespace: kube-system
spec:
  jobTemplate:
    metadata:
    spec:
      template:
        metadata:
        spec:
          containers:
          - command:
            - sh
            - -c
            - curl -XDELETE http://elasticsearch-master.kube-system.svc.cluster.local:9200/filebeat-`date
              -d '-7 day' +%Y.%m.%d`
            image: curlimages/curl:latest
            imagePullPolicy: Always
            name: es-clean-cronjob
          restartPolicy: OnFailure
  schedule: 00 04 * * *