-
Notifications
You must be signed in to change notification settings - Fork 94
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
feat: cgroups host collector #1581
Conversation
Linux control groups host collector that detects whether the specified mountPath is a cgroup filesystem and what version it is. The collector also collects information of the configured cgroup controllers. Signed-off-by: Evans Mungai <evans@replicated.com>
Signed-off-by: Evans Mungai <evans@replicated.com>
replicatedhq/troubleshoot.sh#566 is the docs PR |
Signed-off-by: Evans Mungai <evans@replicated.com>
This list makes it easy for an analyser that would like to check if a controller is present Signed-off-by: Evans Mungai <evans@replicated.com>
Signed-off-by: Evans Mungai <evans@replicated.com>
// Get the available controllers from /proc/cgroups. | ||
// See https://www.man7.org/linux/man-pages/man7/cgroups.7.html#NOTES | ||
|
||
f, err := os.Open("/proc/cgroups") |
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.
Should this should be set to mountPoint
instead of being hardcoded?
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.
For cgroup v1, information about controllers is always stored in /proc/cgroups
file. This is different from the cgroup mount points.
From https://www.man7.org/linux/man-pages/man7/cgroups.7.html#NOTES
/proc files
/proc/cgroups (since Linux 2.6.24)
This file contains information about the controllers that
are compiled into the kernel. An example of the contents
of this file (reformatted for readability) is the
Signed-off-by: Evans Mungai <evans@replicated.com>
Signed-off-by: Evans Mungai <evans@replicated.com>
Description, Motivation and Context
Linux control groups host collector that detects whether the specified
mountPoint
is a cgroup filesystem and what version it is. The collector also collects information of the configured cgroup controllers. Since the output is a JSON object, the JSON compare analyser can be utilised. (#1582 PR is WIP to allow host collectors to use this analyzer)Collector spec
cgroup v1 results
cgroup v2 results
cgroup v1 configuration
https://asciinema.org/a/v93LLPLKxgLjUXiLWRNi0SEpp
cgroup v2 configuration
https://asciinema.org/a/WGxafFNfPUL4my1sQoyxJO1uy
Fixes: #1579
Checklist
Does this PR introduce a breaking change?