nextcloud-dply.yaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255
  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:29.0.5-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.redis.svc"
  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. - name: pics
  76. mountPath: /var/www/html/data/qdii/files/pic
  77. ports:
  78. - containerPort: 80
  79. name: http
  80. livenessProbe:
  81. initialDelaySeconds: 7200
  82. timeoutSeconds: 10
  83. httpGet:
  84. path: /index.php
  85. port: 80
  86. httpHeaders:
  87. - name: Host
  88. value: "ng.dodges.it"
  89. resources:
  90. requests:
  91. memory: "500Mi"
  92. cpu: "30m"
  93. volumes:
  94. - name: nextcloud
  95. persistentVolumeClaim:
  96. claimName: nextcloud
  97. - name: pics
  98. persistentVolumeClaim:
  99. claimName: pics
  100. ---
  101. apiVersion: batch/v1
  102. kind: CronJob
  103. metadata:
  104. name: nextcloud-backup
  105. spec:
  106. schedule: "@weekly"
  107. jobTemplate:
  108. spec:
  109. template:
  110. spec:
  111. affinity:
  112. nodeAffinity:
  113. requiredDuringSchedulingIgnoredDuringExecution:
  114. nodeSelectorTerms:
  115. - matchExpressions:
  116. - key: arch
  117. operator: In
  118. values:
  119. - x86
  120. containers:
  121. - name: nextcloud-backup
  122. image: qdii/backup-rsync:latest
  123. env:
  124. - name: LOCAL_FOLDER_PATH
  125. value: /mnt/data/qdii/files
  126. - name: REMOTE_USER
  127. value: "uab10c1ba4bc"
  128. - name: REMOTE_SERVER
  129. value: "bck.dodges.it"
  130. - name: REMOTE_FOLDER_PATH
  131. value: "/home/uab10c1ba4bc/data/vol0/nextcloud"
  132. volumeMounts:
  133. - name: backup
  134. mountPath: "/root/.ssh/id_rsa"
  135. subPath: ssh_private_key
  136. readOnly: true
  137. - name: backup
  138. mountPath: "/root/.ssh/id_rsa.pub"
  139. subPath: ssh_public_key
  140. readOnly: true
  141. - name: nextcloud
  142. mountPath: /mnt
  143. restartPolicy: Never
  144. volumes:
  145. - name: backup
  146. secret:
  147. secretName: backup
  148. defaultMode: 0400
  149. - name: nextcloud
  150. persistentVolumeClaim:
  151. claimName: nextcloud
  152. ---
  153. apiVersion: batch/v1
  154. kind: CronJob
  155. metadata:
  156. name: nextcloud-backup-jb
  157. spec:
  158. schedule: "@weekly"
  159. jobTemplate:
  160. spec:
  161. template:
  162. spec:
  163. affinity:
  164. nodeAffinity:
  165. requiredDuringSchedulingIgnoredDuringExecution:
  166. nodeSelectorTerms:
  167. - matchExpressions:
  168. - key: arch
  169. operator: In
  170. values:
  171. - x86
  172. containers:
  173. - name: nextcloud-backup-jb
  174. image: qdii/backup-rsync:latest
  175. env:
  176. - name: LOCAL_FOLDER_PATH
  177. value: /mnt/data/jb/files
  178. - name: REMOTE_USER
  179. value: "uab10c1ba4bc"
  180. - name: REMOTE_SERVER
  181. value: "bck.dodges.it"
  182. - name: REMOTE_FOLDER_PATH
  183. value: "/home/uab10c1ba4bc/data/vol0/jb"
  184. volumeMounts:
  185. - name: backup
  186. mountPath: "/root/.ssh/id_rsa"
  187. subPath: ssh_private_key
  188. readOnly: true
  189. - name: backup
  190. mountPath: "/root/.ssh/id_rsa.pub"
  191. subPath: ssh_public_key
  192. readOnly: true
  193. - name: nextcloud
  194. mountPath: /mnt
  195. restartPolicy: Never
  196. volumes:
  197. - name: backup
  198. secret:
  199. secretName: backup
  200. defaultMode: 0400
  201. - name: nextcloud
  202. persistentVolumeClaim:
  203. claimName: nextcloud
  204. ---
  205. apiVersion: batch/v1
  206. kind: CronJob
  207. metadata:
  208. name: nextcloud-backup-augustin
  209. spec:
  210. schedule: "@weekly"
  211. jobTemplate:
  212. spec:
  213. template:
  214. spec:
  215. affinity:
  216. nodeAffinity:
  217. requiredDuringSchedulingIgnoredDuringExecution:
  218. nodeSelectorTerms:
  219. - matchExpressions:
  220. - key: arch
  221. operator: In
  222. values:
  223. - x86
  224. containers:
  225. - name: nextcloud-backup-augustin
  226. image: qdii/backup-rsync:latest
  227. env:
  228. - name: LOCAL_FOLDER_PATH
  229. value: /mnt/data/Augustin/files
  230. - name: REMOTE_USER
  231. value: "uab10c1ba4bc"
  232. - name: REMOTE_SERVER
  233. value: "bck.dodges.it"
  234. - name: REMOTE_FOLDER_PATH
  235. value: "/home/uab10c1ba4bc/data/vol0/augustin"
  236. volumeMounts:
  237. - name: backup
  238. mountPath: "/root/.ssh/id_rsa"
  239. subPath: ssh_private_key
  240. readOnly: true
  241. - name: backup
  242. mountPath: "/root/.ssh/id_rsa.pub"
  243. subPath: ssh_public_key
  244. readOnly: true
  245. - name: nextcloud
  246. mountPath: /mnt
  247. restartPolicy: Never
  248. volumes:
  249. - name: backup
  250. secret:
  251. secretName: backup
  252. defaultMode: 0400
  253. - name: nextcloud
  254. persistentVolumeClaim:
  255. claimName: nextcloud