No module named kubernetes when creating custom kubernetes image

Hi, I am trying to build a custom image of a jupyterhub container to be deployed using Kubernetes and helm. I am starting from the GitHub Repository GitHub - jupyterhub/zero-to-jupyterhub-k8s: Helm Chart & Documentation for deploying JupyterHub on Kubernetes, copying the /images/hub directory and creating the Container image with Docker. As authenticator I am using the keycloak Authenticator, whch I am manually adding to the requirements.txt.
When I am starting the Container, I get the error „no module named kubernetes“. Exploring the requirements.txt, I recoginze that the module really is missing here. After manually adding it, the container starts, but when I want to spawn the Single User notebook, I get the error message:
expected object of type ‘dict’ (or ‘V1Container’) but got ‘V1Container’
I am pretty sure this is caused by the kubernetes module, but I have no idea how to fix this.

Hi!
Please could you tell us which version of Z2JH you’re using, and which version of the container or Dockerfile you’re using as your base image? Thanks!

Yes, I am using the Z2JH main branch of GitHub - jupyterhub/zero-to-jupyterhub-k8s: Helm Chart & Documentation for deploying JupyterHub on Kubernetes, the base image in the Dockerfile (zero-to-jupyterhub-k8s/Dockerfile at 58d7d67192930b95bc1ea14542aabbf04d2605b3 · jupyterhub/zero-to-jupyterhub-k8s · GitHub) is python:3.9-slim-bullseye

Could you show us the exact commands you’re using to deploy your Helm Chart, your config, and the Dockerfile for your Hub image? The reliance on the kubernetes dependency suggests something might be out of date.