nextcloud-dply.yaml 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: nextcloud
  5. spec:
  6. replicas: 1
  7. selector:
  8. matchLabels:
  9. name: nextcloud
  10. template:
  11. metadata:
  12. labels:
  13. name: nextcloud
  14. nginx: backend
  15. redis: client
  16. spec:
  17. affinity:
  18. nodeAffinity:
  19. preferredDuringSchedulingIgnoredDuringExecution:
  20. - weight: 1
  21. preference:
  22. matchExpressions:
  23. - key: kubernetes.io/arch
  24. operator: In
  25. values:
  26. - amd64
  27. containers:
  28. - name: nextcloud
  29. image: qdii/nextcloud:28.0.2-apache
  30. env:
  31. - name: MYSQL_DATABASE
  32. value: "nextcloud"
  33. - name: MYSQL_USER
  34. value: "nextcloud"
  35. - name: MYSQL_HOST
  36. value: "mariadb.mariadb"
  37. - name: MYSQL_PASSWORD
  38. valueFrom:
  39. secretKeyRef:
  40. name: nextcloud
  41. key: mariadb-password
  42. - name: NEXTCLOUD_ADMIN_USER
  43. value: "qdii"
  44. - name: NEXTCLOUD_ADMIN_PASSWORD
  45. valueFrom:
  46. secretKeyRef:
  47. name: nextcloud
  48. key: admin-password
  49. - name: NEXTCLOUD_TRUSTED_DOMAINS
  50. value: "dodges.it"
  51. - name: APACHE_DISABLE_REWRITES
  52. value: "1"
  53. - name: TRUSTED_PROXIES
  54. value: "10.244.0.1/16"
  55. - name: OVERWRITEHOST
  56. value: "ng.dodges.it"
  57. - name: OVERWRITEPROTOCOL
  58. value: "https"
  59. - name: REDIS_HOST
  60. value: "redis-master"
  61. - name: REDIS_HOST_PORT
  62. value: "6379"
  63. - name: PHP_UPLOAD_LIMIT
  64. value: "4096M"
  65. - name: PHP_MEMORY_LIMIT
  66. value: "2048M"
  67. - name: REDIS_HOST_PASSWORD
  68. valueFrom:
  69. secretKeyRef:
  70. name: redis
  71. key: root-password
  72. volumeMounts:
  73. - name: nextcloud
  74. mountPath: /var/www/html
  75. ports:
  76. - containerPort: 80
  77. name: http
  78. livenessProbe:
  79. initialDelaySeconds: 7200
  80. timeoutSeconds: 10
  81. httpGet:
  82. path: /index.php
  83. port: 80
  84. httpHeaders:
  85. - name: Host
  86. value: "ng.dodges.it"
  87. resources:
  88. requests:
  89. memory: "500Mi"
  90. cpu: "30m"
  91. volumes:
  92. - name: nextcloud
  93. persistentVolumeClaim:
  94. claimName: nextcloud
  95. ---
  96. apiVersion: batch/v1
  97. kind: CronJob
  98. metadata:
  99. name: nextcloud-backup
  100. spec:
  101. schedule: "@weekly"
  102. jobTemplate:
  103. spec:
  104. template:
  105. spec:
  106. affinity:
  107. nodeAffinity:
  108. requiredDuringSchedulingIgnoredDuringExecution:
  109. nodeSelectorTerms:
  110. - matchExpressions:
  111. - key: arch
  112. operator: In
  113. values:
  114. - x86
  115. containers:
  116. - name: nextcloud-backup
  117. image: qdii/backup-rsync:latest
  118. env:
  119. - name: LOCAL_FOLDER_PATH
  120. value: /mnt/data/qdii/files
  121. - name: REMOTE_USER
  122. value: "uab10c1ba4bc"
  123. - name: REMOTE_SERVER
  124. value: "bck.dodges.it"
  125. - name: REMOTE_FOLDER_PATH
  126. value: "/home/uab10c1ba4bc/data/vol0/nextcloud"
  127. volumeMounts:
  128. - name: backup
  129. mountPath: "/root/.ssh/id_rsa"
  130. subPath: ssh_private_key
  131. readOnly: true
  132. - name: backup
  133. mountPath: "/root/.ssh/id_rsa.pub"
  134. subPath: ssh_public_key
  135. readOnly: true
  136. - name: nextcloud
  137. mountPath: /mnt
  138. restartPolicy: Never
  139. volumes:
  140. - name: backup
  141. secret:
  142. secretName: backup
  143. defaultMode: 0400
  144. - name: nextcloud
  145. persistentVolumeClaim:
  146. claimName: nextcloud
  147. ---
  148. apiVersion: batch/v1
  149. kind: CronJob
  150. metadata:
  151. name: nextcloud-backup-jb
  152. spec:
  153. schedule: "@weekly"
  154. jobTemplate:
  155. spec:
  156. template:
  157. spec:
  158. affinity:
  159. nodeAffinity:
  160. requiredDuringSchedulingIgnoredDuringExecution:
  161. nodeSelectorTerms:
  162. - matchExpressions:
  163. - key: arch
  164. operator: In
  165. values:
  166. - x86
  167. containers:
  168. - name: nextcloud-backup-jb
  169. image: qdii/backup-rsync:latest
  170. env:
  171. - name: LOCAL_FOLDER_PATH
  172. value: /mnt/data/jb/files
  173. - name: REMOTE_USER
  174. value: "uab10c1ba4bc"
  175. - name: REMOTE_SERVER
  176. value: "bck.dodges.it"
  177. - name: REMOTE_FOLDER_PATH
  178. value: "/home/uab10c1ba4bc/data/vol0/jb"
  179. volumeMounts:
  180. - name: backup
  181. mountPath: "/root/.ssh/id_rsa"
  182. subPath: ssh_private_key
  183. readOnly: true
  184. - name: backup
  185. mountPath: "/root/.ssh/id_rsa.pub"
  186. subPath: ssh_public_key
  187. readOnly: true
  188. - name: nextcloud
  189. mountPath: /mnt
  190. restartPolicy: Never
  191. volumes:
  192. - name: backup
  193. secret:
  194. secretName: backup
  195. defaultMode: 0400
  196. - name: nextcloud
  197. persistentVolumeClaim:
  198. claimName: nextcloud
  199. ---
  200. apiVersion: batch/v1
  201. kind: CronJob
  202. metadata:
  203. name: nextcloud-backup-augustin
  204. spec:
  205. schedule: "@weekly"
  206. jobTemplate:
  207. spec:
  208. template:
  209. spec:
  210. affinity:
  211. nodeAffinity:
  212. requiredDuringSchedulingIgnoredDuringExecution:
  213. nodeSelectorTerms:
  214. - matchExpressions:
  215. - key: arch
  216. operator: In
  217. values:
  218. - x86
  219. containers:
  220. - name: nextcloud-backup-augustin
  221. image: qdii/backup-rsync:latest
  222. env:
  223. - name: LOCAL_FOLDER_PATH
  224. value: /mnt/data/Augustin/files
  225. - name: REMOTE_USER
  226. value: "uab10c1ba4bc"
  227. - name: REMOTE_SERVER
  228. value: "bck.dodges.it"
  229. - name: REMOTE_FOLDER_PATH
  230. value: "/home/uab10c1ba4bc/data/vol0/augustin"
  231. volumeMounts:
  232. - name: backup
  233. mountPath: "/root/.ssh/id_rsa"
  234. subPath: ssh_private_key
  235. readOnly: true
  236. - name: backup
  237. mountPath: "/root/.ssh/id_rsa.pub"
  238. subPath: ssh_public_key
  239. readOnly: true
  240. - name: nextcloud
  241. mountPath: /mnt
  242. restartPolicy: Never
  243. volumes:
  244. - name: backup
  245. secret:
  246. secretName: backup
  247. defaultMode: 0400
  248. - name: nextcloud
  249. persistentVolumeClaim:
  250. claimName: nextcloud