Is it possible to extend a Kubernetes CRD with a "sub-class" CRD?

2/7/2020

As an example, if I define a CRD of kind: Animal, can I define a CRD, Dog, as a specific type of Animal? The Dog CRD would have a different/extended schema requirement than the base Animal CRD.

My goal here is to be able to do a kubectl get animals and be able to see all the different type's of Animals that were created.

This seems to have been achieved by using the type metadata for certain resources like Secret, but I can't seem to find how to achieve this with a CRD.

Note: my real use case isn't around storing Animals, but, it's just a typical example from OOP.

-- ivandov
kubernetes
kubernetes-custom-resources

1 Answer

2/7/2020

No, this is not a feature of Kubernetes. All Secret objects are of the same Kind, and Type is just a string field.

-- coderanger
Source: StackOverflow