Why does Z2JK require cluster roles and cluster role bindings instead of roles and role bindings?

Can some one help me to understand why we need cluster roles and cluster role bindings instead of roles and role bindings while deploying Z2JK in Kubernetes? Currently I dont have cluster level access. I am having access to only one namespace.

It’s only used by the user scheduler - since it needs to schedule pods, it needs access to everything on the network. You can disable that if you want to run in a single namespace. More details on how to disable it at Optimizations — Zero to JupyterHub with Kubernetes documentation

@yuvipanda is still recommended to use userscheduler after almost 3 years? We are also facing a similar kind of situation, where deployments on k8s won’t allow us to have clusterrole and clusterrole bindings

It’s an optimisation, especially where your K8s cluster is dedicated to JupyterHub, but it’s definitely not required. If you’re running other applications too and your default K8s scheduler/autoscaler doesn’t give you the required performance you’re probably better of researching and configuring your own autoscaler/scheduler instead, since it’ll need to take into account all of your applications.