feat(helm): Ability to change the retention on hours
Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
This commit is contained in:
parent
6de2168d92
commit
3d5c98c7a1
2 changed files with 7 additions and 1 deletions
|
|
@ -35,7 +35,11 @@ spec:
|
|||
set -x
|
||||
echo "Cleaning NFS strorage for data older than {{.Values.efsCleaner.retention}} days"
|
||||
storage=`du -sh /mnt/efs`
|
||||
find /mnt/efs -type f -mtime +{{.Values.efsCleaner.retention}} -exec /bin/bash -c "ls -lah {}; rm {}" \;
|
||||
{{- $time := mul .Values.efsCleaner.retention 1440 }}
|
||||
{{- if .Values.efsCleaner.retentionHours }}
|
||||
{{- $time = mul .Values.efsCleaner.retentionHours 60 }}
|
||||
{{- end}}
|
||||
find /mnt/efs -type f -mmin +{{ $time }} -exec /bin/bash -c "ls -lah {}; rm {}" \;
|
||||
echo "Storage before cleaning"
|
||||
echo ${storage}
|
||||
echo "Storage after cleaning"
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@ replicaCount: 1
|
|||
|
||||
efsCleaner:
|
||||
retention: 1
|
||||
# This value is the new convention, and has priority.
|
||||
# retentionHours: 12
|
||||
pvc:
|
||||
# This can be either persistentVolumeClaim or hostPath.
|
||||
# In case of pvc, you'll have to provide the pvc name.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue