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.
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.
- 1The name of the resource is misspelled
- 2The resource exists, but in a different namespace than the one being queried
- 3The resource was deleted before the command was run
A `kubectl` command to get, describe, or delete a resource fails with a 'NotFound' message.
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
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
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.
✕ 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.
k8s.io/apimachinery/pkg/api/errors/errors.go
Content generated with AI assistance and reviewed for accuracy. Found an error? hello@errcodes.dev