Skip to content
DevOps AI ToolKit
Newsletter
All guides
AI for Kubernetes & Helm By James Joyner IV · · 9 min read

Kubernetes Error Guide: 'the server doesn't have a resource type' Missing CRD or Context

Quick answer

Fix Kubernetes 'error: the server doesn't have a resource type' errors: diagnose missing CRDs, wrong context or namespace, and removed API versions for kubectl commands.

  • #kubernetes
  • #troubleshooting
  • #errors
  • #crd
Free toolkit

Fixing errors like this? Get 500 free DevOps AI prompts

500 copy-paste AI prompts for the stack you actually run — one PDF, free.

Exact Error Message

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

Depending on the resource you asked for, the quoted kind changes — the server doesn't have a resource type "gateways", "prometheuses", "ingressroutes", and so on.

Overview

kubectl does not ship a hardcoded list of resource types. On each command it performs API discovery, asking the cluster which groups, versions, and kinds it serves, then maps the name you typed to one of them. When that mapping fails — because no CRD registers the kind, because you are pointed at the wrong cluster or namespace, or because the API version was removed — kubectl reports the server doesn't have a resource type "<kind>".

The error is about discovery, not about a specific object being absent. kubectl get pods myapp returning NotFound means the type exists but the object does not; the server doesn't have a resource type "pods" would instead mean the whole pods kind is unknown to the cluster you are talking to. That distinction points you straight at the cause.

Symptoms

  • kubectl get <kind> returns the server doesn't have a resource type "<kind>" for a resource you expect to exist.
  • helm install or kubectl apply fails with no matches for kind "<Kind>" in version "<group>/<version>".
  • The same command works against a different cluster or context.
  • kubectl api-resources does not list the kind you are querying.

Common Root Causes

1. The CRD is not installed

Custom kinds like Certificate, Gateway, or Prometheus only exist after their operator’s CRDs are applied. Query them before install and discovery finds nothing.

2. Wrong kubeconfig context or cluster

You are pointed at a cluster where that operator was never installed — common when juggling dev, staging, and prod contexts.

3. Wrong or missing namespace

The object exists but in another namespace; combined with a typo in the kind, kubectl can report the type as unknown.

4. API version removed or not yet served

A built-in moved GA and the old beta group was removed (for example Ingress leaving extensions/v1beta1), so the group/version you reference no longer exists on that server.

Diagnostic Workflow

Step 1: Confirm which cluster you are talking to

kubectl config current-context
kubectl cluster-info

Step 2: List every resource type the cluster actually serves

kubectl api-resources | grep -i certificate

If the kind is absent here, the cluster genuinely does not know it — a CRD or context problem.

Step 3: Check the API groups and versions

kubectl api-versions | grep cert-manager

A missing group confirms the operator/CRD is not installed; a present-but-different version points at a version-skew issue.

Step 4: Look for the CRD directly

kubectl get crd | grep -i cert-manager

Step-by-Step Resolution

  1. Verify you are on the intended cluster and switch if not:
kubectl config get-contexts
kubectl config use-context prod-cluster
  1. Check whether the kind is served at all:
kubectl api-resources | grep -i gateway
  1. If the CRD is missing, install the operator or its CRDs. For cert-manager as an example:
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download/cert-manager.yaml
kubectl get crd | grep cert-manager
  1. Re-run discovery-heavy commands after clearing the stale discovery cache, which kubectl keeps under ~/.kube/cache:
rm -rf ~/.kube/cache/discovery
kubectl get certificates -A
  1. If the kind exists but you were in the wrong namespace, target the right one explicitly:
kubectl get certificates -n istio-system
  1. If an API version was removed, migrate your manifests to the served version, then confirm with:
kubectl api-resources --api-group=networking.k8s.io

For rewriting manifests to current API versions in bulk, the DevOps AI prompt library has migration prompts.

Prevention

  • Install CRDs before the workloads or Helm releases that depend on them; many charts separate CRDs into a prerequisite step for this reason.
  • Pin and track the operator version alongside the cluster version so removed API groups do not surprise you on upgrade.
  • Use kubectl api-resources in onboarding docs so engineers can confirm which custom kinds a cluster serves.
  • Set explicit contexts in automation (--context) rather than relying on the ambient current-context.
  • Before a cluster upgrade, run kubectl api-resources and kubectl api-versions to catch kinds that the new version will stop serving.
  • Clear ~/.kube/cache/discovery in CI if you install CRDs and immediately query them in the same job.
  • error: the server doesn't have a resource type "<kind>" versus no matches for kind "<Kind>" in version "..." — the latter is the apply-time form of the same discovery gap.
  • Error from server (NotFound): <kind> "<name>" not found — the type exists, the object does not.
  • unable to recognize "file.yaml": no matches for kind — a manifest referencing an uninstalled or removed kind.
  • the server could not find the requested resource — a broader discovery/aggregation-layer failure.

Frequently Asked Questions

How is this different from a NotFound error? NotFound means the kind is known but no object of that name exists. the server doesn't have a resource type means the kind itself is unknown to the cluster — usually a missing CRD, wrong context, or removed API version.

Why does it work on one cluster but not another? Custom kinds depend on CRDs, which are installed per cluster. If the operator was applied to staging but not prod, the same kubectl get succeeds on one and fails on the other.

I just installed the CRD but kubectl still says the type is missing — why? kubectl caches discovery under ~/.kube/cache/discovery. Delete that directory (or wait for the cache TTL) and re-run so it re-discovers the new kind.

Could a cluster upgrade cause this for a built-in resource? Yes. When an API group graduates and its old beta version is removed, references to the old group/version stop resolving. Migrate manifests to the served version listed by kubectl api-resources.

For more discovery and CRD fixes, see the Kubernetes & Helm guides.

Free download · 368-page PDF

Get 500 Battle-Tested DevOps AI Prompts — Free

500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.

  • 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
  • Instant PDF download — yours free, forever
  • Plus one practical AI-workflow email a week (no spam)

Single opt-in · unsubscribe anytime · no spam.