-
Notifications
You must be signed in to change notification settings - Fork 348
Revert "Add HOSTNAME to env by default for pod containers" #898
Conversation
This reverts commit 4c3e195. Signed-off-by: Lantao Liu <[email protected]>
/lgtm |
From the kube-addon-manager log:
The addon manager did not think it's the leader |
By the way, kube-addon-manager runs in the host network |
kubelet probably doesn't set hostname for pods running in the host network. Not sure how docker handles this. |
Interesting; it definitely looks like This is the code where Docker engine sets up I also looked at dockershim and don't see any env replacement or changes happening; I can't even find the string "HOSTNAME" in any files in pkg/kubelet. So, something is definitely different, but I'm not sure what is occurring here. |
hmm, looks like the missing piece is that by the time that code runs in Docker, if
The container's hostname is the LinuxKit VM hostname. |
Kubelet passes the hostname through the podsandbox config, but it doesn't add an env variable directly.
That sounds reasonable. Docker probably derives this information before passing it through the config. |
https://github.com/moby/moby/blob/master/daemon/container_operations.go#L936-L943 I'll make the change. And we may want to define the behavior in CRI. |
This reverts commit 4c3e195.
See reason: #895 (comment)
Signed-off-by: Lantao Liu [email protected]