zkt26/z2/deployment.yaml
2026-04-29 10:01:04 +02:00

81 lines
2.8 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# ─────────────────────────────────────────────────────────────────────────────
# 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