duplicati.yaml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: duplicati
  6. namespace: plex
  7. spec:
  8. strategy:
  9. type: Recreate
  10. selector:
  11. matchLabels:
  12. app: duplicati
  13. replicas: 1
  14. template:
  15. metadata:
  16. labels:
  17. app: duplicati
  18. annotations:
  19. backup.velero.io/backup-volumes-excludes: plex,media2,data
  20. spec:
  21. containers:
  22. - name: duplicati
  23. image: lscr.io/linuxserver/duplicati:version-v2.0.7.1-2.0.7.1_beta_2023-05-25
  24. ports:
  25. - containerPort: 8200
  26. name: http-web-svc
  27. env:
  28. - name: TZ
  29. value: Etc/UTC
  30. - name: PUID
  31. value: "1000"
  32. - name: PGID
  33. value: "1000"
  34. volumeMounts:
  35. - mountPath: "/plex"
  36. name: plex
  37. - mountPath: "/media2"
  38. name: media2
  39. - mountPath: "/data"
  40. name: data
  41. - mountPath: "/config"
  42. name: config
  43. volumes:
  44. - name: plex
  45. persistentVolumeClaim:
  46. claimName: plex-pvc
  47. - name: media2
  48. persistentVolumeClaim:
  49. claimName: media2-pvc
  50. - name: data
  51. persistentVolumeClaim:
  52. claimName: data-pvc
  53. - name: config
  54. persistentVolumeClaim:
  55. claimName: duplicati-pvc
  56. ---
  57. apiVersion: v1
  58. kind: Service
  59. metadata:
  60. name: duplicati-service
  61. namespace: plex
  62. spec:
  63. selector:
  64. app: duplicati
  65. type: ClusterIP
  66. ports:
  67. - name: duplicati-web-port
  68. protocol: TCP
  69. port: 8200
  70. targetPort: http-web-svc
  71. ---
  72. apiVersion: batch/v1
  73. kind: CronJob
  74. metadata:
  75. name: duplicati-run-tree
  76. namespace: plex
  77. spec:
  78. schedule: "0 0 * * 0"
  79. jobTemplate:
  80. spec:
  81. template:
  82. spec:
  83. containers:
  84. - name: tree
  85. image: alpine:3.18.4
  86. imagePullPolicy: IfNotPresent
  87. envFrom:
  88. - secretRef:
  89. name: ntfy-auth-secret
  90. command:
  91. - /bin/sh
  92. - -c
  93. - (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
  94. volumeMounts:
  95. - mountPath: "/plex"
  96. name: plex
  97. - mountPath: "/media2"
  98. name: media2
  99. volumes:
  100. - name: plex
  101. persistentVolumeClaim:
  102. claimName: plex-pvc
  103. - name: media2
  104. persistentVolumeClaim:
  105. claimName: media2-pvc
  106. restartPolicy: OnFailure
  107. ---
  108. apiVersion: traefik.containo.us/v1alpha1
  109. kind: IngressRoute
  110. metadata:
  111. name: duplicati
  112. namespace: plex
  113. spec:
  114. entryPoints:
  115. - websecure
  116. routes:
  117. - kind: Rule
  118. match: Host(`duplicati.lan.jibby.org`)
  119. services:
  120. - kind: Service
  121. name: duplicati-service
  122. port: 8200
  123. middlewares:
  124. - name: lanonly
  125. namespace: kube-system