Skip to content

Can not connect to k8s websocket deployed in Rancher  #851

Open
@dbalabka

Description

@dbalabka

Describe the issue:
Deploy k8s cluster in a rancher. Try to connect with default settings. You will see:

2024-01-02 21:19:05,453 - asyncio - ERROR - Task exception was never retrieved
future: <Task finished name='Task-26' coro=<PortForward._sync_sockets() done, defined at /home/torinaki/src/demand-forecasting/.venv/lib/python3.10/site-packages/kr8s/_portforward.py:168> exception=AssertionError('Only absolute URLs without path part are supported')>
Traceback (most recent call last):
  File ".../.venv/lib/python3.10/site-packages/kr8s/_portforward.py", line 171, in _sync_sockets
    async with self._connect_websocket() as ws:
  File "/usr/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File ".../.venv/lib/python3.10/site-packages/kr8s/_portforward.py", line 150, in _connect_websocket
    async with self.pod.api.open_websocket(
  File "/usr/lib/python3.10/contextlib.py", line 199, in __aenter__
    return await anext(self.gen)
  File ".../.venv/lib/python3.10/site-packages/kr8s/_api.py", line 184, in open_websocket
    async with aiohttp.ClientSession(
  File ".../.venv/lib/python3.10/site-packages/aiohttp/client.py", line 261, in __init__
    self._base_url.origin() == self._base_url
AssertionError: Only absolute URLs without path part are supported

because Rancher provides the following URL to connect to websockets: https://rancher.example.com/k8s/clusters/c-m-4wx4gzpx

Minimal Complete Verifiable Example:

TBD

Anything else we need to know?:

Environment:

  • Dask version: 2023.11.0
  • Python version: 3.10
  • Operating System: Linux
  • Install method (conda, pip, source): poetry

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions