feat: podpora high-availability a multi-replica nasazení
CI / Generate TypeScript types (push) Successful in 10s
CI / Server unit tests (push) Successful in 20s
CI / Build server (push) Successful in 26s
CI / Build client (push) Successful in 35s
CI / Playwright E2E tests (push) Failing after 1m56s
CI / Build and push Docker image (push) Has been skipped
CI / Notify (push) Successful in 1s

- Socket.io Redis adapter pro sdílený stav přes repliky
- graceful shutdown serveru
- WATCH/MULTI v updateData pro race-condition-safe aktualizace
- lease mechanismus pro push reminder (zabrání duplicitnímu odesílání)
- k8s/ manifesty pro testovací kind cluster
- Dockerfile: opraven EXPOSE port na 3001
- .gitignore: ignorovány Claude pracovní soubory
This commit is contained in:
2026-05-20 17:01:33 +02:00
parent a26d6cf85c
commit 67abbf19b5
32 changed files with 1265 additions and 552 deletions
+85
View File
@@ -0,0 +1,85 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: luncher
namespace: luncher
spec:
replicas: 3
selector:
matchLabels:
app: luncher
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 0 # nelze přidat extra pod — každý worker je obsazen
maxUnavailable: 1 # nejdřív smaž starý pod, pak naplánuj nový
template:
metadata:
labels:
app: luncher
annotations:
reloader.stakater.com/auto: "true"
spec:
terminationGracePeriodSeconds: 30
# Rozmístit každý pod na jiný worker uzel
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchLabels:
app: luncher
topologyKey: kubernetes.io/hostname
containers:
- name: luncher
image: luncher:ha-test
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3001
envFrom:
- configMapRef:
name: luncher-config
- secretRef:
name: luncher-secrets
env:
# POD_ID pro leader election scheduleru připomínek
- name: POD_ID
valueFrom:
fieldRef:
fieldPath: metadata.name
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
cpu: 500m
memory: 512Mi
# Liveness — levná kontrola bez externích závislostí
livenessProbe:
httpGet:
path: /api/health
port: 3001
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
# Readiness — kontroluje Redis; při shutdown vrací 503
readinessProbe:
httpGet:
path: /api/health/ready
port: 3001
initialDelaySeconds: 10
periodSeconds: 5
failureThreshold: 2
# preStop sleep: dá čas kube-proxy a Traefiku odebrat endpoint
# dřív než kontejner začne odmítat nová spojení
lifecycle:
preStop:
exec:
command: ["sleep", "5"]