diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 1c28129..96129d1 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -20,6 +20,36 @@ spec: image: git.fpmoz.sum.ba/sz11zs/hello-cicd:latest ports: - containerPort: 8000 + + # 1. POVEZIVANJE S CONFIGMAP I SECRET (iz prethodnog koraka) env: - name: APP_VERSION - value: "latest" \ No newline at end of file + valueFrom: + configMapKeyRef: + name: hello-cicd-config + key: APP_VERSION + - name: DB_PASSWORD + valueFrom: + secretKeyRef: + name: hello-cicd-secret + key: password + + # 2. LIVENESS PROBE (je li proces živ?) + livenessProbe: + httpGet: + path: /health + port: 8000 + initialDelaySeconds: 10 # čekaj 10s nakon starta + periodSeconds: 15 # provjeri svakih 15s[cite: 1] + timeoutSeconds: 3 # timeout odgovora[cite: 1] + failureThreshold: 3 # 3 fail-a => restart[cite: 1] + + # 3. READINESS PROBE (prima li promet?)[cite: 1] + readinessProbe: + httpGet: + path: /health + port: 8000 + initialDelaySeconds: 5 + periodSeconds: 10 + timeoutSeconds: 2 + failureThreshold: 2 \ No newline at end of file