Why CRD definition is required

Hi

Sorry I may be asking a dump question.

Since resources are stored in etcd in serialized form (json or protobuf), and since serialization/de-serialization done by the client/scheme, what is the real use of this CRD definition inside apiserver?.

One use I can think of is discovery, it may be giving single endpoints for all resources of same kind.

other wise another use is code-generator(controller, client etc), which is not a runtime use.

What is the real use of CRD definition inside apiserver?, where it helps?

-Nobin

It allows schematic validation, so you don’t pass a string where it expects an int. And discovery. And openapi docs. And more and more metadata and logic, over time.

Another search, on schematic validation showed up one good link, little deep in code.