lidarr-empty-folders.yaml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. ---
  2. apiVersion: batch/v1
  3. kind: CronJob
  4. metadata:
  5. name: lidarr-empty-folders
  6. namespace: plex
  7. spec:
  8. schedule: "*/1 * * * *"
  9. successfulJobsHistoryLimit: 1
  10. failedJobsHistoryLimit: 1
  11. concurrencyPolicy: Forbid
  12. jobTemplate:
  13. spec:
  14. template:
  15. metadata:
  16. labels:
  17. app: lidarr-empty-folders
  18. annotations:
  19. backup.velero.io/backup-volumes-excludes: media
  20. spec:
  21. securityContext:
  22. runAsUser: 1000
  23. runAsGroup: 1000
  24. restartPolicy: OnFailure
  25. containers:
  26. - name: lidarr-empty-folders
  27. image: jibby0/lidarr-empty-folders
  28. command:
  29. - /bin/sh
  30. - -c
  31. - python3 /script/lidarr_empty_folders.py $LIDARR_HOST $LIDARR_API_KEY $LIDARR_MUSIC_PATH
  32. env:
  33. - name: LIDARR_HOST
  34. value: https://lidarr.lan.jibby.org
  35. - name: LIDARR_API_KEY
  36. valueFrom:
  37. secretKeyRef:
  38. name: lidarr-empty-folders
  39. key: api-key
  40. - name: LIDARR_MUSIC_PATH
  41. value: /media/Music/
  42. volumeMounts:
  43. - mountPath: "/media"
  44. name: media
  45. - mountPath: /script
  46. name: lidarr-empty-folders
  47. volumes:
  48. - name: media
  49. persistentVolumeClaim:
  50. claimName: plex-pvc
  51. - name: lidarr-empty-folders
  52. configMap:
  53. name: lidarr-empty-folders
  54. items:
  55. - key: lidarr_empty_folders.py
  56. path: lidarr_empty_folders.py