crossplane / crossplane-cli

Tools and commands for managing and developing Crossplane
Apache License 2.0
14 stars 12 forks source link

Support provider plugins #62

Open hasheddan opened 4 years ago

hasheddan commented 4 years ago

Crossplane handles much of the operations to adopt existing infrastructure and begin managing it. However, it cannot determine what resources a user wants to adopt from their provider without fairly significant manual intervention by the user in some cases. It would be nice for the libraries used in providers to also be able to be used to generate CRs for existing infrastructure types. I imagine the experience looking something like this:

  1. crossplane-cli provides extension points for plugins to be installed. Maybe they are installed automatically if you use the CLI to install the provider into your cluster (see using labels on CRDs below).
  2. The provider plugins satisfy interfaces for getting resources from the provider via simple CLI commands.
  3. A user may list existing infrastructure using the CLI, then choose resources they wish to be rendered and applied as CRs for Crossplane to gain control of.

Much of this effort for providers would just be re-purposing existing code and supplying the appropriate endpoints. In fact, it may be possible to handle this as labels on the CRDs. For instance, a CRD for CloudSQL could include a label like get.cli.crossplane.io/endpoint: https://www.googleapis.com/sql/v1beta4/projects/{project}/instances.