Stateful Sets don't automatically match all the persistent stores that are available, and some of them have even more complex logic requirements for managing the life cycle of the application. As Kubernetes looked at how to support extending its controllers to support more complex logic, the project started with the idea of Operators, external code that could be included in the Kubernetes project, and has evolved as of Kubernetes 1.8 to make this more explicit with CustomResourceDefinitions
. A custom resource extends the Kubernetes API, and allows for custom API objects to be created and matched with a custom controller that you can also load into Kubernetes to handle the life cycle of those objects.
Note
Custom Resource Definitions go beyond the scope of what we will cover in this book, although you should be aware that they exist. You can get more details about Custom Resource Definitions and how to extend Kubernetes at the project's documentation site: https:...