Adding entries to Pod /etc/hosts with HostAliases

 If your Kubernetes environment is unable to consistently resolve the host names of the supporting servers (MongoDB, Sametime Proxy, STUN) using DNS, configure the hosts manually.

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 not using HostAliases is not suggested because the file is managed by the kubelet and can be overwritten on during Pod creation/restart.


In case of resolving other service ingress URL, Then use ingress controller service IP Address and other service ingress URL like : 10.20.10.21 www.otheringress.com

For more information, please check this: Adding entries to Pod /etc/hosts with HostAliases | Kubernetes

Vikash Chauhan

C# & .NET experienced Software Engineer with a demonstrated history of working in the computer software industry.

Post a Comment

Previous Post Next Post

Contact Form