kubernetes-retired / rktlet

[EOL] The rkt implementation of the Kubernetes Container Runtime Interface
Apache License 2.0
137 stars 43 forks source link

runtime: set hostname to host's if --net=host #118

Closed iaguis closed 7 years ago

iaguis commented 7 years ago

Since host networking implies host UTS [1] and rkt doesn't support sharing the host's UTS namespace, let's at least set the hostname to the host's.

alban commented 7 years ago

rkt is getting a new option to use the IPC namespace of the host: https://github.com/rkt/rkt/pull/3787.

I could also teach rkt how to use the UTS namespace of the host if needed.

lucab commented 7 years ago

@alban systemd-nspwan has an explicit check to abort on shared-UTS and --boot. This comes from my split of SHARE_SYSTEM, but needs some investigation to see if it is safe to drop (I assumed no).

alban commented 7 years ago

@lucab oh indeed good point:

$ sudo SYSTEMD_NSPAWN_SHARE_NS_UTS=true rkt run --interactive docker://busybox
--boot cannot be used without namespacing.

I guess it is necessary because systemd will set the hostname based on /etc/hostname. So this PR looks like the best we can do.

lucab commented 7 years ago

Then I guess this is fine to land, anything else missing?