manifest.yml 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272
  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. livenessProbe:
  64. initialDelaySeconds: 5
  65. periodSeconds: 5
  66. httpGet:
  67. path: /liveness
  68. port: 8080
  69. readinessProbe:
  70. initialDelaySeconds: 5
  71. periodSeconds: 5
  72. httpGet:
  73. path: /readiness
  74. port: 8080
  75. ---
  76. apiVersion: apps/v1
  77. kind: Deployment
  78. metadata:
  79. name: gmus-web
  80. labels:
  81. app: gmus-web
  82. spec:
  83. replicas: 1
  84. selector:
  85. matchLabels:
  86. app: gmus-web
  87. template:
  88. metadata:
  89. labels:
  90. app: gmus-web
  91. spec:
  92. imagePullSecrets:
  93. - name: regcred
  94. containers:
  95. - name: gmus-web
  96. image: docker.fela.space/gmus-web:0
  97. ports:
  98. - containerPort: 8080
  99. envFrom:
  100. - configMapRef:
  101. name: gmus-web
  102. livenessProbe:
  103. initialDelaySeconds: 5
  104. periodSeconds: 5
  105. httpGet:
  106. path: /liveness
  107. port: 8080
  108. readinessProbe:
  109. initialDelaySeconds: 5
  110. periodSeconds: 5
  111. httpGet:
  112. path: /readiness
  113. port: 8080
  114. ---
  115. apiVersion: v1
  116. kind: Service
  117. metadata:
  118. name: gmus-database
  119. labels:
  120. app: gmus-database
  121. spec:
  122. ports:
  123. - port: 5432
  124. selector:
  125. app: gmus-database
  126. tier: postgres
  127. clusterIP: None
  128. ---
  129. apiVersion: storage.k8s.io/v1
  130. kind: StorageClass
  131. metadata:
  132. name: standard
  133. provisioner: kubernetes.io/no-provisioner
  134. volumeBindingMode: WaitForFirstConsumer
  135. ---
  136. apiVersion: v1
  137. kind: PersistentVolume
  138. metadata:
  139. name: postgres-pv-gmus
  140. labels:
  141. app: gmus-database
  142. spec:
  143. storageClassName: manual
  144. capacity:
  145. storage: 1Gi
  146. accessModes:
  147. - ReadWriteOnce
  148. hostPath:
  149. path: /var/local/gmus-database
  150. ---
  151. apiVersion: v1
  152. kind: PersistentVolumeClaim
  153. metadata:
  154. name: postgres-pv-claim-gmus
  155. labels:
  156. app: gmus-database
  157. spec:
  158. storageClassName: manual
  159. accessModes:
  160. - ReadWriteOnce
  161. resources:
  162. requests:
  163. storage: 1Gi
  164. ---
  165. apiVersion: apps/v1
  166. kind: Deployment
  167. metadata:
  168. name: gmus-database
  169. labels:
  170. app: gmus-database
  171. spec:
  172. selector:
  173. matchLabels:
  174. app: gmus-database
  175. tier: postgres
  176. strategy:
  177. type: Recreate
  178. template:
  179. metadata:
  180. labels:
  181. app: gmus-database
  182. tier: postgres
  183. spec:
  184. containers:
  185. - image: postgres:10.4
  186. name: postgres
  187. env:
  188. - name: POSTGRES_USER
  189. value: gmus
  190. - name: POSTGRES_PASSWORD
  191. valueFrom:
  192. secretKeyRef:
  193. name: postgres-pass
  194. key: password
  195. ports:
  196. - containerPort: 5432
  197. name: postgres
  198. volumeMounts:
  199. - name: postgres-persistent-storage
  200. mountPath: /var/lib/postgresql/data
  201. volumes:
  202. - name: postgres-persistent-storage
  203. persistentVolumeClaim:
  204. claimName: postgres-pv-claim-gmus
  205. ---
  206. apiVersion: v1
  207. kind: Service
  208. metadata:
  209. name: gmus-redis
  210. labels:
  211. app: gmus-redis
  212. spec:
  213. ports:
  214. - port: 6379
  215. selector:
  216. app: gmus-redis
  217. tier: redis
  218. clusterIP: None
  219. ---
  220. apiVersion: apps/v1
  221. kind: Deployment
  222. metadata:
  223. name: gmus-redis
  224. labels:
  225. app: gmus-redis
  226. spec:
  227. selector:
  228. matchLabels:
  229. app: gmus-redis
  230. tier: redis
  231. strategy:
  232. type: Recreate
  233. template:
  234. metadata:
  235. labels:
  236. app: gmus-redis
  237. tier: redis
  238. spec:
  239. containers:
  240. - image: redis:6-alpine
  241. name: redis
  242. ports:
  243. - containerPort: 6379
  244. name: redis
  245. ---
  246. apiVersion: batch/v1beta1
  247. kind: CronJob
  248. metadata:
  249. name: gmus-scan-library
  250. spec:
  251. schedule: "45 5 * * *"
  252. jobTemplate:
  253. spec:
  254. template:
  255. spec:
  256. containers:
  257. - name: gmus-scan
  258. image: docker.fela.space/gmus-backend:0
  259. args:
  260. - scan
  261. envFrom:
  262. - configMapRef:
  263. name: gmus-backend
  264. env:
  265. - name: GO_ENV
  266. value: production
  267. - name: POSTGRES_PASSWORD
  268. valueFrom:
  269. secretKeyRef:
  270. name: postgres-pass
  271. key: password
  272. restartPolicy: Never