Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override/add DNS entries in /etc/hosts entries via hostAliases (EE pod) #15192

Open
4 of 9 tasks
smalenfant opened this issue May 15, 2024 · 2 comments
Open
4 of 9 tasks

Comments

@smalenfant
Copy link

smalenfant commented May 15, 2024

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX is open source software provided for free and that I might not receive a timely response.

Feature type

New Feature

Feature Summary

It seems like there is a lot of folks trying to find a workaround to override hosts entries. I've been trying lots of different things with ansible-builder. After working several hours on this I finally found how to do it.

It might be a good idea to document how to do this or possibly add a configuration in the UI beside customizing the pod spec override

References: https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/

I've been able to use the following in the Pod spec override which works great.

spec:
hostAliases:

  • ip: "127.0.0.1"
    hostnames:
    • "foo.local"

Select the relevant components

  • UI
  • API
  • Docs
  • Collection
  • CLI
  • Other

Steps to reproduce

Describe in Feature Summary

Current results

No entries can be added to /etc/hosts automation pod

Sugested feature result

bash-5.1$ cat /etc/hosts
# Kubernetes-managed hosts file.
127.0.0.1	localhost
::1	localhost ip6-localhost ip6-loopback
fe00::0	ip6-localnet
fe00::0	ip6-mcastprefix
fe00::1	ip6-allnodes
fe00::2	ip6-allrouters
30.10.8.223	automation-job-192-bnzrx

# Entries added by HostAliases.
127.0.0.1	foo.local

Additional information

No response

@TheRealHaoLiu
Copy link
Member

Glad to see that you find a solution to the problem, this might be the more relevant link to the Kubernetes doc https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/#adding-additional-entries-with-hostaliases

gonna change this to a docs issue, if you are looking to contribute to the doc, contribution are definitely welcome

@tvo318
Copy link
Member

tvo318 commented May 17, 2024

@smalenfant - Can you send me links to the documentation you looked at that you expected to have this information, but lacked? It will give me a better idea where readers are looking for this information so I can be sure it gets referenced there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants