webdav.yaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. name: webdav-deployment
  6. namespace: default
  7. labels:
  8. app: webdav
  9. spec:
  10. replicas: 1
  11. selector:
  12. matchLabels:
  13. app: webdav
  14. template:
  15. metadata:
  16. labels:
  17. app: webdav
  18. annotations:
  19. diun.enable: "true"
  20. diun.include_tags: '^\d+\.\d+$'
  21. spec:
  22. containers:
  23. - image: rclone/rclone:1.72
  24. name: rclone
  25. imagePullPolicy: IfNotPresent
  26. ports:
  27. - containerPort: 80
  28. volumeMounts:
  29. - name: webdav-data-vol
  30. mountPath: /data
  31. - name: webdav-config-vol
  32. mountPath: /config
  33. args: ["serve", "webdav", "/data", "--addr", ":80", "--htpasswd", "/config/htpasswd"]
  34. volumes:
  35. - name: webdav-data-vol
  36. hostPath:
  37. path: /mnt/webdav/data
  38. type: Directory
  39. - name: webdav-config-vol
  40. hostPath:
  41. path: /mnt/webdav/config
  42. type: Directory
  43. ---
  44. apiVersion: v1
  45. kind: Service
  46. metadata:
  47. name: webdav
  48. namespace: default
  49. labels:
  50. app: webdav
  51. spec:
  52. type: ClusterIP
  53. selector:
  54. app: webdav
  55. ports:
  56. - port: 80
  57. targetPort: 80
  58. ---
  59. apiVersion: cert-manager.io/v1
  60. kind: Certificate
  61. metadata:
  62. name: webdav.bodicsek.host
  63. spec:
  64. secretName: webdav.bodicsek.host
  65. issuerRef:
  66. name: letsencrypt-prod
  67. kind: ClusterIssuer
  68. dnsNames:
  69. - webdav.bodicsek.host
  70. ---
  71. apiVersion: traefik.io/v1alpha1
  72. kind: Middleware
  73. metadata:
  74. name: webdav-options-support
  75. spec:
  76. headers:
  77. accessControlAllowMethods:
  78. - "GET"
  79. - "HEAD"
  80. - "POST"
  81. - "PUT"
  82. - "DELETE"
  83. - "PATCH"
  84. - "COPY"
  85. - "LOCK"
  86. - "UNLOCK"
  87. - "MKCOL"
  88. - "MOVE"
  89. - "PROPFIND"
  90. - "PROPPATCH"
  91. - "OPTIONS"
  92. accessControlAllowHeaders:
  93. - "*"
  94. accessControlAllowOriginList:
  95. - "*"
  96. accessControlMaxAge: 100
  97. ---
  98. apiVersion: traefik.io/v1alpha1
  99. kind: IngressRoute
  100. metadata:
  101. name: webdav
  102. namespace: default
  103. spec:
  104. entryPoints:
  105. - websecure
  106. routes:
  107. - kind: Rule
  108. match: Host(`webdav.bodicsek.host`)
  109. middlewares:
  110. - name: webdav-options-support
  111. services:
  112. - kind: Service
  113. name: webdav
  114. namespace: default
  115. passHostHeader: true
  116. port: 80
  117. tls:
  118. secretName: webdav.bodicsek.host