-
Notifications
You must be signed in to change notification settings - Fork 244
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
Add documentation on connecting to a service #6114
Add documentation on connecting to a service #6114
Conversation
✅ Deploy Preview for odo-docusaurus-preview ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
IBM OC tests are encountering this failure. Windows tests are also facing some issue related to serviceaccount. See logs. /override OpenShift-Integration-tests/OpenShift-Integration-tests |
@valaparthvi: Overrode contexts on behalf of valaparthvi: OpenShift-Integration-tests/OpenShift-Integration-tests, windows-integration-test/Windows-test In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
docs/website/docs/user-guides/advanced/_create-mongodb-service.mdx
Outdated
Show resolved
Hide resolved
docs/website/docs/user-guides/advanced/_create-mongodb-service.mdx
Outdated
Show resolved
Hide resolved
``` | ||
|
||
### Exit and cleanup | ||
Press `Ctrl+c` to exit `odo dev`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already in the output? Perhaps we don't need this in the doc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's alright to be explicit here before user proceeds with the next step.
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Co-authored-by: Armel Soro <armel@rm3l.org>
Co-authored-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
Update docs/website/docs/user-guides/advanced/_create-mongodb-service.mdx Co-authored-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
37769db
to
0a2128d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I reviewed before changes have been made! Noticed half way through the review. I'll submit these comments and review the rest at a later time.
|
||
### Implement the code logic | ||
:::note | ||
If you're already running `odo dev` in a terminal, exit it and start afresh. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense. I reccomend we remove all informal language however like "you're", so I reccomend this change:
|
||
2. [Install Percona Server Mongodb Operator via Operator Hub](https://operatorhub.io/operator/percona-server-mongodb-operator). | ||
:::note | ||
The operator will be installed in a new namespace called "my-percona-server-mongodb-operator" and will be usable from that namespace only. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this mess up deployment with the service if it's only usable in that namespace?
Maybe we should add instructions to deploy / use this Go application in the same namespace as the operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just realized that we don't need to. A service deployed in any namespace is still accessible to the Go application deployed in a different namespace.
Co-authored-by: Charlie Drage <charlie@charliedrage.com>
Co-authored-by: Charlie Drage <charlie@charliedrage.com>
Co-authored-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Parthvi Vala <pvala@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/override OpenShift-Integration-tests/OpenShift-Integration-tests |
@rm3l: Overrode contexts on behalf of rm3l: OpenShift-Integration-tests/OpenShift-Integration-tests In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
:::note | ||
The operator will be installed in a new namespace called "my-percona-server-mongodb-operator" and the service can only be deployed in this namespace. | ||
::: | ||
3. Create a MongoDB service. This service has been created with a minimal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??? sentence cuts off
```shell | ||
odo add binding \ | ||
--service mongodb-instance/PerconaServerMongoDB \ | ||
--service-namespace=my-percona-server-mongodb-operator \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like the fact that we have to specify this namespace throughout the guide? We should add this to the beginning of the guide / prerequisites that we can specify our own too. See other comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we're specifying it throughout the doc. It's only for this command, and while creating mongodb instance because that is the only namespace this CRD is accessible from.
|
||
2. [Install Percona Server Mongodb Operator via Operator Hub](https://operatorhub.io/operator/percona-server-mongodb-operator). | ||
:::note | ||
The operator will be installed in a new namespace called "my-percona-server-mongodb-operator" and the service can only be deployed in this namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The operator will be installed in a new namespace called "my-percona-server-mongodb-operator" and the service can only be deployed in this namespace. | |
The operator will be installed in a new namespace called "my-percona-server-mongodb-operator". the service can only be deployed in this namespace. |
Still we don't explain why this namespace :(, bit confusing IMO.
I think we should actually show to use kubectl
commands? Because then we can specify what namespace to install this.
2. [Install Percona Server Mongodb Operator via Operator Hub](https://operatorhub.io/operator/percona-server-mongodb-operator).
Install to the same namespace as your component:
kubectl create -n mynamespace -f https://operatorhub.io/install/percona-server-mongodb-operator.yaml
Obviously not "mynamespace" but something else?
This explains to the user that the service will be in a specific namespace, etc at the beginning of the doc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still we don't explain why this namespace :(, bit confusing IMO.
Oh. This namespace is created when you install the mongodb operator. But if it is confusing, I guess I could make the statements more verbose.
kubectl create -n mynamespace -f https://operatorhub.io/install/percona-server-mongodb-operator.yaml
this does not work because the targetNamespace for the operator is set to the one that it creates at the beginning.
|
||
// Connection URI | ||
var ( | ||
USERNAME = os.Getenv("PERCONASERVERMONGODB_MONGODB_USER_ADMIN_USER") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even I didn't realize that it actually shows the environment variable.. how could a new user know either when this doc is in an initial user guide?
A user can install mongodb operator and then realize after "what are the env variables again I should use?"
I think it's important to describe before this step that we should explain how these environment variables are retrieved / added under prerequisites.
Example, for Step 4 in prerequisites, we should describe how we are able to find out all these variables that can be used in your application.
## Step 5. Exit and cleanup | ||
Press `Ctrl+c` to exit `odo dev`. | ||
|
||
Delete the MongoDB instance that we had created. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stupid question, but why are we using kubectl / oc commands for deleting this mongodb instance?
Because odo delete binding
isn't added yet right?
We should add a note that we intent on implementing this so we update our documentation accordingly in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think we intend on implementing odo delete binding
. We already have odo remove binding
that will remove the binding from devfile.yaml, and eventually it will delete the ServiceBinding instance from cluster, but the mongodb instance stays the same.
Since we created the mongodb instance at the beginning, it's only fair that we remove it.
Signed-off-by: Parthvi Vala <pvala@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
Thanks for all the changes and being patient with my reviews! Looks great 💯
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cdrage, rm3l The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Kudos, SonarCloud Quality Gate passed!
|
/lgtm |
@valaparthvi: you cannot LGTM your own PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
/override Kubernetes-Integration-Tests/Kubernetes-Integration-Tests Doc only |
@feloy: Overrode contexts on behalf of feloy: Kubernetes-Integration-Tests/Kubernetes-Integration-Tests, OpenShift-Integration-tests/OpenShift-Integration-tests In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
* Add documentation to connect to a service Signed-off-by: Parthvi Vala <pvala@redhat.com> * Update docs/website/docs/user-guides/advanced/connecting-a-service.md Co-authored-by: Armel Soro <armel@rm3l.org> * Armel's review * Update docs/website/docs/user-guides/advanced/connecting-a-service.md Co-authored-by: Charlie Drage <charlie@charliedrage.com> * Toggle output Signed-off-by: Parthvi Vala <pvala@redhat.com> * fix case for MongoDB Signed-off-by: Parthvi Vala <pvala@redhat.com> * Update docs/website/docs/user-guides/advanced/connecting-a-service.md Update docs/website/docs/user-guides/advanced/_create-mongodb-service.mdx Co-authored-by: Charlie Drage <charlie@charliedrage.com> * Add Steps Signed-off-by: Parthvi Vala <pvala@redhat.com> * Add changes based on Charlie's review Signed-off-by: Parthvi Vala <pvala@redhat.com> * Update docs/website/docs/user-guides/advanced/connecting-a-service.md Co-authored-by: Charlie Drage <charlie@charliedrage.com> * Update docs/website/docs/user-guides/advanced/connecting-a-service.md Co-authored-by: Charlie Drage <charlie@charliedrage.com> * Update docs/website/docs/user-guides/advanced/connecting-a-service.md Co-authored-by: Charlie Drage <charlie@charliedrage.com> * more changes Signed-off-by: Parthvi Vala <pvala@redhat.com> * Finalize doc Signed-off-by: Parthvi Vala <pvala@redhat.com> * Add missing flag in command Signed-off-by: Parthvi Vala <pvala@redhat.com> Co-authored-by: Armel Soro <armel@rm3l.org> Co-authored-by: Charlie Drage <charlie@charliedrage.com>
Signed-off-by: Parthvi Vala pvala@redhat.com
What type of PR is this:
/kind documentation
/area documentation
What does this PR do / why we need it:
Which issue(s) this PR fixes:
Fixes #6077
PR acceptance criteria:
Unit test
Integration test
Documentation
How to test changes / Special notes to the reviewer: