8000 Fix cadvisor unable to report oomkill events by michaellzc · Pull Request #804 · sourcegraph/deploy-sourcegraph-docker · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
8000
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'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all flags are documented here https://github.com/google/cadvisor/blob/master/README.md#quick-start-running-cadvisor-in-a-docker-container

these two flags were not in the readme when MI was invented in the first place (I think) and that's how we missed them

google/cadvisor#2150
google/cadvisor#2545

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