duplicati.yaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: duplicati
  6. namespace: plex
  7. spec:
  8. selector:
  9. matchLabels:
  10. app: duplicati
  11. replicas: 1
  12. template:
  13. metadata:
  14. labels:
  15. app: duplicati
  16. annotations:
  17. backup.velero.io/backup-volumes-excludes: plex,media2,data
  18. spec:
  19. containers:
  20. - name: duplicati
  21. image: lscr.io/linuxserver/duplicati:version-v2.0.7.1-2.0.7.1_beta_2023-05-25
  22. ports:
  23. - containerPort: 8200
  24. name: http-web-svc
  25. env:
  26. - name: TZ
  27. value: Etc/UTC
  28. - name: PUID
  29. value: "1000"
  30. - name: PGID
  31. value: "1000"
  32. volumeMounts:
  33. - mountPath: "/plex"
  34. name: plex
  35. - mountPath: "/media2"
  36. name: media2
  37. - mountPath: "/data"
  38. name: data
  39. - mountPath: "/config"
  40. name: config
  41. volumes:
  42. - name: plex
  43. persistentVolumeClaim:
  44. claimName: plex-pvc
  45. - name: media2
  46. persistentVolumeClaim:
  47. claimName: media2-pvc
  48. - name: data
  49. persistentVolumeClaim:
  50. claimName: data-pvc
  51. - name: config
  52. persistentVolumeClaim:
  53. claimName: duplicati-pvc
  54. ---
  55. apiVersion: v1
  56. kind: Service
  57. metadata:
  58. name: duplicati-service
  59. namespace: plex
  60. spec:
  61. selector:
  62. app: duplicati
  63. type: ClusterIP
  64. ports:
  65. - name: duplicati-web-port
  66. protocol: TCP
  67. port: 8200
  68. targetPort: http-web-svc
  69. ---
  70. apiVersion: batch/v1
  71. kind: CronJob
  72. metadata:
  73. name: duplicati-run-tree
  74. namespace: plex
  75. spec:
  76. schedule: "* * * * *"
  77. jobTemplate:
  78. spec:
  79. template:
  80. spec:
  81. containers:
  82. - name: tree
  83. image: alpine:3.18.4
  84. imagePullPolicy: IfNotPresent
  85. envFrom:
  86. - secretRef:
  87. name: ntfy-auth-secret
  88. command:
  89. - /bin/sh
  90. - -c
  91. - (tree /plex > /plex/tree.txt && tree /media2 > /media2/tree.txt) || curl -u $NTFY_AUTH -d 'error generating media tree' https://ntfy.jibby.org/media-tree
  92. volumeMounts:
  93. - mountPath: "/plex"
  94. name: plex
  95. - mountPath: "/media2"
  96. name: media2
  97. volumes:
  98. - name: plex
  99. persistentVolumeClaim:
  100. claimName: plex-pvc
  101. - name: media2
  102. persistentVolumeClaim:
  103. claimName: media2-pvc
  104. restartPolicy: OnFailure