lower cpu limits
This commit is contained in:
@@ -2,29 +2,26 @@ apiVersion: apps/v1
|
|||||||
kind: Deployment
|
kind: Deployment
|
||||||
|
|
||||||
metadata:
|
metadata:
|
||||||
name: fastapi-api
|
name: postgres
|
||||||
namespace: student-antoniomaric1
|
namespace: student-antoniomaric1
|
||||||
|
|
||||||
annotations:
|
|
||||||
argocd.argoproj.io/sync-wave: "1"
|
|
||||||
|
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: fastapi-api
|
app: postgres
|
||||||
|
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: fastapi-api
|
app: postgres
|
||||||
|
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: fastapi-api
|
- name: postgres
|
||||||
|
|
||||||
image: vasic/fastapi-todo-api:1.0
|
image: postgres:16-alpine
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
@@ -35,37 +32,28 @@ spec:
|
|||||||
memory: "128Mi"
|
memory: "128Mi"
|
||||||
|
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8000
|
- containerPort: 5432
|
||||||
|
|
||||||
env:
|
envFrom:
|
||||||
- name: DATABASE_HOST
|
- secretRef:
|
||||||
value: postgres-service
|
name: postgres-secret
|
||||||
|
|
||||||
- name: DATABASE_PORT
|
volumeMounts:
|
||||||
value: "5432"
|
- name: postgres-data
|
||||||
|
mountPath: /var/lib/postgresql/data
|
||||||
- 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:
|
readinessProbe:
|
||||||
httpGet:
|
exec:
|
||||||
path: /health
|
command:
|
||||||
port: 8000
|
- pg_isready
|
||||||
|
- -U
|
||||||
|
- fastapiuser
|
||||||
|
- -d
|
||||||
|
- fastapidb
|
||||||
|
|
||||||
initialDelaySeconds: 15
|
initialDelaySeconds: 10
|
||||||
periodSeconds: 5
|
|
||||||
|
volumes:
|
||||||
|
- name: postgres-data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: postgres-pvc
|
||||||
Reference in New Issue
Block a user