Skip to content
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

Unable to run an app on kubernetes #43

Open
denismakogon opened this issue Apr 16, 2018 · 3 comments
Open

Unable to run an app on kubernetes #43

denismakogon opened this issue Apr 16, 2018 · 3 comments

Comments

@denismakogon
Copy link

Steps to reproduce:

  1. Create and publish the container to the registry.
  2. Create a deployment:
kubectl run viz-ui --image=<whoami>/vizceral-example:latest --replicas=1 --port=8080
kubectl expose deployment viz-ui --port=8080 --type=LoadBalancer

curl -v http://192.168.99.100:<exposed-port>
*   Trying 192.168.99.100...
* TCP_NODELAY set
* Connected to 192.168.99.100 (192.168.99.100) port 31865 (#0)
> GET / HTTP/1.1
> Host: 192.168.99.100:31865
> User-Agent: curl/7.54.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< X-Powered-By: Express
< Content-Type: text/html; charset=utf-8
< Content-Length: 19
< ETag: W/"13-OxsTL6IB85fkJxv9HO8uum0slCI"
< Date: Mon, 16 Apr 2018 11:56:43 GMT
< Connection: keep-alive
< 
* Connection #0 to host 192.168.99.100 left intact
Invalid Host header
@shadycuz
Copy link

shadycuz commented Apr 27, 2018

Im also having trouble getting to run

$ docker run -d -p 41911:8080 --name test-${CI_JOB_ID} -e America/New_York ${DOCKER_TEST_IMAGE}
5c55d19e734bef42eb07a23338dea94b27f62044e30bb50728068672a74a4206
$ echo "Sleeping for 60" && sleep 60
Sleeping for 60
$ export RESPONSE=$(curl --write-out %{http_code} --silent --output /dev/null localhost:41911)
$ echo "Response was $RESPONSE"
Response was 000

EDIT:

My error is also Invalid Host header

Is this because of the build warnings?

Step 5/8 : RUN npm install npm -g &&     npm install
 ---> Running in 7f2b33e47383
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ [email protected]
updated 1 package in 95.931s
npm WARN deprecated [email protected]: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
npm WARN deprecated [email protected]: This package has moved to @tweenjs/tween.js. Please update your dependencies.

> [email protected] install /usr/src/app/node_modules/git-validate
> node bin/install

WARNING: Unable to find a .git directory for this project, installation aborted.

> [email protected] install /usr/src/app/node_modules/precommit-hook
> node bin/install

npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

added 832 packages from 667 contributors in 229.559s

@shadycuz
Copy link

@denismakogon I was finally able to figure this out.

This app relies on https://github.com/webpack/webpack-dev-server. This allows you to run a local development server that will autoupdate as the files change live on the disk. By default this server only allows connections from localmachines. You can fix this several ways, they all are based on configuring a devServer block in your webpack.config.js.

module.exports = {
  devServer: {
  },

You can then set disableHostCheck: true to allow all connections or you can set one or more URL's you will allow access to with the allowsHosts option. More details can be found here https://webpack.js.org/configuration/dev-server/

I have not yet figured out how to run this in non dev move, but I'm far from that stage anyways.

@CrashLaker
Copy link

thank you @shadycuz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants