# ───────────────────────────────────────────────────────────────────────────── # Deployment – Vert.x Backend (2 replicas) # ───────────────────────────────────────────────────────────────────────────── apiVersion: apps/v1 kind: Deployment metadata: name: vigimeteo-backend namespace: vigimeteo labels: app: vigimeteo-backend spec: replicas: 2 selector: matchLabels: app: vigimeteo-backend template: metadata: labels: app: vigimeteo-backend spec: initContainers: # Wait until PostgreSQL is ready before starting the backend - name: wait-for-db image: busybox:1.36 command: - sh - -c - | until nc -z vigimeteo-db.vigimeteo.svc.cluster.local 5432; do echo "Waiting for PostgreSQL..."; sleep 3; done; echo "PostgreSQL is ready." containers: - name: vigimeteo-backend image: vigimeteo-backend:latest imagePullPolicy: IfNotPresent ports: - containerPort: 8888 name: http env: - name: DB_HOST value: "vigimeteo-db.vigimeteo.svc.cluster.local" - name: DB_PORT value: "5432" - name: DB_NAME value: "postgres" - name: DB_USER value: "postgres" - name: DB_PASSWORD value: "admin" --- # ───────────────────────────────────────────────────────────────────────────── # Deployment – React/Nginx Frontend (2 replicas) # ───────────────────────────────────────────────────────────────────────────── apiVersion: apps/v1 kind: Deployment metadata: name: vigimeteo-frontend namespace: vigimeteo labels: app: vigimeteo-frontend spec: replicas: 2 selector: matchLabels: app: vigimeteo-frontend template: metadata: labels: app: vigimeteo-frontend spec: containers: - name: vigimeteo-frontend image: vigimeteo-frontend:latest imagePullPolicy: IfNotPresent ports: - containerPort: 80 name: http