KubeErrors

the server doesn't have a resource type: kubectl does not recognise the resource name you used

This means the short name or plural you typed does not map to any resource the cluster serves — a typo, a resource that needs a CRD, or a stale discovery cache.

Applies to: All Kubernetes versions

What it means

kubectl resolves a resource name against the cluster's discovery data, which includes each resource's plural, singular, and short names. When nothing matches, it reports that the server has no such resource type. Most often this is a spelling or pluralisation mistake, or a custom resource whose definition is not installed. The case worth knowing about is the stale cache: kubectl caches discovery on disk, so a resource added to the cluster very recently may be absent from the cache and produce this error despite existing.

Most common causes

How to diagnose it

  1. List what the cluster actually serves, with short names: kubectl api-resources.
  2. Search for the resource: kubectl api-resources | grep -i PARTIAL_NAME.
  3. Check whether the CRD exists: kubectl get crd | grep NAME.
  4. Clear the discovery cache to rule it out — the cache directory under the kubectl home can be removed safely.
  5. Check for unavailable aggregated APIs: kubectl get apiservices | grep -v True.

How to fix it

  1. Use the name shown by kubectl api-resources.
  2. Install the CRD or the operator providing the resource.
  3. Clear the discovery cache after installing new CRDs, or simply retry — it refreshes on its own interval.
  4. Restore an unavailable aggregated API server.
  5. Use a supported resource name for the cluster's version if the one you used was removed.

Notes

kubectl api-resources is the definitive answer for what a cluster serves, including every custom resource and its short names. It is faster than searching documentation, which may describe a different version or distribution.

Related

Sources

Pages on this site are written with AI assistance from the primary sources listed on each page, then checked against those sources before publishing.