How to extend Kubernetes with custom resource definitions
Let's start with the basics. What is a CRD? We know that Kubernetes has an API model where we can perform operations against resources. Some examples of Kubernetes resources (which you should be well acquainted with by now) are Pods, PersistentVolumes, Secrets, and others.
Now, what if we want to implement some custom functionality in our cluster, write our own controllers, and store the state of our controllers somewhere? We could, of course, store the state of our custom functionality in a SQL or NoSQL database running on Kubernetes or elsewhere (which is actually one of the strategies for extending Kubernetes) – but what if our custom functionality acts more as an extension of Kubernetes functionality, instead of a completely separate application?
In cases like this, we have two options:
- Custom resource definitions
- API aggregation
API aggregation allows advanced users to build their own...