kyma-project / cli

Simple set of commands to manage a Kyma installation
Apache License 2.0
112 stars 118 forks source link

Allow referencing shared service instances via kyma CLI #1997

Closed kwiatekus closed 7 months ago

kwiatekus commented 8 months ago

Description Kyma cli should make it easy to create 'reference-instance' that references already existing service instances. This way users get an open path to binding to existing instances and also deleting kyma environment w/o the need to remove all phisically provisioned service instances

Execution

Reason Kyma CLI should enable users an effortless binding of service instances that were already created and marked as "shared" Cases for instance sharing:

Attachment https://www.youtube.com/watch?v=AYULBewzEwI https://help.sap.com/docs/btp/btp-cli-command-reference/btp-share-services-instance https://wiki.one.int.sap/wiki/display/CPC15N/%5BCookbook%5D+Service+Instance+Sharing

kwiatekus commented 7 months ago

A target service instance must be "shared" <-- for now we treat this as a prerequisite, i.e user must share it via btp cockpit or btp cli

Image

A kyma cli command to reference a shared instance in kyma runtime should create a service instance k8s resource (taking service offering name, and name of the shared instance from user input). It should use fixed reference-instance plan name

spec:
  externalName: object-store-ref
  parameters:
    referenced_instance_id: ''
    selectors:
      instance_label_selector: []
      instance_name_selector: object-store-cf
      plan_name_selector: ''
  serviceOfferingName: objectstore
  servicePlanName: reference-instance

and service binding

kwiatekus commented 7 months ago
 ./kyma-cli reference-instance --name-selector=kk-object-store --offering-name=objectstore --reference-name=kk-object-store-ref --kubeconfig=/Users/krzysztofkwiatosz/Downloads/cli.yaml

I would like to propose available options renaming:

if kubeconfig not provided please default to value of KUBECONFIG env.

Is it possible to avoid requiring user to provide --offering-name=? can cli guess based on target instance?

halamix2 commented 7 months ago