dodane liveness i readiness probe
Some checks failed
CI/CD Pipeline / build (push) Successful in 1m54s
CI/CD Pipeline / deploy (push) Failing after 51s

This commit is contained in:
2026-05-02 18:12:22 +02:00
parent a65200c95d
commit 2cc0834785

View File

@@ -21,17 +21,33 @@ spec:
ports: ports:
- containerPort: 8000 - containerPort: 8000
# ── Liveness: je li proces živ? ───────────────── # 1. POVEZIVANJE S OKOLINSKIM VARIJABLAMA (Secret i ConfigMap)
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: moj-servis-secret
key: DB_PASSWORD
- name: API_KEY
valueFrom:
secretKeyRef:
name: moj-servis-secret
key: API_KEY
envFrom:
- configMapRef:
name: moj-servis-config
# 2. LIVENESS PROBE: Dodano za Korak 1.4
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /health path: /health
port: 8000 port: 8000
initialDelaySeconds: 10 # čekaj 10s nakon starta initialDelaySeconds: 10
periodSeconds: 15 # provjeri svakih 15s periodSeconds: 15
timeoutSeconds: 3 # timeout odgovora timeoutSeconds: 3
failureThreshold: 3 # 3 fail-a => restart failureThreshold: 3
# ── Readiness: prima li promet? ───────────────── # 3. READINESS PROBE: Dodano za Korak 1.4
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /health path: /health
@@ -40,7 +56,3 @@ spec:
periodSeconds: 10 periodSeconds: 10
timeoutSeconds: 2 timeoutSeconds: 2
failureThreshold: 2 failureThreshold: 2
resources:
requests: { memory: "64Mi", cpu: "50m" }
limits: { memory: "128Mi", cpu: "200m" }