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

Co-authored-by: Tim Bannister <tim@scalefactory.com>
pull/47972/head
HITMAN 2024-09-18 22:01:42 +05:30 committed by GitHub
parent 6be79614a3
commit 4564e7580b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 1 deletions

View File

@ -13,7 +13,10 @@ min-kubernetes-server-version: 1.7
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.
Modification using the HostAliases field in the PodSpec is recommended because changes
The Kubernetes project recommends modifying DNS configuration using the `hostAliases` field
(part of the `.spec` for a Pod), and not by using an init container or other means to edit `/etc/hosts`
directly.
Change made in other ways may be overwritten by the kubelet during Pod creation or restart.
made in other ways may be overwritten by the kubelet during Pod creation or restart.
<!-- steps -->