-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
vmm: Unshare IPC and UTS namespaces for container process #107
Conversation
e385ece
to
58a1614
Compare
} | ||
|
||
// Update container hostname to sandbox hostname | ||
spec.hostname = hostname; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will these two values be different?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Containerd would not set hostname for container, it only set it to pod.
} | ||
|
||
thread::spawn(move || { | ||
unshare(clone_type).expect("failed to do unshare"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this affect the whole process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
@@ -71,6 +77,20 @@ where | |||
} | |||
// Update sandbox files mounts for container | |||
container_mounts(&shared_path, spec); | |||
|
|||
// Update ipc and uts namespace for container | |||
if let Some(linux) = spec.linux.as_mut() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is a namespace handler, which is doing similar things
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
4696b10
to
dafab32
Compare
Container process needs a POD level IPC and UTS namespace unshared with kuasar-task by default as pause container has been removed. In this commit, kuasar-task will unshare a new ns and bind mount it to `/run/sandbox-ns`, in which the container could join. The hostname in the sandbox pod config will be set into uts ns by runC when creating container. Signed-off-by: Zhang Tianyang <burning9699@gmail.com>
dafab32
to
80d40e1
Compare
Container process needs a POD level IPC and UTS namespace unshared with kuasar-task by default as pause container has been removed.
In this commit, kuasar-task will unshare a new ns and bind mount it to
/run/sandbox-ns
, in which the container could join. The hostname in the sandbox pod config will be set into uts ns by runC when creating container.TODO: Pod level PID namespace implementation.