kubectl can't find a kubeconfig with a current context: file missing, KUBECONFIG pointing nowhere, or context deleted. Find what it's actually reading, then set the context deliberately.
Multiple tools write ~/.kube/config (or export KUBECONFIG with several files). A broken merge or a stale var pointing at a deleted file leaves kubectl with nothing. kubectl config view --raw shows what it reads.
Secret not mounted, base64 decode skipped, or the file landed at a path KUBECONFIG doesn't name. Print KUBECONFIG in the pipeline and ls the path.
echo $KUBECONFIG ; ls -la ~/.kube/ 2>/dev/null ; kubectl config view --raw 2>&1 | head -10
export KUBECONFIG=~/.kube/config:~/.kube/eks.yaml ; kubectl config get-contexts
kubectl config use-context <context> && kubectl config current-context
ls -la $KUBECONFIG 2>/dev/null || ls -la /etc/kube/ ; head -1 $KUBECONFIG # should start with 'apiVersion:'
KUBECONFIG accepts a colon-separated list; kubectl merges them — order decides who wins on conflicts. kind/minikube rewrite ~/.kube/config's context list: a stale current-context pointing at a deleted cluster produces this exact error.
Your current-context still names it. kubectl config use-context <a-valid-one> (after kubectl config get-contexts) clears it. Kind/minikube churn makes this a recurring annoyance: check the current context after cluster deletes.
One file per environment under ~/.kube/ with KUBECONFIG chaining them (colon-separated), or a kubectx-style switcher. Avoid tools overwriting the single default config silently.
Kustomize base with probes, PDBs, and zero-downtime rollouts already wired.
Kubernetes Production Blueprints — $27 →One-time. Yours to modify. Instant download from the NinjaOps template store.