92 lines
3.2 KiB
YAML
92 lines
3.2 KiB
YAML
# ─────────────────────────────────────────────────────────────────────────────
|
||
# 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
|
||
### part bellow recommanded by ia for health check
|
||
readinessProbe:
|
||
httpGet:
|
||
path: /
|
||
port: 80
|
||
initialDelaySeconds: 5
|
||
periodSeconds: 10
|
||
livenessProbe:
|
||
httpGet:
|
||
path: /
|
||
port: 80
|
||
initialDelaySeconds: 10
|
||
periodSeconds: 15
|
||
resources:
|
||
requests:
|
||
cpu: "50m"
|
||
memory: "64Mi"
|
||
limits:
|
||
cpu: "200m"
|
||
memory: "128Mi"
|
||
|
||
---
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
# Service – Backend ClusterIP (internal access only)
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
apiVersion: v1
|
||
kind: Service
|
||
metadata:
|
||
name: vigimeteo-backend-service
|
||
namespace: vigimeteo
|
||
labels:
|
||
app: vigimeteo-backend
|
||
spec:
|
||
type: NodePort
|
||
selector:
|
||
app: vigimeteo-backend
|
||
ports:
|
||
- name: http
|
||
protocol: TCP
|
||
port: 8888
|
||
targetPort: 8888
|
||
nodePort: 30888
|
||
|
||
---
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
# Service – Frontend NodePort (external access via <nodeIP>:30500)
|
||
# ─────────────────────────────────────────────────────────────────────────────
|
||
apiVersion: v1
|
||
kind: Service
|
||
metadata:
|
||
name: vigimeteo-frontend-service
|
||
namespace: vigimeteo
|
||
labels:
|
||
app: vigimeteo-frontend
|
||
spec:
|
||
type: NodePort
|
||
selector:
|
||
app: vigimeteo-frontend
|
||
ports:
|
||
- name: http
|
||
protocol: TCP
|
||
port: 80
|
||
targetPort: 80
|
||
nodePort: 30500
|