# AWX deployment on IPv6 k8s cluster?

**URL:** <https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842>\
**Category:** Get Help\
**Tags:** awx, kubernetes\
**Created:** [April 9, 2024, 3:21pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842 "2024-04-09T15:21:37Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![CWollinger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cwollinger/32/2847_2.png) [@CWollinger](https://forum.ansible.com/u/CWollinger)\
**Post date:** [April 9, 2024, 3:21pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/1 "2024-04-09T15:21:38Z")

</div>

Hi folks,

does anyone have experience with AWX deployment on a kubernetes IPv6 (only) cluster?  
Is AWX ready for that (as well as services like nginx, websocket etc.)?

The idea is to deploy AWX on an IPv6 cluster, so the internal communication between the services and also the ingress, must be IPv6-ready. Is this even possible?

Regards  
CWollinger

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [April 9, 2024, 4:05pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/2 "2024-04-09T16:05:00Z")

</div>

Yes, you can deploy AWX in an IPv6 only cluster. If you run into technical difficulties, please feel free to post and ask for help. There’s been a handful of users in recent months that had issues with external postgresql databases where some network-related component was trying to use IPv4 despite only IPv6 being available, but they were able to resolve those issues.

---

<div class="post-metadata">

**Author:** ![CWollinger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cwollinger/32/2847_2.png) [@CWollinger](https://forum.ansible.com/u/CWollinger)\
**Post date:** [April 16, 2024, 10:46am UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/3 "2024-04-16T10:46:04Z")

</div>

> [@Denney-tech](#):
>
> k for help. There’s been a handful of users in recent months that had issues with external postgresql databases where some network-related comp

Hi, so the deployment was successful and AWX is running on the IPv6 cluster. There is only a problem with the websocket (for the UI refreshment). Our client (browsing the UI) is also on IPv6. Do you know if there are known issues? Or websocket has to be reconfigured? I didn’t find any AWX github issue.

Some examples from the logs (can provide the full logs):

```auto
ValueError: Port could not be cast to integer value as '111:xxx:11:8052'

```

```auto
ValueError: Invalid URL: port can't be converted to integer

```

```auto
aiohttp.client_exceptions.InvalidURL: http://xxxx:111:xxx:11:8052/websocket/relay/

```

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [April 16, 2024, 1:07pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/4 "2024-04-16T13:07:28Z")

</div>

There are known and recurring issues with websockets, yes. I have issues with them myself.

That being said, that looks like an IPv6 bug, since it’s trying to treat most of the IPv6 address as part of the port number.

@TheRealHaoLiu

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [April 16, 2024, 1:11pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/5 "2024-04-16T13:11:45Z")

</div>

@CWollinger What version of AWX have you deployed?

Edit: The full log might be helpful, especially if there’s a traceback.

---

<div class="post-metadata">

**Author:** ![CWollinger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cwollinger/32/2847_2.png) [@CWollinger](https://forum.ansible.com/u/CWollinger)\
**Post date:** [April 16, 2024, 1:44pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/6 "2024-04-16T13:44:41Z")

</div>

AWX 23.1.0

```auto
2024-04-14 03:04:08,376 INFO spawned: 'wsrelay' with pid 202
2024-04-14 03:04:08,376 INFO spawned: 'wsrelay' with pid 202
2024-04-14 03:04:10,808 INFO [-] awx.main.wsrelay Active instance with hostname awx-task-9bc7f86-lxbmg is registered.
2024-04-14 03:04:20,824 INFO [-] awx.main.wsrelay Adding {'awx-web-58d7c867f5-wwls7'} to websocket broadcast list
2024-04-14 03:04:20,835 WARNING [-] awx.main.wsrelay Connection from awx-task-9bc7f86-lxbmg to xxxx:111:xxx:11::33b failed for unknown reason: 'http://xxxx:111:xxx:11::33b:8052/websocket/relay/'.
Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/yarl/_url.py", line 166, in __new__
    port = val.port
  File "/usr/lib64/python3.9/urllib/parse.py", line 186, in port
    raise ValueError(message) from None
ValueError: Port could not be cast to integer value as '111:xxx:11::33b:8052'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/aiohttp/client.py", line 423, in _request
    url = self._build_url(str_or_url)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/aiohttp/client.py", line 357, in _build_url
    url = URL(str_or_url)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/yarl/_url.py", line 168, in __new__
    raise ValueError(
ValueError: Invalid URL: port can't be converted to integer

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/wsrelay.py", line 80, in connect
    async with session.ws_connect(uri, ssl=self.verify_ssl, heartbeat=20) as websocket:
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/aiohttp/client.py", line 1141, in __aenter__
    self._resp = await self._coro
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/aiohttp/client.py", line 779, in _ws_connect
    resp = await self.request(
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/aiohttp/client.py", line 425, in _request
    raise InvalidURL(str_or_url) from e
aiohttp.client_exceptions.InvalidURL: http://xxxx:111:xxx:11::33b:8052/websocket/relay/
2024-04-14 03:04:30,829 INFO [-] awx.main.wsrelay Removing {'awx-web-58d7c867f5-wwls7'} from websocket broadcast list
/usr/lib64/python3.9/asyncio/events.py:80: RuntimeWarning: coroutine 'WebSocketRelayManager.cleanup_offline_host' was never awaited
  self._context.run(self._callback, *self._args)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Traceback (most recent call last):
  File "/usr/bin/awx-manage", line 8, in <module>
    sys.exit(manage())
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/ __init__.py", line 200, in manage
    execute_from_command_line(sys.argv)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/django/core/management/ __init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/django/core/management/ __init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/management/commands/run_wsrelay.py", line 168, in handle
    asyncio.run(websocket_relay_manager.run())
  File "/usr/lib64/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/lib64/python3.9/asyncio/base_events.py", line 647, in run_until_complete
    return future.result()
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/wsrelay.py", line 330, in run
    await asyncio.gather(self.cleanup_offline_host(h) for h in deleted_remote_hosts)
  File "/var/lib/awx/venv/awx/lib64/python3.9/site-packages/awx/main/wsrelay.py", line 330, in <genexpr>
    await asyncio.gather(self.cleanup_offline_host(h) for h in deleted_remote_hosts)
RuntimeError: Task got bad yield: <coroutine object WebSocketRelayManager.cleanup_offline_host at 0x7f3bf8df54c0>
2024-04-14 03:04:31,220 WARN exited: wsrelay (exit status 1; not expected)
2024-04-14 03:04:31,220 WARN exited: wsrelay (exit status 1; not expected)
2024-04-14 03:04:33,225 INFO spawned: 'wsrelay' with pid 209

```

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [April 16, 2024, 2:50pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/7 "2024-04-16T14:50:25Z")

</div>

There was a change in 23.4.0 that fixed the wsrelay for IPv6 in Openshift clusters, but it might also fix your particular issue. There’s also been multiple wsrelay fixes applied in subsequent releases, so it might not hurt to upgrade to something even newer.

> <https://github.com/ansible/awx/pull/14623>
>
> \##### SUMMARY
> 
> 
> Found that in IPv6 only openshift cluster, wsrelay was failin…g to ever make connections and eventually causing supervisor to exit everything and the pod would exit.
> 
> \##### ISSUE TYPE
> 
> - Bug, Docs Fix or other nominal change
> 
> \##### COMPONENT NAME
> 
> - Other
> 
> \##### AWX VERSION
> 
> \`\`\`
> devel
> \`\`\`
> 
> 
> \##### ADDITIONAL INFORMATION
> 
> Working on testing this locally. Using \`kind\` I've got this config:
> \`\`\`
> \---
> kind: Cluster
> apiVersion: kind.x-k8s.io/v1alpha4
> name: dev
> networking:
> ipFamily: ipv6
> nodes:
> \- role: control-plane
> extraMounts:
> - hostPath: /home/kdelee/projects/ansible/awx
> containerPath: /awx\_devel
> extraPortMappings:
> - containerPort: 30080
> hostPort: 30080
> \`\`\`
> 
> I have recreated with this, using \`VERSION=2.7.1 make deploy\` in the \`awx-operator\` repo to deploy operator and applying:
> 
> \`\`\`
> \---          
> apiVersion: awx.ansible.com/v1beta1
> kind: AWX
> metadata:
> name: awx
> namespace: awx
> spec:
> admin\_user: admin
> admin\_email: admin@localhost
> service\_type: nodeport 
> development\_mode: true 
> nodeport\_port: 30080 
> image: ghcr.io/ansible/awx\_kube\_devel
> image\_version: devel
> \`\`\`
> With my local changes checked out
> 
> \*\*NOTE\*\* for some reason I kept getting image pull error on \` ghcr.io/ansible/awx\_kube\_devel\`...I resolved by doing \`kind load docker-image ghcr.io/ansible/awx\_kube\_devel:devel --name dev\`

---

<div class="post-metadata">

**Author:** ![CWollinger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cwollinger/32/2847_2.png) [@CWollinger](https://forum.ansible.com/u/CWollinger)\
**Post date:** [April 16, 2024, 3:39pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/8 "2024-04-16T15:39:39Z")

</div>

> [@Denney-tech](#):
>
> in 23.4.0 that fixed the wsrelay for IPv6 in Openshift clusters, but it might also fix your particular issue. There’s also been multiple wsrelay fixes applied in subsequent releases, so it might not hurt to upgrade to something even newer.

Thanks for the hint. I will check this out 🙂

---

<div class="post-metadata">

**Author:** ![nfett](https://avatars.discourse-cdn.com/v4/letter/n/ebca7d/32.png) [@nfett](https://forum.ansible.com/u/nfett)\
**Post date:** [October 2, 2024, 1:37pm UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/9 "2024-10-02T13:37:36Z")

</div>

@CWollinger i wanted to ask if you could share how you went about getting your AWX to use IPv6 please. Did you build a new deployment or edit an existing one to use IPv6. I have one running on version 24.6.1 and wanted to incorporate IPv6 into so i can run playbooks against IPv6 based devices.

Thank you.

---

<div class="post-metadata">

**Author:** ![CWollinger](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/cwollinger/32/2847_2.png) [@CWollinger](https://forum.ansible.com/u/CWollinger)\
**Post date:** [October 7, 2024, 9:05am UTC](https://forum.ansible.com/t/awx-deployment-on-ipv6-k8s-cluster/4842/10 "2024-10-07T09:05:32Z")

</div>

Hi @nfett

There was no adjustment needed on the AWX side. Important was that the k8s cluster is based on IPv6 and your pods got an internal IPv6 address to be able to route the IPv6.
