Skip to content

Commit

Permalink
Add docker resource limits (#433)
Browse files Browse the repository at this point in the history
* Return removed staging CA for letsenrypt

* Fix missing $

* Remove PAYMENTS_AUTORECHARGE_DEFAULT_MIN_BALANCE

* Intro docker limits to monitoring, traefik, portainer and regsitry stacks

* ANE fixes
  • Loading branch information
YuryHrytsuk authored Nov 14, 2023
1 parent 7964814 commit a3f0110
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
34 changes: 31 additions & 3 deletions services/monitoring/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ services:
resources:
limits:
memory: 4096M
cpus: "2"
reservations:
memory: 4096M
memory: 2048M
cpus: "0.2"

prometheuscadvisor:
hostname: "{% raw %}{{.Service.Name}}{% endraw %}"
Expand Down Expand Up @@ -124,8 +126,10 @@ services:
resources:
limits:
memory: 4096M
cpus: "1"
reservations:
memory: 2048M
cpus: "0.2"

node-exporter:
image: prom/node-exporter:v1.6.1
Expand Down Expand Up @@ -161,8 +165,10 @@ services:
resources:
limits:
memory: 128M
cpus: "0.5"
reservations:
memory: 64M
cpus: "0.1"

nvidia-exporter:
image: mindprince/nvidia_gpu_prometheus_exporter:0.1
Expand All @@ -180,8 +186,10 @@ services:
resources:
limits:
memory: 64M
cpus: "0.5"
reservations:
memory: 32M
cpus: "0.1"

alertmanager:
image: prom/alertmanager:v0.25.0
Expand All @@ -202,8 +210,10 @@ services:
resources:
limits:
memory: 32M
cpus: "0.5"
reservations:
memory: 16M
cpus: "0.1"

cadvisor-exporter:
image: gcr.io/cadvisor/cadvisor:v0.47.2
Expand All @@ -224,8 +234,10 @@ services:
resources:
limits:
memory: 256M
cpus: "0.5"
reservations:
memory: 128M
cpus: "0.1"

docker-events-exporter:
image: itisfoundation/docker-events-exporter:latest
Expand All @@ -243,8 +255,10 @@ services:
resources:
limits:
memory: 64M
cpus: "0.5"
reservations:
memory: 32M
cpus: "0.1"

grafana:
image: grafana/grafana-oss:10.0.3
Expand Down Expand Up @@ -274,8 +288,10 @@ services:
resources:
limits:
memory: 256M
cpus: "1.0"
reservations:
memory: 128M
cpus: "0.1"

grafana-image-renderer:
image: grafana/grafana-image-renderer:3.7.1
Expand All @@ -288,8 +304,10 @@ services:
resources:
limits:
memory: 512M
cpus: "2.0"
reservations:
memory: 64M
cpus: "0.1"

smokeping-prober-exporter:
image: quay.io/superq/smokeping-prober:v0.7.1
Expand All @@ -313,8 +331,10 @@ services:
resources:
limits:
memory: 128M
cpus: "0.5"
reservations:
memory: 32M
cpus: "0.1"

dcgm-exporter:
cap_add:
Expand All @@ -332,8 +352,10 @@ services:
resources:
limits:
memory: 512M
cpus: "0.5"
reservations:
memory: 256M
cpus: "0.1"
labels:
- prometheus-job=dcgm-exporter
- prometheus-port=9400
Expand All @@ -358,8 +380,10 @@ services:
resources:
limits:
memory: 128M
cpus: "0.5"
reservations:
memory: 64M{% for _stack in MONITORED_STACK_NAMES.split(",") if _stack != "" %}
memory: 64M
cpus: "0.1"{% for _stack in MONITORED_STACK_NAMES.split(",") if _stack != "" %}
{{_stack}}-postgres-exporter:
image: bitnami/postgres-exporter:0.13.2
networks:
Expand All @@ -374,8 +398,10 @@ services:
resources:
limits:
memory: 128M
cpus: "0.5"
reservations:
memory: 32M
cpus: "0.1"
{{_stack}}-redis-exporter:
image: oliver006/redis_exporter:v1.52.0-alpine
networks:
Expand All @@ -391,5 +417,7 @@ services:
resources:
limits:
memory: 64M
cpus: "0.5"
reservations:
memory: 32M{% endfor %}
memory: 32M
cpus: "0.1"{% endfor %}
14 changes: 14 additions & 0 deletions services/portainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@ services:
- agent_network
deploy:
mode: global
resources:
limits:
cpus: "1"
memory: 100M
reservations:
cpus: "0.5"
memory: 50M

portainer:
image: portainer/portainer-ce:2.18.4
Expand All @@ -35,6 +42,13 @@ services:
deploy:
mode: replicated
replicas: 1
resources:
limits:
cpus: "2"
memory: 250M
reservations:
cpus: "0.5"
memory: 80M
placement:
constraints: [node.role == manager]
labels:
Expand Down
7 changes: 7 additions & 0 deletions services/registry/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,13 @@ services:
- public
- monitored
deploy:
resources:
limits:
memory: 1G
cpus: '2'
reservations:
memory: 150M
cpus: '0.5'
labels:
- traefik.enable=true
- traefik.docker.network=${PUBLIC_NETWORK}
Expand Down
2 changes: 2 additions & 0 deletions services/traefik/docker-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,10 @@ services:
resources:
limits:
memory: 50M
cpus: '0.5'
reservations:
memory: 6M
cpus: '0.1'
networks:
- public
Expand Down

0 comments on commit a3f0110

Please sign in to comment.