dodane liveness i readiness probe
This commit is contained in:
@@ -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" }
|
|
||||||
Reference in New Issue
Block a user