Skip to content

Commit

Permalink
Fix cadvisor unable to report oomkill events (#804)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaellzc authored Apr 26, 2022
1 parent 1bced27 commit 4cc1408
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docker-compose/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,12 @@ services:
image: 'index.docker.io/sourcegraph/cadvisor:insiders@sha256:3544dba5cd99c429ac62f4773454c8406abe126ba340f34e457b38d828c63395'
cpus: 1
mem_limit: '1g'
# You may set `privileged` to `false and `cadvisor` will run with reduced privileges.
# `cadvisor` requires root privileges in order to display provisioning metrics.
# These metrics provide critical information to help you scale the Sourcegraph deployment.
# If you would like to bring your own infrastructure monitoring & alerting solution,
# you may want to remove the `cadvisor` container completely
privileged: true
volumes:
- '/:/rootfs:ro'
- '/var/run:/var/run:ro'
Expand All @@ -499,6 +505,8 @@ services:
- '/dev/disk/:/dev/disk:ro'
# Uncomment to enable container monitoring on MacOS
# - '/var/run/docker.sock:/var/run/docker.sock:ro'
devices:
- '/dev/kmsg'
networks:
- sourcegraph
restart: always
Expand Down
7 changes: 7 additions & 0 deletions pure-docker/deploy-cadvisor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ sudo docker run --detach \
--volume=/sys:/sys:ro \
--volume=/var/lib/docker/:/var/lib/docker:ro \
--volume=/dev/disk/:/dev/disk:ro \
# You may set `privileged` to `false and `cadvisor` will run with reduced privileges.
# `cadvisor` requires root privileges in order to display provisioning metrics.
# These metrics provide critical information to help you scale the Sourcegraph deployment.
# If you would like to bring your own infrastructure monitoring & alerting solution,
# you may want to remove the `cadvisor` container completely
--privileged \
--device=/dev/kmsg \
index.docker.io/sourcegraph/cadvisor:3.36.3@sha256:249c573262967979889a186344ba5cc4e8e9186ec4f26c759ce9f8527560da69 \
--port=8080

Expand Down

0 comments on commit 4cc1408

Please sign in to comment.