kuasar-io / kuasar

A multi-sandbox container runtime that provides cloud-native, all-scenario multiple sandbox container solutions.
https://kuasar.io
Apache License 2.0
1.27k stars 91 forks source link

sandbox: support shared process namespace #149

Closed wackxu closed 3 months ago

wackxu commented 3 months ago

Before starting the virtual machine, pay attention to the NamespaceMode setting of pid namespace in PodSandboxConfig. If it is set to "Pod", add task.share_pidns to the startup parameters of Kuasar's task. When the task starts and detects the share_pidns parameter, create a pid ns when creating the shared namespace. Since the pid ns needs to take effect on child processes, two forks are required. The process forked executes the pause function and does not exit anymore.