-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Replace ConfigMaps with Config CRDs #8114
Copy link
Copy link
Open
Labels
area/APIAPI objects and controllersAPI objects and controllerskind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.kind/featureWell-understood/specified features, ready for coding.Well-understood/specified features, ready for coding.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.triage/acceptedIssues which should be fixed (post-triage)Issues which should be fixed (post-triage)
Milestone
Metadata
Metadata
Assignees
Labels
area/APIAPI objects and controllersAPI objects and controllerskind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.Categorizes issue or PR as related to cleaning up code, process, or technical debt.kind/featureWell-understood/specified features, ready for coding.Well-understood/specified features, ready for coding.lifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.Indicates that an issue or PR should not be auto-closed due to staleness.triage/acceptedIssues which should be fixed (post-triage)Issues which should be fixed (post-triage)
In what area(s)?
/area API
Describe the feature
Currently, all of our configuration relies on well known ConfigMaps placed next to our control plane. The components pick up the config in those ConfigMaps through an informer on ConfigMaps and they then parse the
map[string]stringtyped data into a struct which is then used by the individual components.This is all nice and it works in principle. It has a few drawbacks though:
_exampleblock at the top of each ConfigMap that is supposed to document the available keys. A ton of users stumbled over this and it's arguably a hacky way of providing documentation.Config CRDs
Instead of ConfigMaps, we could use Configuration CRDs, i.e. CRDs that represents the same data as the ConfigMaps do today, but in a structured way, for example
AutoscalerConfiguration,DeploymentConfigurationetc. They could have an openAPI schema, telling the user directly which fields are supported and what format we expect in them. Their APIs can be versioned just like any other API we ship, making it easier to do controlled breaking changes while giving clear guarantees on compatibility.This is especially important for the operator. Currently, we ship the operator with a
spec.configfield which ismap[string]map[string], a map of maps, each able to represent a ConfigMap's content. Essentially, by putting this in the operator API, we kinda commit to a certain schema (maybe not because it's a map of maps and it's willynilly but you get the idea).Having versioned Configuration APIs in the upstream (Knative Serving in this case) would be great wrt. guarantees and construction for the API as a whole.
Further down the line, this could potentially also open up the possibility to define per-namespace configuration as proposed in #7711. Generally agreeing on Configuration CRDs across the project would probably make per-namespace configuration trivial as it'd mostly come down to scoped informer calls to fetch the respective configuration for a given resource. But that's a stretch goal.