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

How does a PaaS actually work?

Alex Ley
November 03, 2016

How does a PaaS actually work?

Talk from BrisTech 2016

Alex Ley

November 03, 2016
Tweet

More Decks by Alex Ley

Other Decks in Technology

Transcript

  1. > Agenda - What is a PaaS? - Cloud Foundry?

    - Application Lifecycle in a Cloud!
  2. > What is a PaaS? “Computing platform that provides everything

    (OS + runtime environment + services) that is required for an web app to run on a computer and be accessed via the internet”
  3. > What is Cloud Foundry? Cloud Foundry is a Computing

    Platform It is a large piece of software that provides the functionality of Cloud Computing Platform aka PaaS
  4. Messaging App Storage & Execution App Lifecycle Routing Cloud Controller

    nsync Diego Brain Cell Reps Blob Store App Execution (Diego Cell) Garden (Container) TCP Router HTTP Router BBS Consul NATS Message Bus Authentication OAuth2 Sever (UAA) Login Server Services Service Brokers Metrics & Logging App Log Aggregation Metrics Collection
  5. Command Line Interface (CLI) • Primary way to interface with

    Cloud Foundry • Commands for both users and administrators • Plugin architecture to extend functionality
  6. User Account and Authentication (UAA) • Multi tenant identity management

    service • OAuth2 provider issuing tokens for CF client applications • Integrates with LDAP, SCIM, OpenID
  7. > cd /path/to/my/app > tree . ├── README.md ├── app.groovy

    ├── application.properties ├── manifest.yml
  8. • Entry point into Cloud Foundry via RESTFUL API’s •

    Interacts with other core components to orchestrate workflows • Specifies Service Broker API for integrating service gateways Cloud Controller
  9. • Supports HTTP(S) and TCP routes • Experimental RESTFUL Routing

    API to replace NATS • Emitters to register CF apps with routers Routing NATS
  10. • Communicates via NATS messages • Routes must be re-registered

    periodically • gorouter will prune routes that it considers to be stale • Uses simple round-robin load balancing for scaled apps Routing NATS
  11. • Bound apps are given a reserved port and route

    on shared domain • Uses HAProxy tcp router implementation • Subscribes to events from the routing api • Follows router-group model Routing NATS
  12. • RESTful interface for registering and deregistering routes • Routing

    API depends on a clustered etcd data store • A CLI client called rtr simplifies interactions • https://github.com/cloudfoundry-incubator/routing-ap Routing NATS
  13. • The Cloud Controller (CC) manages a blob store for:

    • Resources - files that are uploaded to CC with unique SHA • App packages - unstaged files that represent an app • Droplets - the result of taking an app package and staging Blobstore
  14. Starting app cf-spring in org pivot-jules / space test as

    [email protected]... Downloading ruby_buildpack... Downloading go_buildpack... Downloading nodejs_buildpack... Downloading java_buildpack... Downloaded java_buildpack Downloaded staticfile_buildpack Downloaded ruby_buildpack Downloaded nodejs_buildpack Downloaded go_buildpack
  15. • Provide framework and runtime support for your apps •

    Examine app to determine dependencies to download • Know how to configure apps to talk to bound services /bin/detect /bin/compile /bin/release Buildpacks
  16. Creating container Successfully created container Downloading app package... Downloaded app

    package (1.2M) Staging... -----> Java Buildpack Version: v3.7 (offline) -----> Downloading Open Jdk JRE 1.8.0_91 jdk-1.8.0_91.tar.gz (found in cache) Expanding Open Jdk JRE to .java-buildpack/open_jdk_jre (1.0s) -----> Downloading Open JDK Like Memory Calculator 2.0.2_RELEASE -----> Downloading Spring Boot CLI 1.3.3_RELEASE Expanding Spring Boot CLI to .java-buildpack/spring_boot_cli (0.0s) Exit status 0 Staging complete
  17. Runtime Container File System (‘Stack’) Scaling Runtime Container File System

    (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’)
  18. Runtime Container File System (‘Stack’) Scaling Runtime Container File System

    (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’) Runtime Container File System (‘Stack’)
  19. Diego • Provides Staging and Runtime support for Cloud Foundry

    • Schedules and runs Tasks and LRPs (Long-Running Process) • Optimally distributes Tasks and LRPs to Cells via auction
  20. Diego Task • Guaranteed to be run at most once

    • E.g. Staging requests and one-off database migrations
  21. Diego LRP • Long-Running Process • E.g. Application processes •

    Distributed across cells • Automatically restarted if they crash or disappear
  22. Uploading droplet, build artifacts cache... Uploading build artifacts cache... Uploading

    droplet... Uploaded build artifacts cache (109B) Uploaded droplet (53.6M) Uploading complete
  23. 0 of 3 instances running, 3 starting 1 of 3

    instances running, 2 starting 2 of 3 instances running, 1 starting 3 of 3 instances running App started OK
  24. Garden • Cloud Foundry’s container technology • Allows build pack

    based applications as well as docker images • Multiple, pluggable backends each implementing the garden API
  25. Garden • Based on standards set by the Open Container

    Project • Same codebase as docker (v 1.11+) • Soon to replace garden-linux
  26. cf logs cf-spring Connected, tailing logs for app cf-spring in

    org pivot-jules / space development as jules...
  27. Loggregator • Sources - logging agents on the components •

    Metron Agents - collect & forward logs to doppler • Doppler - Gather logs, metrics, events & forward • Traffic Controller - Collate & provide firehose • Nozzles - Stream firehose the select, buffer, and transform data
  28. request for app details app details App logs Web socket

    connect /tail/?app=…. Seeing the logs
  29. Messaging App Storage & Execution App Lifecycle Routing Cloud Controller

    nsync Diego Brain Cell Reps Blob Store App Execution (Diego Cell) Garden (Container) TCP Router HTTP Router BBS Consul NATS Message Bus Authentication OAuth2 Sever (UAA) Login Server Services Service Brokers Metrics & Logging App Log Aggregation Metrics Collection
  30. > Recap - We know what a PaaS is -

    Cloud Foundry is awesome - PaaS is far more than containers - App lifecycle in the Cloud