K8s namespace autocomplete quite slow

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

Kubernetes version: 1.28.2
Cloud being used: bare-metal
Host OS: CentOS
CNI and version: Weave
CRI and version: Don’t know

Hi everybody. I manage this k8s cluster with Jupyterhub for a university, and we have a lot of students using it. Every student user gets their own namespace, so we have something on the order of 2000 namespaces.

This makes it so when I try to autocomplete the namespace when typing out kubectl commands, the command prompt freezes and takes a couple of seconds to resolve the autocomplete. Maybe what’s slow is that it’s retrieving all the k8s objects from the API? Maybe it’s the autocomplete itself?

Whatever it is, I keep hitting tab by instinct and having to Ctrl-C out as the prompt freezes. It started out as not a big deal but it is starting to get a bit annoying having to manually type out long namespace names every time I need to use kubectl. Is this an issue that other people are experiencing as well?

1 Like