From bf6e6caa12a1240c0b39c72f1e556512b37b8d24 Mon Sep 17 00:00:00 2001 From: Purneswar Prasad <42652270+PurneswarPrasad@users.noreply.github.com> Date: Wed, 19 Jan 2022 13:24:15 +0530 Subject: [PATCH 1/3] Changed the explicit mention of Docker due to deprecation in Tasks > Netwrking --- .../en/docs/tasks/network/customize-hosts-file-for-pods.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/docs/tasks/network/customize-hosts-file-for-pods.md b/content/en/docs/tasks/network/customize-hosts-file-for-pods.md index e396db5d2d..5c0c68eb39 100644 --- a/content/en/docs/tasks/network/customize-hosts-file-for-pods.md +++ b/content/en/docs/tasks/network/customize-hosts-file-for-pods.md @@ -118,9 +118,9 @@ with the additional entries specified at the bottom. ## Why does the kubelet manage the hosts file? {#why-does-kubelet-manage-the-hosts-file} The kubelet [manages](https://github.com/kubernetes/kubernetes/issues/14633) the -`hosts` file for each container of the Pod to prevent Docker from -[modifying](https://github.com/moby/moby/issues/17190) the file after the -containers have already been started. +`hosts` file for each container of the Pod to prevent the container runtime from +modifying the file after the containers have already been started. +For e.g. earlier Docker used to [modify](https://github.com/moby/moby/issues/17190) the `hosts` file after the containers start. {{< caution >}} Avoid making manual changes to the hosts file inside a container. From d44efbeefba6d6fdc39953091ead2a40d946bc6e Mon Sep 17 00:00:00 2001 From: Purneswar Prasad <42652270+PurneswarPrasad@users.noreply.github.com> Date: Thu, 20 Jan 2022 06:59:55 +0530 Subject: [PATCH 2/3] Removed the PR link from `manages` Co-authored-by: Tim Bannister --- content/en/docs/tasks/network/customize-hosts-file-for-pods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/tasks/network/customize-hosts-file-for-pods.md b/content/en/docs/tasks/network/customize-hosts-file-for-pods.md index 5c0c68eb39..3ac331569d 100644 --- a/content/en/docs/tasks/network/customize-hosts-file-for-pods.md +++ b/content/en/docs/tasks/network/customize-hosts-file-for-pods.md @@ -117,7 +117,7 @@ with the additional entries specified at the bottom. ## Why does the kubelet manage the hosts file? {#why-does-kubelet-manage-the-hosts-file} -The kubelet [manages](https://github.com/kubernetes/kubernetes/issues/14633) the +The kubelet manages the `hosts` file for each container of the Pod to prevent the container runtime from modifying the file after the containers have already been started. For e.g. earlier Docker used to [modify](https://github.com/moby/moby/issues/17190) the `hosts` file after the containers start. From dd2ea439e85124757e99bd972c43da46fa4891e2 Mon Sep 17 00:00:00 2001 From: Purneswar Prasad <42652270+PurneswarPrasad@users.noreply.github.com> Date: Thu, 20 Jan 2022 14:50:41 +0530 Subject: [PATCH 3/3] Removed all previous PR links with Docker reference Co-authored-by: Tim Bannister --- .../en/docs/tasks/network/customize-hosts-file-for-pods.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/en/docs/tasks/network/customize-hosts-file-for-pods.md b/content/en/docs/tasks/network/customize-hosts-file-for-pods.md index 3ac331569d..7eba61fbea 100644 --- a/content/en/docs/tasks/network/customize-hosts-file-for-pods.md +++ b/content/en/docs/tasks/network/customize-hosts-file-for-pods.md @@ -120,7 +120,12 @@ with the additional entries specified at the bottom. The kubelet manages the `hosts` file for each container of the Pod to prevent the container runtime from modifying the file after the containers have already been started. -For e.g. earlier Docker used to [modify](https://github.com/moby/moby/issues/17190) the `hosts` file after the containers start. +Historically, Kubernetes always used Docker Engine as its container runtime, and Docker Engine would +then modify the `/etc/hosts` file after each container had started. + +Current Kubernetes can use a variety of container runtimes; even so, the kubelet manages the +hosts file within each container so that the outcome is as intended regardless of which +container runtime you use. {{< caution >}} Avoid making manual changes to the hosts file inside a container.