diff --git a/deploy/kubernetes/deployment/database-deployment.yaml b/deploy/kubernetes/deployment/database-deployment.yaml index 5acd3dab..ccc21d04 100644 --- a/deploy/kubernetes/deployment/database-deployment.yaml +++ b/deploy/kubernetes/deployment/database-deployment.yaml @@ -31,7 +31,11 @@ spec: - pg_isready periodSeconds: 90 name: database - resources: {} + resources: + limits: + memory: "52428800" + requests: + memory: "31457280" ports: - containerPort: 5432 protocol: TCP diff --git a/deploy/kubernetes/deployment/memcached-deployment.yaml b/deploy/kubernetes/deployment/memcached-deployment.yaml index 7a54211f..bde63623 100644 --- a/deploy/kubernetes/deployment/memcached-deployment.yaml +++ b/deploy/kubernetes/deployment/memcached-deployment.yaml @@ -25,6 +25,10 @@ spec: ports: - containerPort: 11211 protocol: TCP - resources: {} + resources: + limits: + memory: "314572800" + requests: + memory: "104857600" restartPolicy: Always status: {} diff --git a/deploy/kubernetes/deployment/nginx-deployment.yaml b/deploy/kubernetes/deployment/nginx-deployment.yaml index 1ae69cb1..07cad9f2 100644 --- a/deploy/kubernetes/deployment/nginx-deployment.yaml +++ b/deploy/kubernetes/deployment/nginx-deployment.yaml @@ -36,7 +36,11 @@ spec: ports: - containerPort: 80 protocol: TCP - resources: {} + resources: + limits: + memory: "52428800" + requests: + memory: "31457280" volumeMounts: - mountPath: /opt/services/dbase/media name: media-volume diff --git a/deploy/kubernetes/deployment/web-deployment.yaml b/deploy/kubernetes/deployment/web-deployment.yaml index e3302429..31b17a3c 100644 --- a/deploy/kubernetes/deployment/web-deployment.yaml +++ b/deploy/kubernetes/deployment/web-deployment.yaml @@ -48,7 +48,11 @@ spec: ports: - containerPort: 8000 protocol: TCP - resources: {} + resources: + limits: + memory: "524288e3" + requests: + memory: "262144e3" volumeMounts: - mountPath: /app/media name: media-volume diff --git a/docker-compose.yml b/docker-compose.yml index d6e24fba..dadd287b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.1" +version: "3.8" volumes: postgresql-data: @@ -26,6 +26,12 @@ services: - web networks: - backend-network + deploy: + resources: + limits: + memory: 50M + reservations: + memory: 30MB database: image: postgres:15.2 volumes: @@ -41,6 +47,12 @@ services: interval: 1m30s expose: - 5432 + deploy: + resources: + limits: + memory: 50M + reservations: + memory: 30MB web: build: context: . @@ -63,12 +75,24 @@ services: - media-data:/app/media networks: - backend-network + deploy: + resources: + limits: + memory: 500M + reservations: + memory: 250M memcached: image: memcached:1.6 expose: - 11211 networks: - backend-network + deploy: + resources: + limits: + memory: 300M + reservations: + memory: 100M networks: backend-network: