crossplane / example-cnp

Platform API as Configuration
Apache License 2.0
11 stars 5 forks source link

Should installing a Configuration include instantiating composite resources? #4

Open negz opened 4 years ago

negz commented 4 years ago

Currently this sketch assumes that Configurations only extend Crossplane; they use the Composition types to teach Crossplane how to manage new kinds of resources (e.g. VPCs) but don't actually create those resources. It's possible that a platform builder may wish their Configuration to bootstrap a platform. For example a Configuration that teaches Crossplane about a new AcmeSQLInstance type may wish to create a VPC in which AcmeSQLInstances will be created when it is installed.

negz commented 4 years ago

I'd like to validate how useful/common this functionality would be, because I suspect it might make Configurations harder to reason about; they would both define types and create instances rather than simply defining types. We probably don't want a Configuration to be able to create an arbitrary CR, so we'd have to have some way of ensuring that a Configuration was trying to create instances of a defined composite resource (defined either in that Configuration or through some other means).

Can folks with possible use cases for this functionality comment here to help flesh them out?

negz commented 4 years ago

Note that @prasek added something related to this in #9. I think I like the approach, which I think is roughly that configurations that contain an XRD can optionally provide a hint to UIs (e.g. UbC) that they should prompt the installer to create an instance of the defined XR at configuration install time.

Note there's another approach here which is just letting folks put static instances of the XR in the package. That's still an open question, but seems like it could get hairy to me.