# Node or Pod IP based on destination

**URL:** <https://forum.ansible.com/t/node-or-pod-ip-based-on-destination/8665>\
**Category:** Get Help\
**Tags:** gcp, awx, kubernetes\
**Created:** [September 20, 2024, 10:15pm UTC](https://forum.ansible.com/t/node-or-pod-ip-based-on-destination/8665 "2024-09-20T22:15:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [September 20, 2024, 10:15pm UTC](https://forum.ansible.com/t/node-or-pod-ip-based-on-destination/8665/1 "2024-09-20T22:15:17Z")

</div>

This one is strange. I’ve just migrated my AWX instance from an on-prem k8s cluster to a GKE cluster in GCP. Everything is working as expected with some minor changes such as the source IP needed to be from the pod subnet instead of the node IP’s. While testing and setting up connectivity it was discovered that certain destination IP subnets are causing the source IP to be one of the Node IP’s (same as before when we were on-prem).

Any insight as to why this is happening?  
Is there a way to change this behavior?  
Is this something with awx or is this a kuberntes GKE thing?

AWX Version: 23.5.0  
AWX Operator: 2.28.0

---

<div class="post-metadata">

**Author:** ![kurokobo](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/kurokobo/32/182_2.png) [@kurokobo](https://forum.ansible.com/u/kurokobo)\
**Post date:** [September 21, 2024, 6:14am UTC](https://forum.ansible.com/t/node-or-pod-ip-based-on-destination/8665/2 "2024-09-21T06:14:11Z")

</div>

Hi, I don’t know much about your actual situation, but the AWX does nothing over the source IP addresses of the traffics AWX makes.  
Therefore, I believe your issue is due to the GKE-thing instead of something with AWX.

I have not configured this myself, so I cannot give specific advice, but if you want to control source IP address, perhaps there is a clue around Cloud NAT or Egress NAT Policy on GKE.

- [Cloud NAT overview &nbsp;|&nbsp; Google Cloud](https://cloud.google.com/nat/docs/overview)
- [Public NAT &nbsp;|&nbsp; Google Cloud](https://cloud.google.com/nat/docs/public-nat)
- [Utiliser Public NAT avec GKE &nbsp;|&nbsp; Google Cloud](https://cloud.google.com/nat/docs/gke-example)
- [Use Egress NAT Policy to configure IP masquerade in Autopilot clusters &nbsp;|&nbsp; Google Kubernetes Engine (GKE) &nbsp;|&nbsp; Google Cloud](https://cloud.google.com/kubernetes-engine/docs/how-to/egress-nat-policy-ip-masq-autopilot)

---

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [September 23, 2024, 5:13pm UTC](https://forum.ansible.com/t/node-or-pod-ip-based-on-destination/8665/3 "2024-09-23T17:13:06Z")

</div>

Thanks for your reply. I also don’t believe the issue is within AWX, however I’ve never encountered this before. I’m still fairly new to k8s and gke.

The GKE cluster is a standard cluster running Ubuntu Container OS. Its a private cluster and there’s no nat’s or external public addresses.

---

<div class="post-metadata">

**Author:** ![knowosielski-SJSU](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@knowosielski-SJSU](https://forum.ansible.com/u/knowosielski-SJSU)\
**Post date:** [October 11, 2024, 8:47pm UTC](https://forum.ansible.com/t/node-or-pod-ip-based-on-destination/8665/4 "2024-10-11T20:47:36Z")

</div>

Update on this in case anyone else has this issue.

GKE/GCP treated the addresses in question as public addresses and therefore tried to route them accordingly. We decied to address the issue by re-IPing the devices because they shouldn’t have been on public addresses to begin with.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/ansible/original/1X/1882d9a01da5d8996a862359b0913cc568a39b84.svg) [@system](https://forum.ansible.com/u/system)\
**Post date:** [November 10, 2024, 8:48pm UTC](https://forum.ansible.com/t/node-or-pod-ip-based-on-destination/8665/5 "2024-11-10T20:48:32Z")

</div>

Closed on November 10, 2024, 8:48pm UTC

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