From: Adam King Date: Thu, 24 Mar 2022 13:59:10 +0000 (-0400) Subject: cephadm: pass "--security-opt label=disable" to node-exporter container X-Git-Tag: v17.2.1~73^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=aab547acf9b1c7fafb67f3c613ff118e7e359a65;p=ceph.git cephadm: pass "--security-opt label=disable" to node-exporter container in order to support setting '--path.procfs=/host/proc','--path.sysfs=/host/sys', '--path.rootfs=/rootfs' for node-exporter we need to disable selinux separation between the node-exporter container and the host to avoid selinux denials Signed-off-by: Adam King (cherry picked from commit 6d4591723ba89dada9814118e2c14e08d4e4179a) --- diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index e2d3346a14f..a7bc02a68ba 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -2975,6 +2975,11 @@ def get_container(ctx: CephadmContext, # by ubuntu 18.04 kernel!) ] container_args.extend(monitoring_args) + if daemon_type == 'node-exporter': + # in order to support setting '--path.procfs=/host/proc','--path.sysfs=/host/sys', + # '--path.rootfs=/rootfs' for node-exporter we need to disable selinux separation + # between the node-exporter container and the host to avoid selinux denials + container_args.extend(['--security-opt', 'label=disable']) elif daemon_type == 'crash': ceph_args = ['-n', name] elif daemon_type in Ceph.daemons: