-
Notifications
You must be signed in to change notification settings - Fork 41.7k
Description
Introduction
Continued from #7111 and #2306 (also relevant: #3806, #6363).
There is a strong desire for kubernetes to support multiple API prefixes. This would allow us to split to the API into a more logical structure and introduce support for an experimental API prefix. Additionally, we would like to separately version different parts of the API and provide sensible scoping rules for API objects.
OpenShift serves its own objects separately from kubernetes objects using the /osapi endpoint. However, it registers its objects under the kubernetes api.Scheme (instead of a separate runtime.Scheme) and is forced to follow the kubernetes version numbers. Moreover, OpenShift's "kinds" must be unique to avoid clashing with those in kubernetes. We would like a more general approach to avoid these limitations.
Proposed Hierarchy
To achieve this, the api could have the following hierarchy: provider/apigroup/version/kind with the following properties:
- Any version/kind should be convertible to the corresponding version/kind within the same API group
- API groups within the same provider should be able to refer to objects within other groups. This is needed for things like namespaces and lists, as well as experimental API groups.
In the existing API server, a runtime.Scheme somewhat approximates a provider/apigroup, while an apiserver.APIGroupVersion corresponds to a version.
Challenges
- Much of the code assumes that only one prefix, runtime.Scheme, and related structures exist. This is especially problematic for things like namespaces.
- Referring to types in other runtime.Schemes requires that they (along with conversion and defaulting functions) be registered with the current runtime.Scheme and version.
- The master does core API-specific work (link)
- Registering new prefixes/versions/objects requires dealing with too many things (see Our API code is hard to understand #2306 and Proposal: Long term evolution of runtime.Scheme / conversion.Scheme #7111)