Skip to content

Commit c6bb21e

Browse files
authored
Merge pull request #47972 from ayushpatil2122/patch-7
Update customize-hosts-file-for-pods.md
2 parents e8938d6 + 4564e75 commit c6bb21e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

content/en/docs/tasks/network/customize-hosts-file-for-pods.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@ min-kubernetes-server-version: 1.7
1313

1414
Adding entries to a Pod's `/etc/hosts` file provides Pod-level override of hostname resolution when DNS and other options are not applicable. You can add these custom entries with the HostAliases field in PodSpec.
1515

16-
Modification not using HostAliases is not suggested because the file is managed by the kubelet and can be overwritten on during Pod creation/restart.
17-
16+
The Kubernetes project recommends modifying DNS configuration using the `hostAliases` field
17+
(part of the `.spec` for a Pod), and not by using an init container or other means to edit `/etc/hosts`
18+
directly.
19+
Change made in other ways may be overwritten by the kubelet during Pod creation or restart.
20+
made in other ways may be overwritten by the kubelet during Pod creation or restart.
1821

1922
<!-- steps -->
2023

0 commit comments

Comments
 (0)