dodane liveness i readiness probe
This commit is contained in:
@@ -20,18 +20,34 @@ spec:
|
||||
image: git.fpmoz.sum.ba/sz11zs/moj-servis:1.0
|
||||
ports:
|
||||
- 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:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 10 # čekaj 10s nakon starta
|
||||
periodSeconds: 15 # provjeri svakih 15s
|
||||
timeoutSeconds: 3 # timeout odgovora
|
||||
failureThreshold: 3 # 3 fail-a => restart
|
||||
|
||||
# ── Readiness: prima li promet? ─────────────────
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 15
|
||||
timeoutSeconds: 3
|
||||
failureThreshold: 3
|
||||
|
||||
# 3. READINESS PROBE: Dodano za Korak 1.4
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
@@ -39,8 +55,4 @@ spec:
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 2
|
||||
failureThreshold: 2
|
||||
|
||||
resources:
|
||||
requests: { memory: "64Mi", cpu: "50m" }
|
||||
limits: { memory: "128Mi", cpu: "200m" }
|
||||
failureThreshold: 2
|
||||
Reference in New Issue
Block a user