Add liveness and readiness probes
This commit is contained in:
@@ -1,41 +1,33 @@
|
|||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: moj-servis
|
|
||||||
namespace: student-martabulic
|
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: moj-servis
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: moj-servis
|
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: moj-servis
|
- name: moj-servis
|
||||||
image: git.fpmoz.sum.ba/martabulic/moj-servis:1.0
|
image: git.fpmoz.sum.ba/MartaBulic/moj-servis:1.0
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 8000
|
||||||
envFrom: # <-- NOVO
|
|
||||||
- configMapRef:
|
# ── Liveness: je li proces živ? ─────────────────
|
||||||
name: moj-servis-config # <-- ConfigMap
|
livenessProbe:
|
||||||
env: # <-- NOVO
|
httpGet:
|
||||||
- name: DB_PASSWORD
|
path: /health
|
||||||
valueFrom:
|
port: 8000
|
||||||
secretKeyRef:
|
initialDelaySeconds: 10 # čekaj 10s nakon starta
|
||||||
name: moj-servis-secret # <-- Secret
|
periodSeconds: 15 # provjeri svakih 15s
|
||||||
key: DB_PASSWORD
|
timeoutSeconds: 3 # timeout odgovora
|
||||||
- name: API_KEY
|
failureThreshold: 3 # 3 fail-a => restart
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
# ── Readiness: prima li promet? ─────────────────
|
||||||
name: moj-servis-secret
|
readinessProbe:
|
||||||
key: API_KEY
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: 8000
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 2
|
||||||
|
failureThreshold: 2
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests: { memory: "64Mi", cpu: "50m" }
|
||||||
memory: "64Mi"
|
limits: { memory: "128Mi", cpu: "200m" }
|
||||||
cpu: "50m"
|
##
|
||||||
limits:
|
|
||||||
memory: "128Mi"
|
|
||||||
cpu: "200m"
|
|
||||||
Reference in New Issue
Block a user