Skip to content
21 changes: 19 additions & 2 deletions infra/k8s/api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,32 @@ metadata:
name: api
namespace: proseed
spec:
replicas: 1
selector:
replicas: 1 #replicas 2개 이상부터는 initContainer의 마이그레이션 중복 위험 있음
selector: #TODO: 마이그레이션 방식 initContainer -> workflow 대체
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
initContainers:
- name: prisma-migrate
image: ghcr.io/skkuding/proseed/api:latest
# TODO: Dockerfile node_modules/.bin/prisma 포함되면 아래로 교체
# command: ['node_modules/.bin/prisma', 'migrate', 'deploy', '--schema', 'apps/api/prisma/schema.prisma']
command:
[
'npx',
'prisma@6.19.2',
'migrate',
'deploy',
'--schema',
'apps/api/prisma/schema.prisma',
]
envFrom:
- secretRef:
name: database-credentials
containers:
- name: api
image: ghcr.io/skkuding/proseed/api:latest
Expand Down
1 change: 1 addition & 0 deletions infra/k8s/postgres/db-credentials.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ spec:
namespace: proseed-postgres
annotations:
reflector.v1.k8s.emberstack.com/reflection-allowed: 'true'
reflector.v1.k8s.emberstack.com/reflection-auto-enabled: 'true'
reflector.v1.k8s.emberstack.com/reflection-allowed-namespaces: 'proseed'
type: Opaque
4 changes: 2 additions & 2 deletions infra/k8s/postgres/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ spec:
- containerPort: 5432
readinessProbe:
exec:
command: ['pg_isready', '-U', '$(POSTGRES_USER)']
command: ['sh', '-c', 'pg_isready -U $POSTGRES_USER']
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
exec:
command: ['pg_isready', '-U', '$(POSTGRES_USER)']
command: ['sh', '-c', 'pg_isready -U $POSTGRES_USER']
initialDelaySeconds: 15
periodSeconds: 20
env:
Expand Down
Loading