no matches for kind in version: removed APIs and missing CRDs
kubectl cannot map the manifest to an endpoint. Either the API version was removed or the CRD is absent, and discovery tells you which.

Introduction & Quick Summary
error: resource mapping not found for name: "web" namespace: "prod" from "deploy.yaml":
no matches for kind "Deployment" in version "extensions/v1beta1"
ensure CRDs are installed firstThe API server's discovery data has no resource type at that group and version, so kubectl cannot map your document to an endpoint. Nothing was applied; the only side effect is a nonzero exit code.
Two families of cause, and the message tells you which:
- The API version was removed.
extensions/v1beta1for Ingress,batch/v1beta1for CronJob,policy/v1beta1for PodSecurityPolicy andautoscaling/v2beta2all reached end of life. The fix is a manifest edit, not a cluster change. - The custom resource definition is missing. The kind exists in your CRD but not in the cluster, because the CRD was never applied, was applied to another context, or was applied in the same
kubectl apply -f .pass that contains the custom resources.
The hints in the message matter:
| Message fragment | Meaning | Action |
|---|---|---|
no matches for kind ... in version ... | Group/version not served | Check kubectl api-resources |
ensure CRDs are installed first | CRD-dependent kind | Apply CRDs, wait for Established |
unable to recognize "file.yaml" | Older kubectl wording, same cause | Same |
the server could not find the requested resource | Wrong path or dead API group | Check discovery, then the version |
no matches for kind but the kind works elsewhere | Wrong kubeconfig context | kubectl config current-context |
Core Mechanics, Signatures & Reproducible Setup
kubectl resolves a kind through discovery: group, version, resource, and whether the resource is namespaced. Discovery is served from /api for the core group and /apis for everything else, and it is cached in ~/.kube/cache for ten minutes. A CRD appears in discovery only after its Established condition is true, which is why applying CRDs and custom resources in one directory can fail on a fast cluster.
Inspect what the cluster actually serves:
kubectl api-resources --api-group=apps
kubectl api-versions | sort
kubectl explain ingress.spec --api-version=networking.k8s.io/v1 | head -20Reproduce the deprecated API case without a cluster by validating a manifest:
# ingress-old.yaml
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: web
spec:
backend:
serviceName: web
servicePort: 80kubectl apply --dry-run=server -f ingress-old.yaml
# error: resource mapping not found ... no matches for kind "Ingress" in version "extensions/v1beta1"The current equivalent changes both the version and the shape, because backend was replaced by defaultBackend and pathType became required:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: web
spec:
defaultBackend:
service:
name: web
port:
number: 80
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: web
port:
number: 80For CRD ordering, split the apply and wait for establishment:
kubectl apply -f crds/
kubectl wait --for condition=established --timeout=60s crd/certificates.cert-manager.io
kubectl apply -f resources/Key Comparison Table
| API group/version | Kind | Removed in | Replacement |
|---|---|---|---|
extensions/v1beta1 | Ingress | 1.22 | networking.k8s.io/v1 |
batch/v1beta1 | CronJob | 1.25 | batch/v1 |
policy/v1beta1 | PodSecurityPolicy | 1.25 | Pod Security Admission |
autoscaling/v2beta2 | HorizontalPodAutoscaler | 1.26 | autoscaling/v2 |
flowcontrol.apiserver.k8s.io/v1beta2 | FlowSchema | 1.29 | v1beta3 or v1 |
cert-manager.io/v1alpha2 | Certificate | CRD-dependent | cert-manager.io/v1 |
| Check | Command | What it proves |
|---|---|---|
| Cluster serves the version | kubectl api-versions | Group/version exists |
| Kind exists in that version | kubectl api-resources --api-group=<g> | Resource mapping exists |
| CRD is installed | kubectl get crd <plural>.<group> | Object exists |
| CRD is ready | kubectl wait --for condition=established | Discovery will include it |
| Manifest matches | kubectl apply --dry-run=server | Server accepts it without mutating |
Practical Edge Cases, Error Fixes & Deep Dive Code Examples
Case 1: A Helm chart that ships CRDs in the wrong folder
Helm installs crds/ before templates, but crds/ files are not upgraded and are never templated. A chart that puts CRDs under templates/ races its own custom resources. Keep crds/ for the definitions and guard the resource with a capability check:
{{- if .Capabilities.APIVersions.Has "cert-manager.io/v1" }}
apiVersion: cert-manager.io/v1
kind: Certificate
{{- end }}Case 2: Metrics API missing after a fresh install
error: unable to fetch metrics from resource metrics API: the server could not find the requested resourcemetrics.k8s.io is an aggregated API served by metrics-server. If kubectl api-resources lacks it, install metrics-server and wait for the APIService to become available:
kubectl get apiservice v1beta1.metrics.k8s.io -o yaml | grep -A3 conditionsCase 3: Two contexts, one manifest
A CRD applied in staging is absent in prod. Verify the context before debugging the YAML:
KUBECONFIG=~/.kube/prod kubectl config current-context
KUBECONFIG=~/.kube/prod kubectl get crd | grep example.comkubectl config view --minify -o jsonpath='{..namespace}' also reveals whether a namespace default is causing a misleading "not found" on namespaced resources.
Case 4: Aggregated API that is registered but unhealthy
An APIService object can exist while its backing service has no ready endpoint, so discovery omits the group entirely. Look for False availability:
kubectl get apiservice -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.conditions[?(@.type=="Available")].status}{"\n"}{end}' | grep FalseCase 5: A CRD schema that rejects the version at admission
Once the version is served, the next failure is usually validation. Dry-run on the server so schema errors surface before the real apply:
kubectl apply --dry-run=server -f resource.yaml -o yaml | head -40--dry-run=client only checks what kubectl can see locally and cannot validate CRD schemas, which is why it passes on manifests the server rejects.
Case 6: Server-Side Apply and field manager conflicts
After switching to kubectl apply --server-side, a removed field can reappear from another manager's field set, and a kind mismatch can look like a version problem. Inspect ownership:
kubectl get deployment web -o yaml --show-managed-fields | grep -A2 managedFieldsCommon Compilation/Runtime Mistakes & Version Gotchas
kubectlskew. Akubectlolder than the cluster can lack discovery hints for new versions, while a much newer one drops old API handling. Keep within one minor version of the control plane.- Discovery cache. After installing a CRD,
kubectlcan still report no match for up to ten minutes. Delete~/.kube/cacheor use--cache-dir=/tmp/freshwhen in doubt. apiVersioncasing.apps/V1andNetworking.k8s.io/v1are not valid; the group is lowercase and the version starts withv.- kustomize patches silently dropping fields. A strategic merge patch written against
extensions/v1beta1leaves anapiVersionolder than the base, and the error then points at the generated output. Render first withkubectl kustomize . | head. - Cluster upgrades. Managed clusters jump minors at once, removing several API versions in a single step. Run
kubectl get --raw /metrics | grep apiserver_requested_deprecated_apisbefore an upgrade to count real usage. - Offline validation. Tools that validate against a bundled schema rather than a live cluster will accept versions your cluster does not serve. Prefer
--dry-run=serverin CI against a real ephemeral cluster.
When the failing object is the CRD itself and the schema is huge, extract the spec.versions block and clean it up with the YAML viewer to spot an inconsistent served, storage or schema combination. If an API version change implies a payload change, compare the old and new manifests with the diff tool before applying. For verifying that the API server is reachable at all, the curl generator can build an authenticated request against /apis to see the raw discovery document.
Primary references: the Kubernetes deprecated API migration guide lists removals per release, and Custom Resource Definitions documents served, storage and establishment conditions.
Official references
primary documentationThe Kubernetes documentation that defines the behaviour this guide explains.
Try matching browser tools
All toolsSmall utilities that fit Kubernetes work — they run entirely in this browser tab, so nothing you paste leaves your device.
Related Kubernetes guides
All Kubernetes guidesKubernetes 1.35: kubelet will not start on a cgroup v1 node
A 1.35 kubelet refuses a cgroup v1 host, and the removed pod-infra flag stops custom images. Check the kernel command line before the node pool.
Kubernetes: x509 certificate has expired or is not yet valid
kubeadm control plane certificates last one year. Renew them, restart the static pods, refresh kubeconfigs, and alert before the next expiry.
kubectl: metadata.resourceVersion: Invalid value: 0x0
The 0x0 error means an update carried no resourceVersion. Switch to apply or patch, or read the live object first, and keep versions out of Git.
kubectl apply: metadata.annotations: Too long: must have at most 262144 bytes
Client-side apply copies the manifest into an annotation. Use server-side apply, remove the legacy annotation, and resolve field conflicts once.
More in Kubernetes
All Kubernetes guidesThe guides filed next to this one in Kubernetes, in library order.