add alembic and store metrics at db
This commit is contained in:
33
k8s/app.yaml
33
k8s/app.yaml
@@ -18,7 +18,38 @@ spec:
|
||||
ports:
|
||||
- name: web
|
||||
containerPort: 8000
|
||||
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ["alembic", "check"]
|
||||
timeoutSeconds: 5
|
||||
periodSeconds: 5
|
||||
env:
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-secrets
|
||||
key: url
|
||||
---
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: fastapi-app-db-migration
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: fastapi-app-db-migration
|
||||
image: igit.danilkolesnikov.ru/danil/playground_app
|
||||
command: ["alembic", "upgrade", "head"]
|
||||
env:
|
||||
- name: DATABASE_URL
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: db-secrets
|
||||
key: url
|
||||
restartPolicy: OnFailure
|
||||
backoffLimit: 5
|
||||
ttlSecondsAfterFinished: 1
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
|
||||
Reference in New Issue
Block a user