NotFound (resource)
KubernetesERRORCriticalAPI InteractionHIGH confidence

The requested resource was not found

Production Risk

This error is usually benign and part of routine operations, but in an automated script, it could indicate a failure in a previous step that was supposed to create the resource.

What this means

The Kubernetes API server reports that a specific resource you are trying to access does not exist. This is a standard HTTP 404 error, indicating a client-side mistake like a typo or incorrect namespace.

Why it happens
  1. 1The name of the resource is misspelled
  2. 2The resource exists, but in a different namespace than the one being queried
  3. 3The resource was deleted before the command was run
How to reproduce

A `kubectl` command to get, describe, or delete a resource fails with a 'NotFound' message.

trigger — this will error
trigger — this will error
kubectl get pod my-pod-123

expected output

Error from server (NotFound): pods "my-pod-123" not found

Fix 1

Check for typos and the correct name

WHEN The resource name may be incorrect

Check for typos and the correct name
kubectl get pods

Why this works

List all resources of the same type in the current namespace to find the correct name. Pods created by deployments have random suffixes that are easy to mistype.

Fix 2

Search across all namespaces

WHEN The resource may exist in a different namespace

Search across all namespaces
kubectl get pod my-pod-123 --all-namespaces

Why this works

The `--all-namespaces` (or `-A`) flag tells kubectl to search for the resource across every namespace in the cluster, which helps locate it if you are in the wrong context.

What not to do

Ignore the error and assume the resource will appear

A 'NotFound' error is definitive. The resource does not exist at that moment. The underlying cause (like a failed deployment) must be investigated.

Sources
Official documentation ↗

k8s.io/apimachinery/pkg/api/errors/errors.go

Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev

← All Kubernetes errors