Add migration services
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: alert-processor-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/alert-processor-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: alert-processor-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: alert-processor-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: auth-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/auth-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: auth-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: auth-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: external-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/external-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: external-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: external-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: forecasting-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/forecasting-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: forecasting-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: forecasting-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: inventory-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/inventory-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: inventory-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: inventory-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: notification-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/notification-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: notification-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: notification-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: orders-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/orders-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: orders-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: orders-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pos-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/pos-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: pos-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: pos-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: production-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/production-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: production-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: production-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: recipes-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/recipes-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: recipes-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: recipes-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: sales-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/sales-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: sales-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: sales-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: suppliers-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/suppliers-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: suppliers-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: suppliers-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: tenant-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/tenant-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: tenant-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: tenant-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: training-db-pv
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
storageClassName: manual
|
||||
capacity:
|
||||
storage: 5Gi
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
hostPath:
|
||||
path: "/opt/bakery-data/training-db"
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -51,6 +67,8 @@ spec:
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: init-scripts
|
||||
mountPath: /docker-entrypoint-initdb.d
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
@@ -86,6 +104,9 @@ spec:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: training-db-pvc
|
||||
- name: init-scripts
|
||||
configMap:
|
||||
name: postgres-init-config
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
@@ -117,8 +138,9 @@ metadata:
|
||||
app.kubernetes.io/name: training-db
|
||||
app.kubernetes.io/component: database
|
||||
spec:
|
||||
storageClassName: manual
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
storage: 5Gi
|
||||
|
||||
@@ -13,6 +13,9 @@ data:
|
||||
ENVIRONMENT: "production"
|
||||
DEBUG: "false"
|
||||
LOG_LEVEL: "INFO"
|
||||
|
||||
# Database initialization settings
|
||||
DB_FORCE_RECREATE: "false"
|
||||
BUILD_DATE: "2024-01-20T10:00:00Z"
|
||||
VCS_REF: "latest"
|
||||
IMAGE_TAG: "latest"
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: development-config
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/component: config
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
environment: development
|
||||
data:
|
||||
# Set to "true" to force recreate all tables from scratch (development mode)
|
||||
# This will drop all existing tables and recreate them from SQLAlchemy models
|
||||
DB_FORCE_RECREATE: "false"
|
||||
|
||||
# Development mode flag
|
||||
DEVELOPMENT_MODE: "true"
|
||||
|
||||
# Enable debug logging in development
|
||||
DEBUG_LOGGING: "true"
|
||||
|
||||
# Skip migration version checking in development
|
||||
SKIP_MIGRATION_VERSION_CHECK: "false"
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: postgres-init-config
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/component: database
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
data:
|
||||
init.sql: |
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
CREATE EXTENSION IF NOT EXISTS "pg_stat_statements";
|
||||
@@ -11,6 +11,26 @@ resources:
|
||||
- secrets.yaml
|
||||
- ingress-https.yaml
|
||||
|
||||
# Additional configs
|
||||
- configs/postgres-init-config.yaml
|
||||
- configs/development-config.yaml
|
||||
|
||||
# Migration jobs
|
||||
- migrations/auth-migration-job.yaml
|
||||
- migrations/tenant-migration-job.yaml
|
||||
- migrations/training-migration-job.yaml
|
||||
- migrations/forecasting-migration-job.yaml
|
||||
- migrations/sales-migration-job.yaml
|
||||
- migrations/external-migration-job.yaml
|
||||
- migrations/notification-migration-job.yaml
|
||||
- migrations/inventory-migration-job.yaml
|
||||
- migrations/recipes-migration-job.yaml
|
||||
- migrations/suppliers-migration-job.yaml
|
||||
- migrations/pos-migration-job.yaml
|
||||
- migrations/orders-migration-job.yaml
|
||||
- migrations/production-migration-job.yaml
|
||||
- migrations/alert-processor-migration-job.yaml
|
||||
|
||||
# Infrastructure components
|
||||
- components/databases/redis.yaml
|
||||
- components/databases/rabbitmq.yaml
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for alert-processor service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: alert-processor-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: alert-processor-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: alert-processor-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h alert-processor-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/alert-processor:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "alert_processor"]
|
||||
env:
|
||||
- name: ALERT_PROCESSOR_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: ALERT_PROCESSOR_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for auth service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: auth-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: auth-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: auth-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h auth-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/auth-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "auth"]
|
||||
env:
|
||||
- name: AUTH_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: AUTH_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for external service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: external-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: external-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: external-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h external-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/external-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "external"]
|
||||
env:
|
||||
- name: EXTERNAL_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: EXTERNAL_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for forecasting service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: forecasting-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: forecasting-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: forecasting-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h forecasting-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/forecasting-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "forecasting"]
|
||||
env:
|
||||
- name: FORECASTING_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: FORECASTING_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for inventory service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: inventory-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: inventory-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: inventory-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h inventory-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/inventory-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "inventory"]
|
||||
env:
|
||||
- name: INVENTORY_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: INVENTORY_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for notification service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: notification-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: notification-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: notification-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h notification-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/notification-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "notification"]
|
||||
env:
|
||||
- name: NOTIFICATION_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: NOTIFICATION_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for orders service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: orders-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: orders-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: orders-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h orders-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/orders-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "orders"]
|
||||
env:
|
||||
- name: ORDERS_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: ORDERS_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for pos service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: pos-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: pos-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: pos-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h pos-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/pos-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "pos"]
|
||||
env:
|
||||
- name: POS_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: POS_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for production service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: production-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: production-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: production-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h production-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/production-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "production"]
|
||||
env:
|
||||
- name: PRODUCTION_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: PRODUCTION_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for recipes service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: recipes-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: recipes-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: recipes-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h recipes-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/recipes-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "recipes"]
|
||||
env:
|
||||
- name: RECIPES_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: RECIPES_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for sales service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: sales-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: sales-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: sales-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h sales-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/sales-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "sales"]
|
||||
env:
|
||||
- name: SALES_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: SALES_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for suppliers service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: suppliers-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: suppliers-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: suppliers-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h suppliers-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/suppliers-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "suppliers"]
|
||||
env:
|
||||
- name: SUPPLIERS_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: SUPPLIERS_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for tenant service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: tenant-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: tenant-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: tenant-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h tenant-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/tenant-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "tenant"]
|
||||
env:
|
||||
- name: TENANT_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: TENANT_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
@@ -0,0 +1,55 @@
|
||||
# Enhanced migration job for training service with automatic table creation
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: training-migration
|
||||
namespace: bakery-ia
|
||||
labels:
|
||||
app.kubernetes.io/name: training-migration
|
||||
app.kubernetes.io/component: migration
|
||||
app.kubernetes.io/part-of: bakery-ia
|
||||
spec:
|
||||
backoffLimit: 3
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: training-migration
|
||||
app.kubernetes.io/component: migration
|
||||
spec:
|
||||
initContainers:
|
||||
- name: wait-for-db
|
||||
image: postgres:15-alpine
|
||||
command: ["sh", "-c", "until pg_isready -h training-db-service -p 5432; do sleep 2; done"]
|
||||
resources:
|
||||
requests:
|
||||
memory: "64Mi"
|
||||
cpu: "50m"
|
||||
limits:
|
||||
memory: "128Mi"
|
||||
cpu: "100m"
|
||||
containers:
|
||||
- name: migrate
|
||||
image: bakery/training-service:dev
|
||||
command: ["python", "/app/scripts/run_migrations.py", "training"]
|
||||
env:
|
||||
- name: TRAINING_DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: database-secrets
|
||||
key: TRAINING_DATABASE_URL
|
||||
- name: DB_FORCE_RECREATE
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: bakery-config
|
||||
key: DB_FORCE_RECREATE
|
||||
optional: true
|
||||
- name: LOG_LEVEL
|
||||
value: "INFO"
|
||||
resources:
|
||||
requests:
|
||||
memory: "256Mi"
|
||||
cpu: "100m"
|
||||
limits:
|
||||
memory: "512Mi"
|
||||
cpu: "500m"
|
||||
restartPolicy: OnFailure
|
||||
Reference in New Issue
Block a user