support systemd-nspawn containers
Costa Tsaousis (ktsaou) committed
Feb 2, 2018 at 22:25 UTC
b253cab1af6b2dd7c3bdcd19102fa187c7c48dcc
2 files changed
+12
-1
plugins.d/cgroup-name.sh
+6
@@ -139,6 +139,12 @@ if [ -z "${NAME}" ]
139
else
140
error "a docker id cannot be extracted from kubernetes cgroup '${CGROUP}'."
141
fi
142
+ elif [[ "${CGROUP}" =~ machine.slice[_/].*\.service ]]
143
+ then
144
+ # systemd-nspawn
145
+
146
+ NAME="$(echo ${CGROUP} | sed 's/.*machine.slice[_\/]\(.*\)\.service/\1/g')"
147
+
148
elif [[ "${CGROUP}" =~ machine.slice_machine.*-qemu ]]
149
then
150
# libvirtd / qemu virtual machines
src/sys_fs_cgroup.c
+6
-1
@@ -154,6 +154,10 @@ void read_cgroup_plugin_configuration() {
154
" !/system.slice/run-*.scope " // ignore system.slice/run-XXXX.scope
155
" *.scope " // we need all other *.scope for sure
156
157
+ // ----------------------------------------------------------------
158
+
159
+ " machine.slice/*.service " // #3367 systemd-nspawn
160
+
161
// ----------------------------------------------------------------
162
163
" !*/vcpu* " // libvirtd adds these sub-cgroups
@@ -202,6 +206,7 @@ void read_cgroup_plugin_configuration() {
206
" !/ "
207
" !*.mount "
208
" !*.partition "
209
+ " machine.slice/*.service " // #3367 systemd-nspawn
210
" !*.service "
211
" !*.slice "
212
" !*.swap "
@@ -213,7 +218,7 @@ void read_cgroup_plugin_configuration() {
218
" *docker* "
219
" *lxc* "
220
" *qemu* "
216
- " *kubepods* " // #3396
221
+ " *kubepods* " // #3396 kubernetes
222
" *.libvirt-qemu " // #3010
223
" * "
224
), NULL, SIMPLE_PATTERN_EXACT);