#3992·k9s

Can't run plugins in empty namespaces

Author: markmsmithCreated May 12, 2026Updated Sep 17, 2026
Labelsenhancementstale



Describe the bug I have a plugin to launch a debug pod when in the pod view, but if I try to run it while viewing a namespace that doesn't contain any pods, the plugin fails to run, with no output in the log.

To Reproduce

  1. Add an entry to plugins.yaml in your config dir
bash
  debug-standalone:
    shortCut: Shift-B
    description: "Standalone debug pod"
    scopes:
    - po
    command: bash
    background: false
    args:
    - -c
    - |
      export DEBUG_IMAGE="nicolaka/netshoot:latest"
      export DEBUG_CONTAINER_NAME="debug-$(echo -n $(whoami) | tr -sC '[:alnum:]' '-')-$(date -j -u '+%Y-%m-%d-%H-%M')"
      echo "Debug pod: $DEBUG_CONTAINER_NAME"
      echo "Debug image: $DEBUG_IMAGE"
      echo "Namespace: $NAMESPACE"
      sleep 5
      kubectl run "${DEBUG_CONTAINER_NAME}" \
        --image="${DEBUG_IMAGE}" \
        --timeout=60s \
        --rm=true \
        --labels='istio.io/rev=default' \
        -it \
        -n "$NAMESPACE" --context="$CONTEXT" --kubeconfig="$KUBECONFIG"
  1. Create an empty namespace on your cluster kubectl create ns test-namespace
  2. Connect to your cluster with k9s
  3. View pods in your test namespace
: po test-namespace
  1. Use the plugin shortcut, shift-b in this case
  2. The pod should start but it doesn't.
  3. Try in a namespace that has existing pods and it will work.

Historical Documents

k9s.log:

2026-05-12T13:58:54-04:00 INF  K9s starting up...
2026-05-12T13:58:57-04:00 INF ✅ Kubernetes connectivity OK
2026-05-12T13:58:58-04:00 WRN CustomView watcher failed error="lstat /Users/<my user>/Library/Application Support/k9s/views.yaml: no such file or directory"
2026-05-12T13:59:00-04:00 WRN No resources found for v1/pods in "test-namespace" namespace

Expected behavior

The pod should launch within the namespace and drop me in to the shell.

Versions:

  • OS: OSX Tahoe 26.4.1 (25E253)
  • K9s: v0.50.18 (installed via homebrew)
  • K8s: v1.34.3