APP container IP address and port

680 views
Skip to first unread message

Sekhar Hari

unread,
Oct 14, 2014, 8:29:17 AM10/14/14
to vcap...@cloudfoundry.org
Hello there -

I could successfully push a sample ruby-rake application to CF-189 release. The `cf apps` shows the following:

Getting apps in org admin / space development as admin...
OK

name          requested state   instances   memory   disk   urls
hello-world   started           1/1         256M     1G     hello-world.10.154.0.18.xip.io

How do I get the container IP address where this application runs? I have not set the env variables in the manifest. So cf env hello-world show me nothing. Also, what will be the port number?

For some reason, when I do `open hello-world.10.154.0.18.xip.io`, it is not showing the output "Hello World". Any idea what could be the problem?

Thanks,
Sekhar H.

James Bayer

unread,
Oct 14, 2014, 9:46:15 AM10/14/14
to vcap...@cloudfoundry.org
when using xip.io, then in your case 10.154.0.18 should resolve to your LB / SSL termination point, which in most configurations is HA Proxy unless you're bringing your own LB like on AWS ELB or F5, etc.

the LB should forward the following request to one of the CF Routers, which will look at the HTTP host header and then reverse proxy the request to one of your app instances.
hello-world.10.154.0.18.xip.io 

if you run a command like:
CF_TRACE=true cf app YOURAPPNAME

then the last REST call, which is the /stats endpoint of your app, should show the IP / ports that the router tier would be using. typically, that IP / port is not routable from an outside network. the LB / CF Router tier is there to abstract the actual IP/ports from clients. here's an example.

REQUEST: [2014-10-14T06:43:18-07:00]
GET /v2/apps/81b95a21-166e-40a8-9430-1b3c7c61dde9/stats HTTP/1.1
Accept: application/json
Authorization: [PRIVATE DATA HIDDEN]
Content-Type: application/json
User-Agent: go-cli 6.6.1-7ce596e / darwin



RESPONSE: [2014-10-14T06:43:19-07:00]
HTTP/1.1 200 OK
Content-Length: 334
Connection: keep-alive
Content-Type: application/json;charset=utf-8
Date: Tue, 14 Oct 2014 13:43:18 GMT
Server: nginx
X-Cf-Requestid: d52407d7-19bd-43a2-4b77-732f736f15c6
X-Content-Type-Options: nosniff
X-Vcap-Request-Id: 5c8f00ab-5552-4f72-7dcd-9f5d683518cf::a1e47a1e-b189-423c-b6ea-94c32d023d9d

{"0":{"state":"RUNNING","stats":{"name":"boot-james","uris":["boot-james.cfapps.io","somesillyroute.cfapps.io"],"host":"10.10.81.10","port":61053,"uptime":491253,"mem_quota":1073741824,"disk_quota":1073741824,"fds_quota":16384,"usage":{"time":"2014-10-14 13:43:18 +0000","cpu":0.000548501051111202,"mem":438861824,"disk":119029760}}}}

--
You received this message because you are subscribed to the Google Groups "Cloud Foundry Developers" group.
To view this discussion on the web visit https://groups.google.com/a/cloudfoundry.org/d/msgid/vcap-dev/3589585a-2e59-4d06-8041-70d2f1f8a045%40cloudfoundry.org.

To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.



--
Thank you,

James Bayer

Sekhar Hari

unread,
Oct 16, 2014, 4:16:15 AM10/16/14
to vcap...@cloudfoundry.org
Got it. Many thanks.
Reply all
Reply to author
Forward
0 new messages