mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-25 04:44:38 +00:00
Automatic merge from submit-queue (batch tested with PRs 50094, 48966, 49478, 50593, 49140) Kubelet manage hosts file for HostNetwork Pods instead of Docker **What this PR does / why we need it**: Currently, Docker manages the hosts file for containers inside Pods using hostNetwork. It creates discrepancy between how we treat hostNetwork and non-hostNetwork Pods. Kubelet should manage the file regardless of the network setup. **Which issue this PR fixes**: fixes #48397 more context in https://github.com/kubernetes/kubernetes/issues/43632#issuecomment-304376441 **Special notes for your reviewer**: Because the new logic relies on reading the node filesystem, I'm not sure how to write a proper unit test. I was thinking about using a node e2e test to cover the case, but suggestions are greatly welcomed. **Release note**: ```release-note Kubelet now manages `/etc/hosts` file for both hostNetwork Pods and non-hostNetwork Pods. ``` /kind feature /sig node @yujuhong @hongchaodeng @thockin @kubernetes/sig-network-feature-requests @kubernetes/sig-node-feature-requests