# Need to add host entires in awx pod

**URL:** <https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860>\
**Category:** AWX Project\
**Tags:** awx\
**Created:** [July 17, 2022, 9:58am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860 "2022-07-17T09:58:37Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahilan\_Swaminathan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ahilan_swaminathan/32/4425_2.png) [@Ahilan\_Swaminathan](https://forum.ansible.com/u/Ahilan_Swaminathan)\
**Post date:** [July 17, 2022, 9:58am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/1 "2022-07-17T09:58:37Z")

</div>

Hi Rebeccah/Team

I want to add more entries in (/etc/hosts) in awx pod but not sure where I put “hostAliases”. Please help me to add entries in hosts file in awx pod.

---

<div class="post-metadata">

**Author:** ![elleryq](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/elleryq/32/4560_2.png) [@elleryq](https://forum.ansible.com/u/elleryq)\
**Post date:** [July 17, 2022, 1:10pm UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/2 "2022-07-17T13:10:24Z")

</div>

Hi,

You can use hostAliases .

> **[Adding entries to Pod /etc/hosts with HostAliases](https://kubernetes.io/docs/tasks/network/customize-hosts-file-for-pods/)**
>
> 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.
> The Kubernetes project recommends...

[ahil...@gmail.com](mailto:ahil...@gmail.com) 在 2022年7月17日 星期日下午5:58:51 [UTC+8] 的信中寫道：

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [July 17, 2022, 2:43pm UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/3 "2022-07-17T14:43:30Z")

</div>

You can put it in the container instances (iirc) in awx. There is a setting to modify the pod spec

---

<div class="post-metadata">

**Author:** ![Ahilan\_Swaminathan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ahilan_swaminathan/32/4425_2.png) [@Ahilan\_Swaminathan](https://forum.ansible.com/u/Ahilan_Swaminathan)\
**Post date:** [July 18, 2022, 4:00am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/4 "2022-07-18T04:00:49Z")

</div>

Hi Yen

You want me to edit running awx pod instance and add entities in “spec” section??? Can you please elaborate?

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [July 18, 2022, 4:02am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/5 "2022-07-18T04:02:21Z")

</div>

No. You don’t. All automation jobs run in an ee in awx 18+. So that’s where you change it

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [July 18, 2022, 4:05am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/6 "2022-07-18T04:05:27Z")

</div>

Look at this link

[https://stackoverflow.com/questions/67747550/how-can-i-expose-local-data-path-to-the-temporary-job-container-awx-job-xxxxx](https://stackoverflow.com/questions/67747550/how-can-i-expose-local-data-path-to-the-temporary-job-container-awx-job-xxxxx)

---

<div class="post-metadata">

**Author:** ![Ahilan\_Swaminathan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/ahilan_swaminathan/32/4425_2.png) [@Ahilan\_Swaminathan](https://forum.ansible.com/u/Ahilan_Swaminathan)\
**Post date:** [July 18, 2022, 4:14am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/7 "2022-07-18T04:14:44Z")

</div>

Hi Yen

Here my awx details!!!

[kubeadmin@xl8phxc360awxtst ~]$ k get pods  
NAME READY STATUS RESTARTS AGE  
awx-567bcb5746-zkp74 4/4 Running 44 (18h ago) 2d11h  
awx-operator-controller-manager-6c69f7cdb-fd7fp 2/2 Running 30 (18h ago) 22d  
awx-postgres-0 1/1 Running 15 (18h ago) 22d  
[kubeadmin@xl8phxc360awxtst ~]$ kubectl get pods awx-567bcb5746-zkp74 -o jsonpath=‘{.spec.containers[_].name}’  
redis awx-web awx-task awx-ee[kubeadmin@xl8phxc360awxtst ~]$  
[kubeadmin@xl8phxc360awxtst ~]$ kubectl get pods awx-postgres-0 -o jsonpath='{.spec.containers[_].name}’  
postgres[kubeadmin@xl8phxc360awxtst ~]$  
[kubeadmin@xl8phxc360awxtst ~]$ kubectl get pods awx-operator-controller-manager-6c69f7cdb-fd7fp -o jsonpath=‘{.spec.containers[\*].name}’  
kube-rbac-proxy awx-manager[kubeadmin@xl8phxc360awxtst ~]$  
[kubeadmin@xl8phxc360awxtst ~]$  
[kubeadmin@xl8phxc360awxtst ~]$

Now Please guide me how can I add my hostAliases in my running AWX.

Below the entry I need to add in my awx pod /etc/hosts!!!

hostAliases:

- ip: “x.x.x.x”  
hostnames: “basemachine”
- ip: “x.x.x.x”  
hostnames: “ansiblemaster”

---

<div class="post-metadata">

**Author:** ![Ankit\_Pandey](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Ankit\_Pandey](https://forum.ansible.com/u/Ankit_Pandey)\
**Post date:** [August 23, 2022, 8:21am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/8 "2022-08-23T08:21:25Z")

</div>

Hi Ahil,

Did you manage to do this?  
Even i also wanted to same, as i have some github hostname i want to access, but hostname to ip mapping is required in /etc/hosts to sync project.  
Do anyone has idea how i can achive this?  
It seems i can do using host alias, but that don’t apply to running ee container  
Please help me as i am stuck here, not able to procced further

Thanks & Regards,  
Ankit Pandey

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [August 23, 2022, 9:46am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/9 "2022-08-23T09:46:09Z")

</div>

Sorry I missed your message. All container spec details are under administration → instance groups —\> create container group. As your container spec details there

---

<div class="post-metadata">

**Author:** ![Ankit\_Pandey](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Ankit\_Pandey](https://forum.ansible.com/u/Ankit_Pandey)\
**Post date:** [August 24, 2022, 7:11am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/10 "2022-08-24T07:11:39Z")

</div>

Hi Weiye,

My doubt is i want to have a execution env containers ‘/etc/hosts’ file patched with a hostname and ip address mapping entries, as my github is outside the network and node DNS not able to resolve the name. Is there is anyway i can customize the ee container spec?  
I am ready to create new execution env or i can patch the existing ee container.

Thanks & Regards,  
Ankit Pandey

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [August 24, 2022, 7:25am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/11 "2022-08-24T07:25:49Z")

</div>

Look above. That’s where you set it

---

<div class="post-metadata">

**Author:** ![Ankit\_Pandey](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@Ankit\_Pandey](https://forum.ansible.com/u/Ankit_Pandey)\
**Post date:** [August 24, 2022, 7:56am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/12 "2022-08-24T07:56:12Z")

</div>

No, not able to do there, it creates new, projects are synced via EE, so that place doesn’t help me as it creates new container everytime. Please show one example how we can do…

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [August 24, 2022, 9:19am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/13 "2022-08-24T09:19:03Z")

</div>

Kindly look at this link. It tells you how to modify the spec based on customising the volume mounts. Customise the pod spec for your needs

---

<div class="post-metadata">

**Author:** ![Wei-Yen\_Tan](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/wei-yen_tan/32/4111_2.png) [@Wei-Yen\_Tan](https://forum.ansible.com/u/Wei-Yen_Tan)\
**Post date:** [August 24, 2022, 9:19am UTC](https://forum.ansible.com/t/need-to-add-host-entires-in-awx-pod/36860/14 "2022-08-24T09:19:24Z")

</div>

[https://stackoverflow.com/questions/67747550/how-can-i-expose-local-data-path-to-the-temporary-job-container-awx-job-xxxxx](https://stackoverflow.com/questions/67747550/how-can-i-expose-local-data-path-to-the-temporary-job-container-awx-job-xxxxx)
