jupyter-server / enterprise_gateway

A lightweight, multi-tenant, scalable and secure gateway that enables Jupyter Notebooks to share resources across distributed clusters such as Apache Spark, Kubernetes and others.
https://jupyter-enterprise-gateway.readthedocs.io/en/latest/
Other
619 stars 223 forks source link

Error: module 'kubernetes.client' has no attribute 'V1Subject' #1382

Open fm2022aa opened 4 months ago

fm2022aa commented 4 months ago

When I use the 3.2.3 image, I encountered this error when spawning a kernel:

[I 2024-05-31 08:44:21.065 EnterpriseGatewayApp] Created kernel namespace: jovyan-b4ca16d6-eb9f-431e-abef-e4f5ac9b344d
[W 2024-05-31 08:44:21.074 EnterpriseGatewayApp] Deleted kernel namespace: jovyan-b4ca16d6-eb9f-431e-abef-e4f5ac9b344d
[E 2024-05-31 08:44:21.074 EnterpriseGatewayApp] Error occurred creating role binding for namespace 'jovyan-b4ca16d6-eb9f-431e-abef-e4f5ac9b344d': module 'kubernetes.client' has no attribute 'V1Subject'

using the server image: jupyter/base-notebook:python-3.9.7

welcome[bot] commented 4 months ago

Thank you for opening your first issue in this project! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out Jupyter's Code of Conduct. Also, please try to follow the issue template as it helps other other community members to contribute more effectively. welcome You can meet the other Jovyans by joining our Discourse forum. There is also an intro thread there where you can stop by and say Hi! :wave:
Welcome to the Jupyter community! :tada:

merqri commented 3 months ago

@fm2022aa

Greetings! I ran into the same problem today. The fastest way to solve it for me was to build a new container with minimal changes:

FROM elyra/enterprise-gateway:3.2.3

USER root

RUN sed -i 's/V1Subject/RbacV1Subject/g' /opt/conda/lib/python3.10/site-packages/enterprise_gateway/services/processproxies/k8s.py

USER jovyan

As you can see the problem is in the line.

https://github.com/jupyter-server/enterprise_gateway/blob/d01e84a2457d44d14bd6bd3335307b9d0e3b483d/enterprise_gateway/services/processproxies/k8s.py#L352 It uses V1Subject, which is not supported by kubernetes library version 29

I have also created a pull request that should solve this problem - https://github.com/jupyter-server/enterprise_gateway/pull/1384

fm2022aa commented 3 months ago

Greetings! I ran into the same problem today. The fastest way to solve it for me was to build a new container with minimal changes:

Thank you for your reply