Upgrade to Pro — share decks privately, control downloads, hide ads and more …

What's Cloud Foundry and why you want to use it

What's Cloud Foundry and why you want to use it

Alois Mayr

June 01, 2017
Tweet

Other Decks in Technology

Transcript

  1. confidential
    What's Cloud Foundry and why you want to use it
    § June 1, 2017 – Alois Mayr – @mayralois

    View full-size slide

  2. The cloud-native evolution
    9 out of 10
    of surveyed respondents are going to
    migrate to cloud technologies
    within the next five years

    View full-size slide

  3. ..but what does it mean to be cloud native?
    Micro-services oriented - loosely coupled, explicit dependencies
    Container packaged - isolated unit of application deployment
    Dynamically managed - central orchestration process
    Source: Cloud Native Computing Foundation

    View full-size slide

  4. ..but what does it mean to be cloud native?
    Onsi Fakhoui: VP Cloud Research & Development

    View full-size slide

  5. confidential
    Dev teams become responsible for operations
    You build it, you run it
    bash-3.2$ cf target -s prod
    API endpoint: https://api.cf.$DOMAIN
    User: amayr
    Org: dynatrace
    Space: prod
    bash-3.2$ cf push

    View full-size slide

  6. confidential
    What's under the covers?

    View full-size slide

  7. confidential
    CF and Diego
    § Components run on separate
    instances (VMs) in HA mode
    § 25-30 instances minimum to run a
    full-fledged Cloud Foundry cluster
    § Cells are the only instances that
    actually run applications

    View full-size slide

  8. cf push APP
    Buildpack kicks in
    and builds droplet
    app.zip
    Setting up routes
    to app containers
    Scheduling desired
    app instances
    droplet
    Running app in
    garden containers
    cf logs APP
    Forwards logs
    Firehose
    delivers all logs
    and metrics
    Developer
    Enduser
    https://APP.domain

    View full-size slide

  9. Source: Pivotal Enablement
    Developer Basics
    https://content.enablement.pivotal.io/pivotal-cloud-foundry-developer/pcf-developer-basics/buildpack/buildpack.pdf

    View full-size slide

  10. Source: Pivotal Enablement
    Developer Basics
    https://content.enablement.pivotal.io/pivotal-cloud-foundry-developer/pcf-developer-basics/buildpack/buildpack.pdf

    View full-size slide

  11. confidential
    Buildpacks
    § Handle the staging process of pushed apps
    § Provide runtime support and external dependencies
    § Typically language specific

    View full-size slide

  12. confidential
    cf push
    $ cf push spring-music --hostname spring-music-devone
    Using manifest file /Users/cwat-amayr/Documents/CloudFoundry/test-app/spring-music/manifest.yml
    Creating app spring-music in org amayr / space dev as admin...
    OK
    Using route spring-music-devone.apps.pcfeu.dev.dynatracelabs.com
    Binding spring-music-devone.apps.pcfeu.dev.dynatracelabs.com to spring-music...
    OK
    Uploading spring-music...
    Uploading app files from: /var/folders/mm/rs3p_4ns59sgz4g1xy4sprk4kl34fs/T/unzipped-app569800276
    Uploading 452.5K, 90 files
    Done uploading
    OK

    View full-size slide

  13. confidential
    cf push
    Starting app spring-music in org amayr / space dev as admin...
    Downloading java_buildpack_offline...
    Downloaded java_buildpack_offline
    Creating container
    Successfully created container
    Downloading app package...
    Downloaded app package (21.1M)
    Staging...
    -----> Java Buildpack Version: v3.16 (offline) | https://github.com/cloudfoundry/java-buildpack.git#2110750
    -----> Downloading Open Jdk JRE 1.8.0_131 from https://java-buildpack.cloudfoundry.org/openjdk/trusty/x86_64/openjdk-
    1.8.0_131.tar.gz (found in cache)
    Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.1s)
    -----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE from https://java-buildpack.cloudfoundry.org/memory-
    calculator/trusty/x86_64/memory-calculator-2.0.2_RELEASE.tar.gz (found in cache)
    Memory Settings: -Xss349K -Xmx681574K -XX:MaxMetaspaceSize=104857K -Xms681574K -XX:MetaspaceSize=104857K
    -----> Downloading Container Certificate Trust Store 2.1.0_RELEASE from https://java-buildpack.cloudfoundry.org/container-
    certificate-trust-store/container-certificate-trust-store-2.1.0_RELEASE.jar (found in cache)
    Adding certificates to .java-buildpack/container_certificate_trust_store/truststore.jks (1.5s)
    -----> Downloading Spring Auto Reconfiguration 1.10.0_RELEASE from https://java-buildpack.cloudfoundry.org/auto-
    reconfiguration/auto-reconfiguration-1.10.0_RELEASE.jar (found in cache)
    -----> Downloading Tomcat Instance 8.0.43 from https://java-buildpack.cloudfoundry.org/tomcat/tomcat-8.0.43.tar.gz
    Expanding Tomcat Instance to .java-buildpack/tomcat (0.1s)
    -----> Downloading Tomcat Lifecycle Support 2.5.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-lifecycle-
    support/tomcat-lifecycle-support-2.5.0_RELEASE.jar (found in cache)
    -----> Downloading Tomcat Logging Support 2.5.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-logging-
    support/tomcat-logging-support-2.5.0_RELEASE.jar (found in cache)
    -----> Downloading Tomcat Access Logging Support 2.5.0_RELEASE from https://java-buildpack.cloudfoundry.org/tomcat-access-
    logging-support/tomcat-access-logging-support-2.5.0_RELEASE.jar (found in cache)
    Exit status 0
    Staging complete

    View full-size slide

  14. confidential
    cf push
    Uploading droplet, build artifacts cache...
    Uploading droplet...
    Uploading build artifacts cache...
    Uploaded build artifacts cache (109B)
    Uploaded droplet (74.1M)
    Uploading complete
    Destroying container
    0 of 1 instances running, 1 starting
    0 of 1 instances running, 1 starting
    0 of 1 instances running, 1 starting
    1 of 1 instances running
    App started
    OK
    App spring-music was started using this command `CALCULATED_MEMORY=$($PWD/.java-buildpack/open_jdk_jre/bin/java-buildpack-
    memory-calculator-2.0.2_RELEASE -memorySizes=metaspace:64m..,stack:228k.. -memoryWeights=heap:65,metaspace:10,native:15,stack:10
    -memoryInitials=heap:100%,metaspace:100% -stackThreads=300 -totMemory=$MEMORY_LIMIT) && JAVA_HOME=$PWD/.java-
    buildpack/open_jdk_jre JAVA_OPTS="-Djava.io.tmpdir=$TMPDIR -XX:OnOutOfMemoryError=$PWD/.java-
    buildpack/open_jdk_jre/bin/killjava.sh $CALCULATED_MEMORY -Djavax.net.ssl.trustStore=$PWD/.java-
    buildpack/container_certificate_trust_store/truststore.jks -Djavax.net.ssl.trustStorePassword=java-buildpack-trust-store-
    password -Djava.endorsed.dirs=$PWD/.java-buildpack/tomcat/endorsed -Daccess.logging.enabled=false -Dhttp.port=$PORT" exec
    $PWD/.java-buildpack/tomcat/bin/catalina.sh run`

    View full-size slide

  15. confidential
    cf push
    Showing health and status for app spring-music in org amayr / space dev as admin...
    OK
    requested state: started
    instances: 1/1
    usage: 512M x 1 instances
    urls: spring-music-devone.apps.pcfeu.dev.dynatracelabs.com
    last uploaded: Wed May 31 08:36:58 UTC 2017
    stack: cflinuxfs2
    buildpack: container-certificate-trust-store=2.1.0_RELEASE java-buildpack=v3.16-offline-https://github.com/cloudfoundry/java-
    buildpack.git#2110750 open-jdk-like-jre=1.8.0_131 open-jdk-like-memory-calculator=2.0.2_RELEASE spring-auto-
    reconfiguration=1.10.0_RELEASE...
    state since cpu memory disk details
    #0 running 2017-05-31 10:38:05 AM 87.7% 278.3M of 512M 155.4M of 256M

    View full-size slide

  16. confidential
    How to connect with backing services?
    "Treat backing services as attached resources"
    (12-factor app)
    cf bind-service APP_NAME SERVICE_INSTANCE
    § Service credentials are being exposed via environment variables in runtime container
    § Services are available via marketplace

    View full-size slide

  17. confidential
    How to scale app instances?
    $ cf scale spring-music -i 2
    Scaling app spring-music in org amayr / space dev as admin...
    OK
    $ cf app spring-music
    Showing health and status for app spring-music in org amayr / space dev as admin...
    name: spring-music
    requested state: started
    instances: 2/2
    usage: 512M x 2 instances
    routes: spring-music-devone.apps.pcfeu.dev.dynatracelabs.com
    last uploaded: Wed 31 May 10:36:58 CEST 2017
    stack: cflinuxfs2
    buildpack: container-certificate-trust-store=2.1.0_RELEASE java-buildpack=v3.16-offline-
    https://github.com/cloudfoundry/java-buildpack.git#2110750
    open-jdk-like-jre=1.8.0_131 open-jdk-like-memory-calculator=2.0.2_RELEASE spring-auto-
    reconfiguration=1.10.0_RELEASE...
    state since cpu memory disk details
    #0 running 2017-05-31T08:38:05Z 0.3% 332.1M of 512M 155.4M of 256M
    #1 running 2017-05-31T10:08:08Z 0.4% 319.9M of 512M 155.4M of 256M

    View full-size slide

  18. confidential
    Containers?
    § No platform without containers these days
    § runC – the CLI for spawning &
    running containers
    § Built on libcontainer from Docker
    Here is where the
    containers live
    Why?
    Runtime-isolation on shared compute resources

    View full-size slide

  19. Thank you
    Demo?

    View full-size slide