66 lines
1.7 KiB
YAML
66 lines
1.7 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: fastapi-api
|
|
namespace: student-blazp04
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: fastapi-api
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: fastapi-api
|
|
spec:
|
|
containers:
|
|
- name: fastapi-api
|
|
image: git.fpmoz.sum.ba/dvasic/fastapi-todo-api:1.0
|
|
ports:
|
|
- containerPort: 8000
|
|
resources:
|
|
requests:
|
|
cpu: 30m
|
|
memory: 64Mi
|
|
limits:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
env:
|
|
- name: POSTGRES_HOST
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: app-config
|
|
key: POSTGRES_HOST
|
|
- name: POSTGRES_PORT
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: app-config
|
|
key: POSTGRES_PORT
|
|
- name: POSTGRES_DB
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: app-config
|
|
key: POSTGRES_DB
|
|
- name: POSTGRES_USER
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: postgres-secret
|
|
key: POSTGRES_USER
|
|
- name: POSTGRES_PASSWORD
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: postgres-secret
|
|
key: POSTGRES_PASSWORD
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8000
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /health
|
|
port: 8000
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 20
|