This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.
As a CF hero
I want my app to be accessible at a public URL
So that the whole world can see it
# From the training home directory:
$ cd 03-first-app/web-app
$ cf push
...
urls: web-app-unpassionate-eighteen.cfapps.io
...
$ cf apps
name state instances memory disk urls
web-app started 1/1 32M 256M web-app-unpass...
$ cf app web-app
requested state: started
instances: 1/1
usage: 32M x 1 instances
urls: web-app-unpassionate-eighteen.cfapps.io
last uploaded: Mon Nov 2 10:18:05 UTC 2015
stack: cflinuxfs2
buildpack: ruby 1.6.7
state since cpu memory disk
#0 running 2015-11-02 0.0% 25.7M of 32M 95.1M of 256M
$ cat 03-first-app/web/manifest.yml
name: web-app
memory: 32M
disk_quota: 256M
random-route: true
buildpack: ruby_buildpack
cfapps.io
is shared by all run.pivotal.io apps
$ cf app web-app
...
urls: web-app-unpassionate-eighteen.cfapps.io
...
CONSUMER
|
ROUTER
/ \
/ \
/ \
/ \
HOST 1 HOST 2
| |
APP A INSTANCE 1 -| |- APP A INSTANCE 2
APP B INSTANCE 2 -| |- APP B INSTANCE 1
App receives web requests (if it binds to TCP port)
By the cf
cli, no other dependency required
Define in .cfignore
files that should not be sent
App Files + Runtime Dependencies = App Artefact
If it’s a web process, it binds to a TCP port
Randomly distributed across multiple app instances
# From the training home directory:
$ cd 03-first-app/worker-app
$ cf push
$ cf app worker-app
requested state: started
instances: 1/1
usage: 16M x 1 instances
urls:
last uploaded: Mon Nov 2 13:56:39 UTC 2015
stack: cflinuxfs2
buildpack: binary_buildpack
state since cpu memory disk
#0 running 2015-11-02 0.0% 10.7M of 16M 27.3M of 64M
$ cf logs worker-app --recent
...
2015... [App/0] ERR + main
2015... [App/0] ERR + find_my_public_ip
2015... [App/0] ERR + which curl
2015... [App/0] ERR + curl -sL https://api.ipify.org?format=json
2015... [App/0] OUT {"ip":"54.236.219.204"}
2015... [App/0] ERR + suspend_myself
2015... [App/0] ERR + kill -STOP 11
As a CF hero
I want my app to be accessible at a public URL
So that the whole world can see it
$ cf delete worker-app
$ cf delete -f -r web-app
Questions cannot be stupid. Answers can.
cf
commands with CF_TRACE=true
manifest.yml
This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.