Home › Kubernetes

error: the server doesn't have a resource type (Kubernetes) — how to fix

error: the server doesn't have a resource type "ingressroutes"
error: the server doesn't have a resource type "pod"

Quick fix: List what the cluster serves: kubectl api-resources | grep -i <name>. Fix the spelling or install the CRD (e.g. the operator/Helm chart that provides it). If the CRD was just installed, clear the cache: rm -rf ~/.kube/cache. Check you're on the right cluster with kubectl config current-context.

What it means

When you run kubectl get foo, kubectl first maps foo to a REST resource using the API server's discovery data (which kubectl caches under ~/.kube/cache). If no API group serves a resource called foo (by plural, singular, short name or kind), you get this error before any request is made.

The applying-manifests version of the same problem is no matches for kind "X" in version "Y".

Cause 1: typo or wrong name

Check the names the cluster accepts:

kubectl api-resources                       # NAME, SHORTNAMES, APIVERSION, KIND
kubectl api-resources | grep -i ingress

Resource names are case-insensitive and accept the plural (deployments), singular (deployment), and short name (deploy). Things that look valid but aren't:

Cause 2: the CRD isn't installed

Custom resources such as certificates (cert-manager), ingressroutes (Traefik), servicemonitors (Prometheus Operator), virtualservices (Istio) or applications (Argo CD) only exist once their CustomResourceDefinition is installed.

kubectl get crd | grep -i servicemonitor

If it's missing, install the operator or its CRDs. Examples:

# cert-manager
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.1/cert-manager.yaml

# Prometheus Operator CRDs via Helm
helm install prometheus-operator-crds prometheus-community/prometheus-operator-crds

Use the version that matches your setup; Helm charts sometimes skip CRDs on upgrade (helm upgrade never updates the crds/ folder), so you may need to apply them manually.

Cause 3: stale discovery cache

If you installed a CRD seconds ago, or the cluster was upgraded, kubectl may still use cached discovery data. Clear it:

rm -rf ~/.kube/cache/discovery ~/.kube/cache/http
kubectl api-resources | grep -i <name>

Also make sure the CRD finished registering:

kubectl wait --for condition=established crd/ingressroutes.traefik.io --timeout=60s

Cause 4: wrong cluster or context

The resource exists, just not in the cluster you're talking to:

kubectl config current-context
kubectl config get-contexts
kubectl config use-context prod-cluster

The same message appears for built-in types (pods, nodes) when discovery fails entirely, e.g. the kubeconfig points at something that isn't a Kubernetes API, or RBAC forbids discovery. Run with verbose output to see the underlying errors:

kubectl get pods -v=6

If you see 401/403 on /api or /apis, fix authentication first (You must be logged in to the server, Forbidden).

Cause 5: removed API in a newer Kubernetes version

Resources that were removed (e.g. podsecuritypolicies in 1.25) no longer appear in discovery. Use the replacement (Pod Security Admission labels on namespaces) and check the Kubernetes deprecation guide for your version.

Cause 6: aggregated API not available

For resources served by an aggregated API server (e.g. kubectl top and metrics.k8s.io from metrics-server), check its APIService:

kubectl get apiservices | grep -v True

An entry with False (MissingEndpoints) means its backing pod is down; fix that deployment.

Last updated 2026-11-11.