Cloud Foundry
From Zero To Hero

02 How do I interact with CF?

This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.

Feature

As a CF hero
I want to have a command line utility installed
So that I can deploy apps into my CF account

How do I interact with CF?

From Terminal / Command Prompt

With CF CLI utility

How do I install the CF CLI?

github.com/cloudfoundry/cli

Did CF CLI install correctly?

$ cf
NAME:
   cf - A command line tool to interact with Cloud Foundry

USAGE:
   [environment variables] cf [global options] command [arguments...

VERSION:
   6.13.0-e68ce0f-2015-10-15T22:53:29+00:00

BUILD TIME:
   2015-10-25 01:04:16.22807612 +0100 BST
...

How do I log into CF?

$ cf login -a api.run.pivotal.io -u YOUR-EMAIL-ADDRESS
$ cf help login
$ cf login -h
NAME:
   login - Log user in

USAGE:
   cf login [-a URL] [-u USERNAME] [-p PASSWORD] [-o ORG] [-s SPACE]
...

What is a CF space?

Every application and service is scoped to a space

$ cf spaces

slides
training
$ cf space training

development
    Org:               cf-hero
    Apps:              
    Domains:           
    Services:          
    Security Groups:   public_networks, dns, ssh-logging, p-mysql...
    Space Quota:

What is a CF org?

Account shared by one or more users for resource
quotas, applications, services & custom domains

$ cf orgs

name
cf-hero
$ cf org cf-hero

cf-hero:
    domains:        
    quota:          100GB:50free (102400M memory limit, Unlimited ..
    spaces:         slides, training
    space quotas:

What are resource quotas?

$ cf quotas

name           total mem   instance mem   routes   service instances
free           0           unlimited      1000     0                
trial          2G          unlimited      1000     10               
paid           10G         unlimited      1000     unlimited        
25GB           25G         unlimited      1000     unlimited        
50GB           50G         unlimited      1000     unlimited        
75GB           75G         unlimited      1000     unlimited        
100GB          100G        unlimited      1000     unlimited        
...

What is the relationship between orgs, spaces & apps?


              . Org                   . cf-hero
              |                       |
              \-- Space               \-- training
                 |                       |
                 |-- App 1               |-- web-app
                 \-- App 2               \-- worker-app

Which org & space am I currently targeting?

$ cf target

API endpoint:   https://api.run.pivotal.io (API version: 2.36.0)
User:           gerhard@cloudcredo.com
Org:            cf-hero
Space:          training

How do I target a different
org and/or space?

$ cf target -o ORG -s SPACE

DELIVERED

As a CF hero
I want to have a command line utility installed
So that I can deploy apps into my CF account

Any questions?

Questions cannot be stupid. Answers can.

CF SUPERHERO

This content is copyright of CloudCredo. © CloudCredo 2015. All rights reserved.