C3W3 Error CustomResourceDefinition

Hello Learners,

I am getting the error while executing the command kubectl apply --kustomize tf-training/tf-job-crds/base

error: unable to recognize “tf-training/tf-job-crds/base”: no matches for kind “CustomResourceDefinition” in version “apiextensions.k8s.io/v1beta1

Any idea on how to resolve this issue?.


Hi there, also running into this problem. Couldn’t really find a solution other than a possible mismatch between the version of kubectl and some of the definitions in the crd.yaml file. This error is blocker in-regards to completing the lab.

I’ve pasted the version of kubectl that I was using, hope that helps.

student_02_6792be1d58db@cloudshell:~ (qwiklabs-gcp-01-573fe1391c7f)$ kubectl version
Client Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.2”, GitCommit:“9d142434e3af351a628bffee3939e64c681afa4d”, GitTreeState:“clean”, BuildDate:“2022-01-19T17:35:46Z”, GoVersion:“go1.17.5”, Compiler:“gc”, Platform:“linux/amd64”}
Server Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.6-gke.300”, GitCommit:“df413ee6225aa3fc539e18ca3464a48d723bd3ea”, GitTreeState:“clean”, BuildDate:“2022-01-24T09:29:08Z”, GoVersion:“go1.16.12b7”, Compiler:“gc”, Platform:“linux/amd64”}

Seems like it is related to Kubernetes API and Feature Removals In 1.22: Here’s What You Need To Know | Kubernetes

Yes. It is a problem with new versions of Kubernetes.
I tried using the older version (not always the best solution in real life, but I guess it’s OK for finishing this Lab). Just use this command to create the cluster:
gcloud beta container clusters create $CLUSTER_NAME --project=$PROJECT_ID --cluster-version=1.21 --machine-type=n1-standard-4 --scopes compute-rw,gke-default,storage-rw --num-nodes=3


Confirming that setting the cluster version to 1.21 did resolve the problem. Thanks, Nikolina.


Thanks Nikolina… The issue got resolved…

Used Nikolina’s solution, still getting the same warning as below.

Warning: apiextensions.k8s.io/v1beta1 CustomResourceDefinition is deprecated in v1.16+, unavailable in v1.22+; use apiextensions.k8s.io/v1 CustomResourceDefinition
customresourcedefinition.apiextensions.k8s.io/tfjobs.kubeflow.org created

It failed to install. Later, this led to failing of pods creation at TFJob submit step.

I guess, an updated manifest files for TFJob should be helpful.