-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
odo service create should add operator CR to the devfile #4160
Comments
I'm not sure what purpose does having both What is odo supposed to do with This is a proposal, IIUC. Do we have to implement things based on this proposal? Or do we use Few other questions (more along the lines of "thinking out loud"):
|
I think inline and
well I was hoping for this to be done in this sprint? only the devfile + operator backed service and that too just adding the CR into the devfile and still do that original work so we dont break operator backed services. Essentially
Yeah that is something I was thinking alot about and right now I would say no. Some more thinking on what kind of combination we are looking at
I bet there is a newer service catalog CR someone would have implemented to move the service catalog into an operator but I haven't searched about it. |
Sorry about writing an essay. I have a lot of questions around this and I couldn't find a better way to put it.
OK. And what would be a valid value for URI in this case? What would we like to store as URI? About storing the CRD in devfile. Currently, we don't support passing parameters for Then there's also this notion of keeping the information in devfile compatible with what Che might need.
If we put the CRD (the definition used to bring up the CR, a.k.a. service, provided by an Operator) in the devfile when doing Also, if I understand correctly, you mean to only add the CRD into devfile as Step 1 and not changing the flow to create the service when doing
OK. So what would be our approach to handle it? Separate code (as is the case right now)? Do we want to provide different UX to the users when they spin up a service using Operators vs. Service Catalog? By different approach, I mean that if we store CRD info in devfile, we eventually want to provide the ability to create a component+service in one From k8s point of view, I don't think we will/should be deprecating support for Service Catalog in a rush. OTOH, we could also deprecate it since it's no longer available on OCP and focus solely on Operators. This reduces the scope of bugs in odo code. IMO, we should think this hard because supporting both requires considering a lot of permutations and combinations. This piece is confusing and I'd prefer we think of reaching a conclusion sooner rather than later.
This means storing the CRD in the devfile. It doesn't mean actually spinning up a service when doing
At the moment, this scenario is not supported. I think I need to come up with a matrix about all the possibilities and their support status. Otherwise, this is quickly going to become insane.
We discussed under the hood conversion of s2i components to devfile on the Cabal. So I think this needs a rethink?
I'm not so sure about the CR/Operator for Service Catalog. But I think we can give a try to the steps mentioned here on a minikube setup. But again, I'd prefer we discuss how long we intend to support it. And I am seeking this info only because OCP doesn't support it anymore. |
It would be a public link to a kubernetes manifest and when there is something inline then the uri would be blank.
Agreed but for now lets not add the functionality of passing parameters - first step is simple and that is store the CRD in the devfile then maybe we can think about this
I asked the same question to tomas and he mentioned that the person who added the service operator in the devfile knows that their application wont function correctly without it so the person cloning the application should have the operator present and if not - its a good thing that push fails. We need to provide good error messages here though
Yes as this flow of storing the CRD in the devfile is still a smaller part of the whole puzzle we need to keep the original work intact until the new flow is completely implemented
|
👍 makes sense.
Ah, I didn't mean to stall this till we have parameters support. Totally agree about adding CRD info into devfile as a first step.
OK. So if the push fails for user2, what do we want the state of the component to be? Only the service creation on the cluster fails for them or does the entire push become invalid? I get it that this is not a part of the first step we just agreed on above, but this is going to be the next step, IIUC. Other questions remain unanswered. Can we discuss this as well because there are a lot of possible scenarios that we need to think of? cc @kadel In the meantime, I'll start looking into adding just the CRD to the devfile. |
The first thing that needs to be addressed is #4159 Once we have that For example command components:
- name: mymongo
kubernetes:
inlined: >
apiVersion: mongodb.com/v1
kind: MongoDB
metadata:
name: mymongo
spec:
credentials: my-credentials
members: 3
opsManager:
configMapRef:
name: my-project
persistent: true
type: ReplicaSet
version: 4.4.0-ent
status:
phase: Running
type: ReplicaSet
Will save the content of myetcd.yaml as a new kubernetes component in Devfile components:
- name: myetcd
kubernetes:
inlined: >
apiVersion: etcd.database.coreos.com/v1beta2
kind: EtcdCluster
metadata:
annotations:
etcd.database.coreos.com/scope: clusterwide
name: myetcd
spec:
size: 3
version: 3.2.13 Similarly with service catalog should result in adding the following kubernetes component into the devfile components:
- name: mymaria
kubernetes:
inlined: >
apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceInstance
metadata:
name: mymaria
namespace: tkral-test
spec:
clusterServiceClassExternalName: mariadb
clusterServicePlanExternalName: 10-3-22
parameters:
param-1: value-1
param-2: value-2 But again, before we tackle this we need to make sure that odo understands |
We can get rid of the But how/where do we want to store link related information? |
We need to create a separate issue for this. (just created #4208) The link will come as next after we have #4159 and this one. It will work similarly as |
This will not be possible to do before #4159 which is in turn dependent on devfile/api#216. |
Scope of this issue for current iterationFocussing on second acceptance criteria -
|
what about |
Managed to figure this out. For a devfile based component, when the user tries to create a Service Catalog backed service, the info gets added to $ odo service create dh-postgresql-apb psql --plan dev -p postgresql_user=luke -p postgresql_password=secret -p postgresql_database=my_data -p postgresql_version=9.6
Deploying service "psql" of type: "dh-postgresql-apb"
✓ Service "psql" was created
Progress of the provisioning will not be reported and might take a long time
You can see the current status by executing 'odo service list'
Optionally, link "dh-postgresql-apb" to your component by running: 'odo link <component-name>'
$ cat devfile.yaml
commands:
- exec:
commandLine: npm install
component: runtime
group:
isDefault: true
kind: build
workingDir: /project
id: install
- exec:
commandLine: npm start
component: runtime
group:
isDefault: true
kind: run
workingDir: /project
id: run
- exec:
commandLine: npm run debug
component: runtime
group:
isDefault: true
kind: debug
workingDir: /project
id: debug
- exec:
commandLine: npm test
component: runtime
group:
isDefault: true
kind: test
workingDir: /project
id: test
components:
- container:
endpoints:
- name: http-3000
targetPort: 3000
image: registry.access.redhat.com/ubi8/nodejs-14:latest
memoryLimit: 1024Mi
mountSources: true
sourceMapping: /project
name: runtime
- kubernetes:
inlined: |
apiVersion: servicecatalog.k8s.io/v1beta1
kind: ServiceInstance
metadata:
creationTimestamp: null
labels:
app: app
app.kubernetes.io/instance: psql
app.kubernetes.io/managed-by: odo
app.kubernetes.io/managed-by-version: v2.0.5
app.kubernetes.io/name: dh-postgresql-apb
app.kubernetes.io/part-of: app
name: psql
namespace: myproject
spec:
clusterServiceClassExternalName: dh-postgresql-apb
clusterServicePlanExternalName: dev
externalID: ""
parameters:
postgresql_database: my_data
postgresql_password: secret
postgresql_user: luke
postgresql_version: "9.6"
updateRequests: 0
status:
asyncOpInProgress: false
conditions: null
deprovisionStatus: ""
observedGeneration: 0
orphanMitigationInProgress: false
provisionStatus: ""
reconciledGeneration: 0
name: psql
metadata:
name: nodejs
version: 2.0.0
schemaVersion: 2.0.0
starterProjects:
- git:
remotes:
origin: https://github.com/odo-devfiles/nodejs-ex.git
name: nodejs-starter However, for an s2i based component, this won't work till we have addressed #4281 so that a |
What's done so far (#4465):
What's pending (scope of this issue for Sprint 198):
Question: |
@kadel PR #4465 implements the items discussed in #4160 (comment) and #4160 (comment). It's in review and I need to make a few changes to it for it to get merged. But overall, this issue has wider scope. For Sprint 199, what would you think we should cover in the scope? There's one question that I mentioned on a few calls - how would odo know which service to delete when I've added |
A complete picture of how this should work at the end.
|
So
What is the right thing to do? How do you suggest odo do the right thing? |
no it won't. If you did |
Considering the same example that I gave in #4160 (comment), should If we go with the former, we could keep If we go with the latter, we need to make sure that
When we show |
Well that's a lot of questions :). Let me give answering them a try:
All, because you might want to link to a service you just created within the component, or you might want to link to an 'external' service or one that already exists on the cluster.
I think that's a very good goal that we should try to keep. The labels should still tell us if some of them are part of a component, and we can show that, we just won't know if that component is local, on someone else's machine, or whatever.
I don't know if that's a frequent case, but yes, I think it should be possible. To c2 it's just another service and doesn't particularly care how it got there.
I don't follow that. If you're outside wouldn't it still know that s1 came from c1?
We should use labels that are as standard as we can find, but I agree not every tool will use them, and so we won't know anything about those services. If you were in c2's folder I thought the output might look something like this:
c1 was pushed by odo (maybe we could indicate this as well), but since we don't know where it came from we don't know the status. We're in c2 so we can output the status of those. app7 came from a different tool, but since it used labels we can at least fill the 'managed by' in, and the last service didn't have any labels. |
If we add the I'm assuming that
Makes sene. We'll need to make docs clearly say that I'll try to jot down the scope based on what we discussed on this issue. Thanks for your inputs @kadel & @deboer-tim |
Scope for next pass on this issue:
|
I'm considering adding the code to create service right before https://github.com/openshift/odo/blob/16946d4068f30f1e51cecc64877e535338b043b2/pkg/devfile/adapters/kubernetes/component/adapter.go#L175-L178 Thinking along these lines because there's a call to the function @kadel @mik-dass @girishramnani @valaparthvi if you have a differing opinion/suggestion, let me know. |
Scope of this issue for Sprint 201:
I'll defer documentation till we have properly defined structure via #4664. |
@feloy I noticed that the state doesn't show up when running this command outside of a component directory. I don't think I have a question here, just an fyi, or is this expected for now and we'll be iterating over it? ➜ odo git:(pr/4819) odo service list
NAME MANAGED BY ODO STATE AGE
Database/bkddb Yes (bkd) 15m22s |
/kind user-story
User Story
As a developer working with odo, when I add a new service to the application (like DB), I want to be able to easily share service definitions with my team so they can start the application with the service in the same way as me.
Acceptance Criteria
odo service create
should not create any services on cluster (Creates service on cluster upon "odo push" #4650)odo service create
should store service definition in devfile askubernetes
component (ServiceInstance
for SericeCatalog or CR for operator backed service) (Add and remove service info from devfile #4465)odo service delete
should delete the service from devfile (remove appropriatekubernetes
component). Deletion from the cluster will happen onceodo push
is executed (similar to how we handle URLs).odo service list
should list services and their status. Important is to differentiate between statues like DeletedLocally, DeletedRemotely etc... (Similarly to what odo does for URLs)(being tracked by odo link should store link information in devfile #4208)odo link
should add Service Binding information to devfile.yaml andodo unlink
should remove it from the file. Subsequentodo push
should create/delete the actual link (a Service Binding).Links
/kind user-story
The text was updated successfully, but these errors were encountered: