diff --git a/workloads/ecommerce/commerce/medusa.yaml b/workloads/ecommerce/commerce/medusa.yaml index 13db624..36e462f 100644 --- a/workloads/ecommerce/commerce/medusa.yaml +++ b/workloads/ecommerce/commerce/medusa.yaml @@ -21,6 +21,28 @@ spec: - name: gitea-registry-secret initContainers: + - name: wait-for-postgres + image: postgres:17-alpine + imagePullPolicy: IfNotPresent + command: + - sh + - -c + - | + until pg_isready -d "$DATABASE_URL" -t 5; do + echo "postgres no disponible aun, reintentando..." + sleep 2 + done + envFrom: + - secretRef: + name: commerce-secrets + resources: + requests: + cpu: 25m + memory: 32Mi + limits: + cpu: 100m + memory: 64Mi + - name: migrations image: gitea.cruzcloud.net/devops/ecommerce-medusa:v1.0.85 imagePullPolicy: IfNotPresent