diff --git a/infrastructure/kubernetes/base/components/training/training-service.yaml b/infrastructure/kubernetes/base/components/training/training-service.yaml index a0ee2838..1e1fbe45 100644 --- a/infrastructure/kubernetes/base/components/training/training-service.yaml +++ b/infrastructure/kubernetes/base/components/training/training-service.yaml @@ -111,29 +111,43 @@ spec: configMapKeyRef: name: bakery-config key: GATEWAY_URL + - name: TRAINING_PERSISTENCE_PATH + value: "/app/training_state" + volumeMounts: + - name: training-state + mountPath: /app/training_state + - name: tmp-storage + mountPath: /tmp resources: requests: - memory: "256Mi" - cpu: "100m" - limits: memory: "512Mi" - cpu: "500m" + cpu: "200m" + limits: + memory: "4Gi" + cpu: "2000m" livenessProbe: httpGet: path: /health port: 8000 - initialDelaySeconds: 30 - timeoutSeconds: 5 - periodSeconds: 10 - failureThreshold: 3 + initialDelaySeconds: 60 + timeoutSeconds: 30 + periodSeconds: 30 + failureThreshold: 5 readinessProbe: httpGet: path: /health port: 8000 - initialDelaySeconds: 5 - timeoutSeconds: 1 - periodSeconds: 5 + initialDelaySeconds: 15 + timeoutSeconds: 10 + periodSeconds: 15 failureThreshold: 3 + volumes: + - name: training-state + persistentVolumeClaim: + claimName: training-state-pvc + - name: tmp-storage + emptyDir: + sizeLimit: 2Gi --- apiVersion: v1 @@ -153,4 +167,21 @@ spec: name: http selector: app.kubernetes.io/name: training-service - app.kubernetes.io/component: microservice \ No newline at end of file + app.kubernetes.io/component: microservice + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: training-state-pvc + namespace: bakery-ia + labels: + app.kubernetes.io/name: training-service + app.kubernetes.io/component: storage +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + storageClassName: standard \ No newline at end of file