-
Notifications
You must be signed in to change notification settings - Fork 23
fix: cadvisor can pickup oom events #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
7dbaeed to
7a9386c
Compare
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
7a9386c to
ca565f2
Compare
| {{- if .Values.cadvisor.containerSecurityContext.privileged }} | ||
| - name: kmsg | ||
| mountPath: /dev/kmsg | ||
| readOnly: true | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I am overcomplicating things.
without privileged and we mount the /dev/kmsg, users would see the below logs from cadvisor.
k logs daemonset/cadvisor 14:05:31
Found 2 pods, using pod/cadvisor-qkdlk
W0505 21:05:23.014872 1 machine_libipmctl.go:63] There are no NVM devices!
W0505 21:05:23.068489 1 manager.go:296] Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: operation not permitted
If we don't mount /dev/kmsg, users will always see something like
Could not configure a source for OOM detection, disabling OOM events: open /dev/kmsg: no such file or directory
either one of them is not ideal, so I figure we should just don't mount unnecessary stuff when it has no used (privielged=false)
| {{- if .Values.cadvisor.containerSecurityContext.privileged }} | ||
| - name: kmsg | ||
| hostPath: | ||
| path: /dev/kmsg | ||
| {{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no docker's --device equivalent in Kubernetes, so we have to mount it as a regular volume.
aa07085 to
80903f6
Compare
80903f6 to
7773c31
Compare
Co-authored-by: Crystal Augustus <91073224+caugustus-sourcegraph@users.noreply.github.com>

Follow up sourcegraph/deploy-sourcegraph-docker#804
Checklist
Test plan
tested on a live gke cluster
deploy sourcegraph as usual
deploy a stress test pod
apiVersion: v1 kind: Pod metadata: name: stress namespace: sourcegraph spec: containers: - name: stress image: progrium/stress command: - sleep - infinity resources: requests: memory: 100Mi limits: memory: 128Miexec into the pod and run
oom events show up as expected