kepler
kepler copied to clipboard
Resolve Container ID by both PID and Cgroup ID
There are two following ways to associate a process to its container ID:
- by reading the process's /proc/pid/cgroup and find the container ID. This requires exposing host's /proc filesystem to Kepler container.
- by using the process's Cgroup ID and resolve it in cgroup FS at /sys/fs/cgroup. This doesn't require host's /proc
The Cgroup ID is the current way in practice. However, CgroupID resolution requires Cgroup V2 support. For environment without Cgroup V2 enabled, a fallthrough to PID resolution is needed.
@marceloamaral
We can identify if the host has cGroup V2 with grep cgroup2 /proc/filesystems. Therefore, the system can identify which version of cGroup the host supports.
However, since we need to customize the Kepler YAML deployment to expose /proc to cGroup V1, we can create an operator that configures and deploys Kepler. The operator will introduce a new CRD which will also contain some custom settings.
@marceloamaral here is the way from openshift doc
you can verify that cgroups v2 is enabled by checking that the sys/fs/cgroup/cgroup.controllers file is present on the node. This file is created by cgroups v2.
cc @metacosm, Christophe is working on the operator
The PR ##152 fixed this.