feat: dodaj Kubernetes manifeste za FastAPI + Postgres
This commit is contained in:
54
manifests/app/deployment.yaml
Normal file
54
manifests/app/deployment.yaml
Normal file
@@ -0,0 +1,54 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: fastapi-api
|
||||
namespace: student-ivanivso7
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-wave: "1"
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: fastapi-api
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: fastapi-api
|
||||
spec:
|
||||
containers:
|
||||
- name: fastapi-api
|
||||
image: vasic/fastapi-todo-api:1.0
|
||||
ports:
|
||||
- containerPort: 8000
|
||||
env:
|
||||
- name: DATABASE_HOST
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fastapi-config
|
||||
key: DATABASE_HOST
|
||||
- name: DATABASE_PORT
|
||||
valueFrom:
|
||||
configMapKeyRef:
|
||||
name: fastapi-config
|
||||
key: DATABASE_PORT
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-secret
|
||||
key: POSTGRES_USER
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-secret
|
||||
key: POSTGRES_PASSWORD
|
||||
- name: POSTGRES_DB
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: postgres-secret
|
||||
key: POSTGRES_DB
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /health
|
||||
port: 8000
|
||||
initialDelaySeconds: 15
|
||||
periodSeconds: 5
|
||||
Reference in New Issue
Block a user