mdt-dialout-collector icon indicating copy to clipboard operation
mdt-dialout-collector copied to clipboard

Problem connecting to interface in container

Open sgaragan opened this issue 9 months ago • 0 comments

We have already dealt with this after some conversations with Salvatore et al but we wanted to add a new issue to formally track it

When running pmtelemetryd with the mdt-dialout-collector library, the code cannot bind to a network interface defined by the 'iface' config key when the container is not running as root (which is a security requirement for our environment). Salvatore recommended trying to comment out the following code in src/core/mdt-dialout-core.cc:

    if (setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
        iface.c_str(), strlen(iface.c_str())) != 0) {
        spdlog::get("multi-logger")->
            error("[CustomSocketMutator()]: Unable to bind [{}] "
            "on the configured socket(s)", iface);
        std::abort();
    }

Removing this code worked and allowed the daemon to start up without any issues.

Could the 'iface' config key be made optional (or ignored) when deploying this into a container on Kubernetes/OpenShift? This would probably require a start arg or config key to identify when deploying in a container as well

Thanks, Sean

sgaragan avatar May 13 '24 15:05 sgaragan