manifest.yml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: gmus-backend
  5. spec:
  6. type: LoadBalancer
  7. selector:
  8. app: gmus-backend
  9. ports:
  10. - name: http
  11. protocol: TCP
  12. port: 8080
  13. targetPort: 8080
  14. ---
  15. apiVersion: v1
  16. kind: Service
  17. metadata:
  18. name: gmus-web
  19. spec:
  20. type: LoadBalancer
  21. selector:
  22. app: gmus-web
  23. ports:
  24. - name: http
  25. protocol: TCP
  26. port: 8080
  27. targetPort: 8080
  28. ---
  29. apiVersion: apps/v1
  30. kind: Deployment
  31. metadata:
  32. name: gmus-backend
  33. labels:
  34. app: gmus-backend
  35. spec:
  36. replicas: 2
  37. selector:
  38. matchLabels:
  39. app: gmus-backend
  40. template:
  41. metadata:
  42. labels:
  43. app: gmus-backend
  44. spec:
  45. imagePullSecrets:
  46. - name: regcred
  47. containers:
  48. - name: gmus-backend
  49. image: docker.fela.space/gmus-backend:0
  50. ports:
  51. - containerPort: 8080
  52. envFrom:
  53. - configMapRef:
  54. name: gmus-backend
  55. env:
  56. - name: GO_ENV
  57. value: production
  58. - name: POSTGRES_PASSWORD
  59. valueFrom:
  60. secretKeyRef:
  61. name: postgres-pass
  62. key: password
  63. volumeMounts:
  64. - name: gmus-library
  65. mountPath: /music
  66. readOnly: true
  67. livenessProbe:
  68. initialDelaySeconds: 5
  69. periodSeconds: 5
  70. httpGet:
  71. path: /liveness
  72. port: 8080
  73. readinessProbe:
  74. initialDelaySeconds: 5
  75. periodSeconds: 5
  76. httpGet:
  77. path: /readiness
  78. port: 8080
  79. volumes:
  80. - name: gmus-library
  81. hostPath:
  82. path: LIBRARY_DIRECTORY
  83. ---
  84. apiVersion: apps/v1
  85. kind: Deployment
  86. metadata:
  87. name: gmus-web
  88. labels:
  89. app: gmus-web
  90. spec:
  91. replicas: 1
  92. selector:
  93. matchLabels:
  94. app: gmus-web
  95. template:
  96. metadata:
  97. labels:
  98. app: gmus-web
  99. spec:
  100. imagePullSecrets:
  101. - name: regcred
  102. containers:
  103. - name: gmus-web
  104. image: docker.fela.space/gmus-web:0
  105. ports:
  106. - containerPort: 8080
  107. envFrom:
  108. - configMapRef:
  109. name: gmus-web
  110. livenessProbe:
  111. initialDelaySeconds: 5
  112. periodSeconds: 5
  113. httpGet:
  114. path: /liveness
  115. port: 8080
  116. readinessProbe:
  117. initialDelaySeconds: 5
  118. periodSeconds: 5
  119. httpGet:
  120. path: /readiness
  121. port: 8080
  122. ---
  123. apiVersion: v1
  124. kind: Service
  125. metadata:
  126. name: gmus-database
  127. labels:
  128. app: gmus-database
  129. spec:
  130. ports:
  131. - port: 5432
  132. selector:
  133. app: gmus-database
  134. tier: postgres
  135. clusterIP: None
  136. ---
  137. apiVersion: storage.k8s.io/v1
  138. kind: StorageClass
  139. metadata:
  140. name: standard
  141. provisioner: kubernetes.io/no-provisioner
  142. volumeBindingMode: WaitForFirstConsumer
  143. ---
  144. apiVersion: v1
  145. kind: PersistentVolume
  146. metadata:
  147. name: postgres-pv-gmus
  148. labels:
  149. app: gmus-database
  150. spec:
  151. storageClassName: manual
  152. capacity:
  153. storage: 1Gi
  154. accessModes:
  155. - ReadWriteOnce
  156. hostPath:
  157. path: /var/local/gmus-database
  158. ---
  159. apiVersion: v1
  160. kind: PersistentVolumeClaim
  161. metadata:
  162. name: postgres-pv-claim-gmus
  163. labels:
  164. app: gmus-database
  165. spec:
  166. storageClassName: manual
  167. accessModes:
  168. - ReadWriteOnce
  169. resources:
  170. requests:
  171. storage: 1Gi
  172. ---
  173. apiVersion: apps/v1
  174. kind: Deployment
  175. metadata:
  176. name: gmus-database
  177. labels:
  178. app: gmus-database
  179. spec:
  180. selector:
  181. matchLabels:
  182. app: gmus-database
  183. tier: postgres
  184. strategy:
  185. type: Recreate
  186. template:
  187. metadata:
  188. labels:
  189. app: gmus-database
  190. tier: postgres
  191. spec:
  192. containers:
  193. - image: postgres:10.4
  194. name: postgres
  195. env:
  196. - name: POSTGRES_USER
  197. value: gmus
  198. - name: POSTGRES_PASSWORD
  199. valueFrom:
  200. secretKeyRef:
  201. name: postgres-pass
  202. key: password
  203. ports:
  204. - containerPort: 5432
  205. name: postgres
  206. volumeMounts:
  207. - name: postgres-persistent-storage
  208. mountPath: /var/lib/postgresql/data
  209. volumes:
  210. - name: postgres-persistent-storage
  211. persistentVolumeClaim:
  212. claimName: postgres-pv-claim-gmus
  213. ---
  214. apiVersion: v1
  215. kind: Service
  216. metadata:
  217. name: gmus-redis
  218. labels:
  219. app: gmus-redis
  220. spec:
  221. ports:
  222. - port: 6379
  223. selector:
  224. app: gmus-redis
  225. tier: redis
  226. clusterIP: None
  227. ---
  228. apiVersion: apps/v1
  229. kind: Deployment
  230. metadata:
  231. name: gmus-redis
  232. labels:
  233. app: gmus-redis
  234. spec:
  235. selector:
  236. matchLabels:
  237. app: gmus-redis
  238. tier: redis
  239. strategy:
  240. type: Recreate
  241. template:
  242. metadata:
  243. labels:
  244. app: gmus-redis
  245. tier: redis
  246. spec:
  247. containers:
  248. - image: redis:6-alpine
  249. name: redis
  250. ports:
  251. - containerPort: 6379
  252. name: redis
  253. ---
  254. apiVersion: batch/v1beta1
  255. kind: CronJob
  256. metadata:
  257. name: gmus-scan-library
  258. spec:
  259. schedule: "45 5 * * *"
  260. jobTemplate:
  261. spec:
  262. template:
  263. spec:
  264. containers:
  265. - name: gmus-scan
  266. image: docker.fela.space/gmus-backend:0
  267. args:
  268. - gmus.scan
  269. envFrom:
  270. - configMapRef:
  271. name: gmus-backend
  272. env:
  273. - name: GO_ENV
  274. value: production
  275. - name: POSTGRES_PASSWORD
  276. valueFrom:
  277. secretKeyRef:
  278. name: postgres-pass
  279. key: password
  280. volumeMounts:
  281. - name: gmus-library
  282. mountPath: /music
  283. readOnly: true
  284. restartPolicy: Never
  285. volumes:
  286. - name: gmus-library
  287. hostPath:
  288. path: LIBRARY_DIRECTORY
  289. ---
  290. apiVersion: apps/v1
  291. kind: Deployment
  292. metadata:
  293. name: gmus-file-watcher
  294. labels:
  295. app: gmus-file-watcher
  296. spec:
  297. replicas: 1
  298. selector:
  299. matchLabels:
  300. app: gmus-file-watcher
  301. template:
  302. metadata:
  303. labels:
  304. app: gmus-file-watcher
  305. spec:
  306. imagePullSecrets:
  307. - name: regcred
  308. containers:
  309. - name: gmus-file-watcher
  310. image: docker.fela.space/gmus-backend:0
  311. ports:
  312. - containerPort: 8081
  313. args:
  314. - gmus.watch
  315. envFrom:
  316. - configMapRef:
  317. name: gmus-backend
  318. env:
  319. - name: GO_ENV
  320. value: production
  321. - name: PORT
  322. value: "8081"
  323. - name: POSTGRES_PASSWORD
  324. valueFrom:
  325. secretKeyRef:
  326. name: postgres-pass
  327. key: password
  328. volumeMounts:
  329. - name: gmus-library
  330. mountPath: /music
  331. readOnly: true
  332. livenessProbe:
  333. initialDelaySeconds: 5
  334. periodSeconds: 5
  335. httpGet:
  336. path: /liveness
  337. port: 8081
  338. readinessProbe:
  339. initialDelaySeconds: 5
  340. periodSeconds: 5
  341. httpGet:
  342. path: /readiness
  343. port: 8081
  344. volumes:
  345. - name: gmus-library
  346. hostPath:
  347. path: LIBRARY_DIRECTORY