-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
deploying a loopback 4 application to kubernetes on the IBM Cloud #2160
Conversation
originated from : #1606 |
Hi @dremond71, thank you for the pull request. Please sign our CLA here: Next, make sure The commit message is not following our guidelines, but that can be fixed at the end. |
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.
Awesome content. I am not familiar with Kubernetes myself, but the guide is so detailed that I am pretty confident I'll be able to deploy LB4 to Kubernetes now.
I wish the process could be more automated and required less steps, but that's out of scope of this pull request.
Great work! ❤️
|
||
# References | ||
|
||
[Getting started with the IBM Cloud CLI](https://cloud.ibm.com/docs/cli/index.html#overview) |
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.
Please reformat this section as a list of bullet points, e.g.
- [Getting started with the IBM Cloud CLI](...url...) will help you to install all the CLIs you will need
- [Kubernetes CLI (kubectl)](...url...)
- etc.
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.
done
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.
done
I see the old version here (no list of bullet points), could you @emonddr please check?
|
||
## Step 1: Scaffold LoopBack 4 app | ||
|
||
Run ````lb4 app```` command. |
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.
Not sure why ```` is used.
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.
fixed. thx.
|
||
Run ````lb4 app```` command. | ||
|
||
```` |
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.
It should be ```.
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.
done
|
||
It is important for the host to be ````'0.0.0.0'```` and the port to be consistent in several places. We will use a port of ````8080````. | ||
|
||
```` |
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.
Use ```ts
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.
done
@dremond71 Thank you for the PR. Please |
if (!options.rest) options.rest = {}; | ||
options.rest.port = 8080; | ||
options.rest.host = "0.0.0.0"; | ||
// ---------------------------------------- |
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.
We have configured options in index.js
as part of step 2. Is step 3 still needed?
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.
not sure. It worked when I edited both. I will try next week.
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.
did you find time to try ?
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've finally had the chance to experiment with this a bit more. It turns out @raymondfeng is correct. "Modify deploy-test/src/index.ts" is not needed if I have done "Modify deploy-test/index.js".
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.
@JesusTheHun ^^
```` | ||
|
||
Make sure there are no errors before continuing to the next step. | ||
|
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.
Why do you want remove prestart
and manually run npm run build
before npm start
?
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 was a step suggested in
https://medium.com/loopback/deploy-your-first-loopback4-application-to-ibm-cloud-2e671ac06b6c
published by @dhmlau .
I figured there was a good reason to do this, so I copied the instruction.
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.
@raymondfeng , I just spoke with @b-admike , and he suggested I don't need to remove this from the package.json for the purposes of this how-to article. But it may be something the user would do to save time publish to production level.
``` | ||
lb4-simple-web-app latest 7d26df6c1561 | ||
``` | ||
|
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 docker related files can be added as part of lb4 app
if we add such feature, for example, lb4 app my-app --docker
. Consider to submit another PR for that.
@dremond71 Great tutorial! I look forward to automating some of the key steps into @hacksparrow ^^^ |
@dremond71, got some info from @rmg on CLA. Looks like the PR is created by |
I want to thank everyone for the positive comments :) |
I am trying to build the HTML, to test out some includes, as mentioned in https://loopback.io/doc/en/contrib/alerts.html#types-of-alerts in my MD file, Deploying_to_ibm_cloud_kubernetes.md I am running ./bin/build-docs-site.sh and I cannot get past this:
Any help is appreciated. I am on Mac OSX |
Running with sudo seems to have gotten it farther... sudo ./bin/build-docs-site.sh |
@bajtos , after generating the HTML, when I view my file
I do not see the images I have placed in my MD file:
Is this normal? Please advise. Thanks |
./bin/build_docs_site.sh works to completion on my machine without error. But : npm run test eventually fails:
|
Try running |
I am not sure if the generated HTML files can be viewed directly. I was always starting Jekyll in an interactive & incremental mode and accessing the website via HTTP. IIRC, the first step is to run
This looks like a problem in the way how Ruby is set on your system. I am using Homebrew for installing global dev tools including Ruby, it sets the filesystem permissions on such way that no root access ( |
|
||
# References | ||
|
||
[Getting started with the IBM Cloud CLI](https://cloud.ibm.com/docs/cli/index.html#overview) |
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.
done
I see the old version here (no list of bullet points), could you @emonddr please check?
The Jekyll generated HTML should be viewable directly since Jekyll is meant to produce static sites that can be hosted on any static http server. That's why there are so many restrictions on how content is organized. That said, the workarounds for those limitations might introduce browser JS that trips over CORS and related issues when trying to render a local file. |
Reminder for myself: I created Then I build the documentation from the main directory /loopback-next using
This creates content in the directory: /loopback-next/sandbox/loopback.io My generated HTML file is: /loopback-next/sandbox/loopback.io/_site/doc/en/lb4/deploying_to_ibm_cloud_kubernetes.html Loading this file in a browser, as-is, the images don't resolve since the image urls are now: and located in /loopback-next/sandbox/loopback.io/_site/pages/en/lb4/imgs/lb4_k8s_ibm_cloud_container_registry_1.png To view my HTML document with the images, I must go into the directory /loopback-next/sandbox/loopback.io and run
This loads the HTML in a local server instance, and now my document shows the images as properly resolved. |
@emonddr use the standard Markdown image tag for including images in all LB4 docs.
-- from PR #2226 |
See also what our docs say on this topic here: https://loopback.io/doc/en/contrib/images.html |
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.
LGTM as far as I am concerned. Please work with @raymondfeng to address his unresolved comments too.
Once done, please clean up the git history - squash all commits into a single one, make sure the commit message is following our Commit message guidelines and rebase the change on top of the latest master via git rebase master
.
I am looking forward to see this great guide online in our docs! 😄
f3db9df
to
48c7464
Compare
@bajtos and @raymondfeng , I have squashed all the commits into 1 commit, and rebased with master. |
48c7464
to
35cc8d2
Compare
* This guide shows users the complete step by step instructions on how to publish their LoopBack 4 application to Kubernetes on IBM Cloud.
Checklist
npm test
passes on your machinepackages/cli
were updatedexamples/*
were updated