HostAlias not getting updated on automation-job POD (AWX-Operator)

I recently had to move my K3 cluster running AWX-operator. The IP addresses of my nodes had to change from,, to,, I updated hostAlias in my awx-demo deployment:

271       dnsPolicy: ClusterFirst
272       hostAliases:
273       - hostnames:
274         -
275         ip:
276       initContainers:
277       - command:
278         - /bin/sh
279         - -c
280         - |
281           hostname=$MY_POD_NAME
282           receptor --cert-makereq bits=2048 commonname=$hostname dnsname=$hostname nodeid=$hostname outreq=/etc/receptor/tls/receptor.req outkey=/etc/receptor/tls/receptor.key
283           receptor --cert-signreq req=/etc/receptor/tls/receptor.req cacert=/etc/receptor/tls/ca/receptor-ca.crt cakey=/etc/receptor/tls/ca/receptor-ca.key outcert=/etc/receptor/tls/    receptor.crt verify=yes

This works for my awx-demo-ee POD and containers but my Ansible code gets executed on the automation-job PODs and its /etc/hosts file has the old IP.

$ kubectl -n awx exec -it automation-job-19120-2npln -- bash
bash-4.4$ cat /etc/hosts
# Kubernetes-managed hosts file.   localhost
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
fe00::0 ip6-mcastprefix
fe00::1 ip6-allnodes
fe00::2 ip6-allrouters  automation-job-19120-2npln

# Entries added by HostAliases.

Please help. I am using awx-operator on a k3 cluster. Thanks

If you prefer I posted a question to kubernetes - HostAlias being ignored in AWX-operator PODs - Server Fault also.

Interesting, I just read about it here:

Do you have pod for host aliases in your cluster?

p.s. just read you did update :slight_smile:

To customize pod specification for your automation job pods, you should define Container Groups with customized pod specification that contains hostAliases, and specify it in Job Templates or Organizations.

Probably you already have the one with old IP addresses?

By the way how did you inject hostAliases to your AWX deployment means awx-task and awx-web deployments?


That was it. I had to update my ‘default’ Instance Group in the AWX Web UI Administration >> Instance Groups. Thanks from saving me from totally wrecking my AWX Tower.


This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.