kubectl "unable to recognize ... no matches for kind" (missing CRD) in CI - Fix it
A custom resource (CR) can only be applied after its CustomResourceDefinition (CRD) is registered. If kubectl apply hits the CR before the CRD is established, the API server has no mapping for that kind and reports "no matches for kind".
What this error means
A single kubectl apply -f over a directory fails with unable to recognize "cert.yaml": no matches for kind "Certificate" in version "cert-manager.io/v1", even though the CRD is in the same set.
error: unable to recognize "cert.yaml": no matches for kind "Certificate" in
version "cert-manager.io/v1"Common causes
The CRD is not installed yet
The operator or chart that registers the CRD has not run, so the custom kind is unknown to the API server.
CRD and CR applied in one unordered pass
kubectl applies files in order but does not wait for the CRD to become established before the CR in the same apply.
How to fix it
Apply the CRD first and wait for it
- Apply the CRD definition.
- Wait until the CRD condition is Established before applying the custom resources.
- Then apply the resources that depend on it.
kubectl apply -f crds/
kubectl wait --for=condition=Established crd/certificates.cert-manager.io --timeout=60s
kubectl apply -f app/Confirm the CRD is registered
Check that the API server now serves the custom kind before deploying CRs.
kubectl get crd | grep cert-manager
kubectl api-resources | grep certificatesHow to prevent it
- Separate CRD installation from CR deployment as ordered steps.
- Wait on
condition=Establishedfor CRDs before applying CRs. - Install operators that own the CRDs ahead of dependent manifests.