I am installing Custom Resources through an Operator. However, kubectl apply
is blocked on
"Error from server (NotFound): customresourcedefinitions.apiextensions.k8s.io "my-crd.example.com" not found."
If there were a switch on kubectl apply
along the lines of --no-typechecking
, it would solve this. I would not cause a problem with a missing CRD, because the apply
just sends the Kubernetes objects to etcd. Then, by the time that the Operator actually constructs the Custom Resource, the Custom Resource Definition would be available. (I have other code that guarantees that.)
So, can I suspend the typechecking that produces this error?
No, you can’t use a CRD API without actually creating the CRD. It’s not a type check, it’s how the system works through and through.
You are saying that etcd itself is typesafe? So, any workarounds for this? As is, there is a temporal dependency, which goes against the spirit of declarative creation of resources.
No, etcd is not involved, that is an error from kube-apiserver which manages the kubernetes api.
As for temporal issues, it’s convergency, run it over and over until you have no errors :) tools like Kustomize and Helm also automatically sort input so crds are first, which usually helps.
You keep saying "typechecking". That's not a type check error. There is some optional support for OpenAPI schema verification on objects however what you have there is simply an HTTP 404 response from a REST API. You tried to access an object that does not exist.
There is no "meta-object". CRDs are normal K8s API objects like any other :)