-
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
[Spike] Deploy a basic LB4 application to IBM Cloud Kubernetes #1606
Comments
Per the team meeting's discussion, we'll visit it after GA. |
As a reference: Saw some documentation on deploying to IBM Cloud using kubernetes, not sure how much it will be different/similar in our case: |
We'll have lots of useful info from those, that's for sure. There might be LB4 specific requirements, which we don't know about yet. Good find! |
…back 4 application to Kubernetes on the IBM Cloud.
Pain Points
|
Articles about dockerizing a web app in docker( No mention of setting host IP to 0.0.0.0 ) https://semaphoreci.com/community/tutorials/dockerizing-a-node-js-web-application Articles about dockerizing a web app in docker( Do mention setting host IP to 0.0.0.0 ) https://nodejs.org/en/docs/guides/nodejs-docker-webapp/ |
Perhaps there should be a page in the documentation explaining how an lb4 application can be configured to work in a Docker container, and explain : 1) which file need to be changed ( index.js), 2) what to place in the Dockerfile, and 3) How to build the docker image, and run the application in the docker container. |
I also had a talk with @raymondfeng about the direction of this cloud native experience:
@emonddr, what do you think we can do to minimize the manual steps you need to go through in "step 1"? |
@raymondfeng , @bajtos . With regards to the step of having to set the host IP to 0.0.0.0 in index.js, I was hoping one of you could shed some light about why this step is necessary to get a loopback 4 application (web server) working in Docker. I am not an expert on the product yet, and I am not an expert on Docker. As I mentioned above , while discussing the main pain point, I found different articles on getting web server applications working in Docker, and some never mention having to set host IP to 0.0.0.0 in application code/config, and some do ( some were articles on Node.js applications). |
@emonddr I don't think listening on |
I spoke to @b-admike after his "ToDo List" application demo, to have him try to get his application to work in a docker container to see if he encounters into the same problem as I did. He ended up having to change his index.js file (setting host to 0.0.0.0) in order to get his lb4 application running in docker and accessible from outside the container. He suggested that perhaps loopback CLI should generate an index.js file that has:
instead of :
This would allow : the application to receive incoming connections from any network interface besides the localhost (loopback) interface (network interface agnostic), and the application to work as-is ( standalone or inside a docker container) without any modifications to the host ip address. This would eliminate one step in deploying an lb4 app to kubernetes on IBM Cloud. |
Having the CLI generate a .dockerignore file would eliminate another step. The contents of .dockerignore would be 👍
Having the CLI generate the Dockerfile file would eliminate another step. The contents of Dockerfile would be:
The port we expose in the Dockerfile would need to be aligned with the value in the index.js file. Having the CLI create a build_docker_image.sh , run_app_in_docker.sh, stop_app_in_docker.sh, show_logs_of_app_in_docker.sh, list_docker_apps.sh, list_docker_images.sh, delete_docker_image.sh (Not sure exactly how much "Docker" hand-holding we should do for the user with script files vs documenting docker commands in the how-to document itself. |
@emonddr , could you please summarize the next steps? We'd need to agree on the follow-up task(s) in order to claim this spike done. :) Thanks. |
Next Steps
|
@strongloop/loopback-maintainers ^^ |
The next steps look good to me. I have few comments to consider.
IIRC, we used to use Here is the reason why we limited the HTTP server to We should refresh our understanding of this area to make sure the changes preserve overal user experience. Other related discussions: #1900 #1637
Perhaps Nice to have:
|
+1 on |
@bajtos , @raymondfeng I read those links provided above and they are very involved. I think perhaps before we even consider a design spike for kubernetes on the IBM Cloud, there should be a design spike to test if all conceivable server configurations would run inside a simple Docker container. Are there any existing test cases for this? |
Time box this spike for a week
Description
Find out what's needed to deploy LB4 applications to IBM Cloud Kubernetes and write a short document describing the steps.
Updated per discussion with @raymondfeng @bajtos @jjtang1:
This spike/task is only limited to document the steps on how to deploy to k8s, and not about implementing any changes that would enhance the user experience (This will be the longer term goal).
Take our existing Todo application as the project to deploy, but make the following changes:- Use Cloudant (free Lite plan) to persist our Todo items. To do so, we need to temporarily modifydb
datasource to usecloudant
connector and add this connector to project dependencies.- When deploying to IBM Cloud Kubernetes, the application must be configured to use a cloud-based Cloudant instance.- When developing and testing locally, the app should use local docker-based Cloudant Developer Edition.- There may be other settings we need to tweak when deploying to cloud, for example the port number where to listen.Besides the deployment guide, this spike should also identify the biggest pain points - things we need to improve to make the deployment experience smoother.Acceptance criteria
The text was updated successfully, but these errors were encountered: