55 lines
1.4 KiB
YAML
55 lines
1.4 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: hello-cicd
|
|
namespace: student-sz11zs
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: hello-cicd
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: hello-cicd
|
|
spec:
|
|
imagePullSecrets:
|
|
- name: gitea-creds
|
|
containers:
|
|
- name: hello-cicd
|
|
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
|
|
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 |