k9s icon indicating copy to clipboard operation
k9s copied to clipboard

k9s UI shows stale context and cluster names while displaying resources from new context

Open 2b opened this issue 1 month ago • 1 comments




Describe the bug Context and cluster names don't refresh when switching between Kubernetes contexts via kubectl config use-context or kubectx

To Reproduce Steps to reproduce the behavior:

  1. Open k9s
  2. Select the appropriate context
  3. Switch context using either kubectl config use-context or kubectx
  4. k9s still displays the old context and cluster information in the top corner
  5. However, all resources shown are actually from the newly selected cluster

Expected behavior The context and cluster names need to update after a context switch. Or, k9s should show resources based on the context selected in k9s, not whatever's currently set via kubectl.

Versions (please complete the following information):

  • OS: Linux
  • K9s: v0.50.16
  • K8s: v1.33.5-gke.1201000

2b avatar Nov 12 '25 13:11 2b

@2b Hum can't seem to repro this as k9s seems to show the correct content (#5 above). I've tried on a couple different clusters via kubectx and can't repro. Are you certain about step-5? K9s should only load the context as selected and decouples from context set via the shell.

derailed avatar Nov 24 '25 20:11 derailed