postgres의 공유메모리가 부족해서 오류가 발생하면 아래와 같이 shm-size를 늘려주면 됩니다.
docker 샘플
docker run --name my_postgres \
--shm-size=1g \
-e POSTGRES_PASSWORD=mysecretpassword \
-d postgres
kubernetes 샘플
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:latest
resources:
requests:
memory: "2Gi"
cpu: "1"
limits:
memory: "4Gi"
cpu: "2"
volumeMounts:
- mountPath: /dev/shm
name: dshm
env:
- name: POSTGRES_PASSWORD
value: "yourpassword"
volumes:
- name: dshm
emptyDir:
medium: Memory
sizeLimit: 1Gi
728x90
댓글