openshift / origin

Conformance test suite for OpenShift
http://www.openshift.org
Apache License 2.0
8.5k stars 4.7k forks source link

Using CLI to instantiate APB services #19002

Open siamaksade opened 6 years ago

siamaksade commented 6 years ago

OpenShift CLI doesn't seem to recognized services that are added to the the service catalog via the service broker. For example here is the output when looking for mysql:

# oc new-app -S mysql
Templates (oc new-app --template=<template>)
-----
mysql-persistent
  Project: openshift
  MySQL database service, with persistent storage. For more information about using this template, including OpenShift considerations, see https://github.com/sclorg/mysql-container/blob/master/5.7/root/usr/share/container-scripts/mysql/README.md.

NOTE: Scaling to more than one replica is not supported. You must have persistent volumes available in your cluster to use this template.
cakephp-mysql-persistent
  Project: openshift
  An example CakePHP application with a MySQL database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/cakephp-ex/blob/master/README.md.
dancer-mysql-persistent
  Project: openshift
  An example Dancer application with a MySQL database. For more information about using this template, including OpenShift considerations, see https://github.com/openshift/dancer-ex/blob/master/README.md.

Image streams (oc new-app --image-stream=<image-stream> [--code=<source>])
-----
mysql
  Project: openshift
  Tags:    5.6, 5.7, latest

Docker images (oc new-app --docker-image=<docker-image> [--code=<source>])
-----
mysql
  Registry: Docker Hub
  Tags:     latest

While there is also a MySQL APB in the service catalog:

screen shot 2018-03-16 at 13 00 39

How can one use oc new-app to instantiate APB services?

jwforres commented 6 years ago

@openshift/sig-developer-experience

jwforres commented 6 years ago

short answer is no, i'll let @bparees give a more detailed answer

bparees commented 6 years ago

Well the longer answer is "we could but i don't think we're going to". Making new-app search the service catalog offerings would overlap w/ whatever service catalog cli functionality is being created. (And then new-app would also have to implement the service catalog client apis to provision the things you found...again, this is better served by a first class cli for interacting with the service catalog).

That said your question seems to be two parts: 1) How can i use the cli to instantiate service catalog offerings. My understanding is we have a cli or one is coming, assigning to @pmorie to share more. 2) How can I use the oc new-app command to do this: You can't and we have no plans to make it possible.

siamaksade commented 6 years ago

How many CLIs are we going to have in order to interact with OpenShift? I can count 4 (oc, ocdev, svcat and apb) so far and I need to somehow know which CLI can do what I need to do. That is very complex for even an advanced user.

As a user, I want to deploy an item that is listed in OpenShift service catalog. To me, all items there are the same but you say I should know how each one is created (template, APB, etc) and based on that know which CLI (oc, svcat, etc) should be used to deploy that item?

@sspeiche @jorgemoralespou

thesteve0 commented 6 years ago

This would be unacceptable from a Middleware perspective. By unacceptable I mean, there has been no justification given why this decision is better than a single command line as well as no discussion with other BUs about the impact and tradeoffs . Can we please revisit this decision as it is anti-developer. There should be 1 cli and 1 web console for a developer to interact with OpenShift.

bparees commented 6 years ago

I would not expect it to be a new cli binary, I would expect subcommands off the oc binary. (e.g. "oc service-catalog provision")

but i defer to @pmorie who owns the service catalog to actually tell us what is coming or exists.

sspeiche commented 6 years ago

The plan was/is to have subcommands, whether those subcommands are plugins powered by svcat...it could work.

I do agree the flows including new-app should be service-catalog/class aware

jorgemoralespou commented 6 years ago

@bparees, then moving new-app into the plugins (and maybe create a set of developer plugins and include ocdev), but that would open the question on how to distribute, update plugins so that the experience of using plugins is sick.

openshift-bot commented 6 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

jorgemoralespou commented 6 years ago

/lifecycle frozen