SlideShare a Scribd company logo
Cloud Foundry Architecture
                                                                  Ramnivas Laddad
                                                                    @ramnivas




© 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.
@ramnivas
 •    Spring framework committer
 •    Cloud Foundry committer
 •    Main interests
       –  Cloud computing
       –  Aspect-oriented programming
       –  Scala and functional programming
 •    Author of books and articles
       –  AspectJ in Action (1st and 2nd edition)
 •    Speaker at many professional conferences
       –  JavaOne, JavaPolis, SpringOne, Software Development, No Fluff Just Stuff, EclipseCon,
          O’Reilly OSCON etc.
 •    Active involvement in AspectJ, Spring, and Cloud Foundry since their
      early form
Technologies “Я” Us
                                                                Closure        Java
                         AMQP        HTML5           Akka
           Mongo                                                Spring       Scala
Redis                            JSF                Grails
           Hibernate                                                     node.js
RabbitMQ                  JDBC
                                          Lift
                                                             Rails
                   JMS                                                       Ruby
 Hadoop                                      Sinatra
                            Batch Job                        Django
                   JTA                                                      Python
 MySQL                                    Web Services
                   JPA    Caching                                    LDAP
   Postgres                             Scripting
                           Testing                           Security
               Neo4j                        REST
Technologies “Я” Us
                                                                Closure        Java
                         AMQP        HTML5           Akka
           Mongo                                                Spring       Scala
Redis                            JSF                Grails
           Hibernate                                                     node.js
RabbitMQ                  JDBC
                                          Lift
                                                             Rails
                   JMS                                                       Ruby
 Hadoop                                      Sinatra
                            Batch Job                        Django
                   JTA                                                      Python
 MySQL                                    Web Services
                   JPA    Caching                                    LDAP
   Postgres                             Scripting
                           Testing                           Security
               Neo4j                        REST
Technologies “Я” Us
                           Access logs            Network
  Routing
                   Hardware failures       DNS
                                                        Storage
  Load balancing
                           Auditing       Rolling Updates
 User management

                          Security          DoS
   Backups                                                  DBA

              OS                         Monitoring
                            Patches
Technologies “Я” Us
                           Access logs            Network
  Routing
                   Hardware failures       DNS
                                                        Storage
  Load balancing
                           Auditing       Rolling Updates
 User management

                          Security          DoS
   Backups                                                  DBA

              OS                         Monitoring
                            Patches
Facets of complexity: Product
§  More functionality
§  Time to market pressure
§  Complex integration
§  Higher stake in quality
Facets of complexity: Development
§  Sound architecture: future proofing without overdoing
§  Unit and integration tests
§  Responding to changing business needs
§  Confusing technology landscape
Facets of complexity: Deployment and
operation
§  Choosing the right hardware, operating system, web server
§  Monitoring applications
§  Responding to scalability needs
§  Dealing with hardware- and system-level failures
§  Upgrading without substantial down time
Inherent vs. Apparent Complexity




         Implementation
Inherent vs. Apparent Complexity




         Implementation
        Functional logic
Inherent vs. Apparent Complexity




         Implementation
        Functional logic            Inherent
                                   complexity
Inherent vs. Apparent Complexity




  Implementation overhead
         Implementation
        Functional logic            Inherent
                                   complexity
Inherent vs. Apparent Complexity




  Implementation overhead
                                             Apparent
         Implementation                     complexity

        Functional logic            Inherent
                                   complexity
Inherent vs. Apparent Complexity

                          What can we do
                              about this?


  Implementation overhead
                                                Apparent
         Implementation                        complexity

        Functional logic               Inherent
                                      complexity
What can we do?




                  ?
Three layers of Cloud Computing
                       SaaS
       Software as a Service




                       PaaS
       Platform as a Service




                        IaaS
  Infrastructure as a Service
Cloud Foundry open PaaS - Choice of clouds



     Data
     Services                                       Private	
  	
  
                                                    Clouds	
  	
  
            Msg
            Services
                                           Public	
  
                                           Clouds	
  
                        Other     Micro	
  
                       Services
                                  Clouds	
  
Cloud Foundry open PaaS - Choice of clouds



          Data
          Services                                       Private	
  	
  
                                                         Clouds	
  	
  
                 Msg
                 Services
                                                Public	
  
                                                Clouds	
  
                             Other     Micro	
  
                            Services
                                       Clouds	
  

Apache2 license
Cloud Foundry open PaaS - Choice of clouds



          Data
          Services                                       Private	
  	
  
                                                         Clouds	
  	
  
                                                                           Partners	
  
                 Msg
                 Services
                                                Public	
  
                                                Clouds	
  
                             Other     Micro	
  
                            Services
                                       Clouds	
  

Apache2 license
Cloud Foundry Architecture
Architectural Goals
•    No single point of failure
•    Distributed state
•    Self healing
•    Horizontally scalable
Architectural Principles
•    Loose coupling
•    Event-driven
•    Asynchronous
•    Non-blocking
•    Idempotent
•    Eventually consistent
•    Language-independent communication
Cloud Foundry Layers


                          Clients
                        Inner Shell
                        Outer Shell
                 Infrastructure as a Service
         Hardware (CPU, Memory, Storage, Network)
Cloud Foundry Core Components
         The Inner Shell
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                                      HealthManager
                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
Zooming in…
                                                          App meta data



                   cloud
                                            stager              health
                 controller
                                                               manager
                    cc - db                staging
                                             jobs        package
                  uaa - db                                cache
                                                                          dea
                                                                           dea
                                            redis                           dea
                                                                              dea
                                                         blobstore             dea
              uaa - AuthN                                                       dea
                                          staging logs




© 2012 VMware, Inc. All rights reserved
Design Principles
•  Dynamically discoverable components
•  No inter-component dependencies
   –  Launch in any order
   –  Scale up and down independently
•  Monitor using HTTP end points
Cloudfoundry architecture
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                                      HealthManager
                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
Cloud Controller
•  Interface with the clients
   –  VMC
   –  STS
   –  Portal
•  Provides REST interface to domain objects
   –    Apps
   –    Services
   –    Orgs
   –    Spaces
Cloud Controller REST API



                  Demo
Cloudfoundry architecture
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                                      HealthManager
                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
Stager
•  Responsible for morphing user app into executable
•  Pluggable architecture
   –  Each plugin understands a framework or a runtime
•  Allow the DEA to view applications uniformly
Stager’s role



                                           ……………
……………
……………
                      Stager               ……………
                                           ……………
……………                                      ……………
……………                                      ……………
……………                                      ……………
…………..                                     ::::::::::
           Spring   Play       Rails   …
From bits to executable app




                              app.war
From bits to executable app




                              app.war
From bits to executable app




                              app.war
From bits to executable app



                startup

                              app.war


                 stop
Cloudfoundry architecture
Cloud Foundry Inner Shell and Up
     Developers                                   Users




                                 Routers

  CloudControllers    Stagers      App      App

                                                  HealthManager
           Services


                                Messaging
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                                      HealthManager
                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
From bits to running app



                startup

                           app.war


                 stop
From bits to running app



                startup

                           app.war


                 stop
From bits to running app



 A              startup
 g
 e                         app.war
 n
 t
                 stop
From bits to running app



 A              startup
 g
 e                         app.war
 n
 t
                 stop
Droplet Execution Agent (DEA)
•  Responsible for running all apps
•  Monitors apps
   –  Memory and disk quota
   –  Stage changes
•  Uniform view of all apps
   –  Runtime/framework differences sorted by the stager
•  Ensures app isolation
Application Isolation
              DEA Container API


                Host network



                Private network

                      App
                Private File System

                      Warden container
Cloudfoundry architecture
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                                      HealthManager
                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
Router
•  Responsible to route requests to
   –  User apps
   –  External-facing components
      •  Cloud Controller
      •  UAA
Application Routing




                      Messaging
Application Routing




                 Router




                      Messaging
Application Routing




                 Router

                           url è host:port
                                              DEA


                      Messaging
Application Routing
                      HTTP




                 Router

                             url è host:port
                                                DEA


                      Messaging
Application Routing
                       HTTP

                   Nginx
              (+Lua extension)


              Locator Services

                  Router

                              url è host:port
                                                 DEA


                      Messaging
Application Routing
                       HTTP

                   Nginx
              (+Lua extension)


              Locator Services

                  Router

                              url è host:port
                                                 DEA


                      Messaging
Cloudfoundry architecture
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                                      HealthManager
                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
Health Manager
§  Expected state:
     •  Cloud Controller
§  Current state:
     •  DEAs

§  Current state ç Expected state
Cloudfoundry architecture
UAA
•  Centralized Identity Management
   –  Authenticates users from multiple sources
   –  Presents a single standard protocol for consumers
•  User Account Management
•  Client Application Registration
•  OpenID Connect and Oauth2 – delegated authorization
   –  Uses Spring Security
Oauth2 for Cloud Foundry


                   CF Portal
                   Client


                                       Cloud controller
  User
                                       Resource server
  Resource owner


                   UAA
                   Identity provider
Oauth2 for Cloud Foundry
                                            Who is this user
                                            What is he/she requesting
                                            Do I have the necessary authorization

         Accesses the portal   CF Portal
                               Client


                                                                  Cloud controller
  User
                                                                  Resource server
  Resource owner


                               UAA
                               Identity provider
Oauth2 for Cloud Foundry
                                                    Who is this user
                                                    What is he/she requesting
                                                    Do I have the necessary authorization

         Accesses the portal        CF Portal
                                    Client

                  Authenticate me
                         Assert - Portal can only
                                                                          Cloud controller
  User                   read my apps
                                                    Authenticates user    Resource server
  Resource owner                                    Issues authorization code



                                   UAA
                                   Identity provider
Oauth2 for Cloud Foundry
                                                    Who is this user
                                                    What is he/she requesting
                                                    Do I have the necessary authorization

         Accesses the portal        CF Portal
                                    Client
                    Redirect user along
                    with the authcode

                  Authenticate me
                         Assert - Portal can only
                                                                          Cloud controller
  User                   read my apps
                                                    Authenticates user    Resource server
  Resource owner                                    Issues authorization code



                                   UAA
                                   Identity provider
Oauth2 for Cloud Foundry
                                                      Who is this user
                                                      What is he/she requesting
                                                      Do I have the necessary authorization

         Accesses the portal        CF Portal
                                    Client
                    Redirect user along
                    with the authcode        Exchange authcode
                                             for an access token
                  Authenticate me
                         Assert - Portal can only
                                                                             Cloud controller
  User                   read my apps
                                                      Authenticates user     Resource server
  Resource owner                                      Issues authorization code
                                                      Issue access token scoped
                                                      to cloud_controller.apps.read
                                   UAA
                                   Identity provider
Oauth2 for Cloud Foundry
                                                      Who is this user
                                                      What is he/she requesting
                                                      Do I have the necessary authorization
                                                            Present token containing
         Accesses the portal        CF Portal               cloud_controller.apps.read
                                    Client
                    Redirect user along
                    with the authcode        Exchange authcode
                                             for an access token
                  Authenticate me
                         Assert - Portal can only
                                                                             Cloud controller
  User                   read my apps
                                                      Authenticates user     Resource server
  Resource owner                                      Issues authorization code
                                                      Issue access token scoped
                                                      to cloud_controller.apps.read
                                   UAA
                                   Identity provider
Cloudfoundry architecture
Cloud Foundry Inner Shell and Up
     Developers                                      Users




                                Routers

  CloudControllers   Stagers      App        App

                                                     HealthManager
                                  Execution Agents
                                     (DEA) Pool

                               Messaging
Cloud Foundry Inner Shell and Up
     Developers                                       Users




                                 Routers

  CloudControllers    Stagers      App        App

                                                      HealthManager
                                   Execution Agents
           Services
                                      (DEA) Pool

                                Messaging
Service Provisioning
•  Service Gateway
   –  Provisions and unprovisions services
   –  Advertise service availability to CloudController
•  Service Nodes
   –  Runs actual services
   –  Scale independently
Access to services info
VCAP_SERVICES: {!
    "postgresql-9.0": [{!
        "name": "env-postgresql",!
        "label": "postgresql-9.0",!
        "plan": "free",!
        "credentials": {!
            "name": "de24667f9344b4eeaad6b5a2326d52faa",!
            "host": "172.30.48.122",!
            "port": 5432,!
            "user": "u50ce600bba434bacbc99e034bb415644",!
            "password": "pf4dca5bd449d4732841f0c4ae3f299d0"!
        }!
    }]!
}!
Operating Cloud Foundry
     The Outer Shell
Production Grade Cloud Foundry Clusters
                                         cloudfoundry.com
§  500 – 5,000 VMs
§  40+ unique node types
§  75+ unique software packages
§  2x/week cf.com updates
§  24x7x365 non-stop operation
§  No-downtime deployments
§  Reliable, robust, repeatable
    deployments, updates,
    capacity adjustments
§  Small teams manage many        production, staging, stress, qa,
    instances                      dev
What is BOSH?                     github.com/cloudfoundry/bosh

                           Service Evolution Technology for
                 Operating Cloud Foundry in Production Environments

Automated Virtual Infrastructure
•  At Cloud Scale
•  Abstracted using a Cloud Provider Interface (CPI)
Software Deployment, Configuration and Updates
•  Optimized to Minimize Downtime
•  Support for multiple VM roles
Repeatable Process
•  Release Management with Versioning
Active Monitoring and Alerting
BOSH has been used to run CloudFoundry.com since launch
Cloud Foundry “BOSH” – Concepts



            "BOSH"
Cloud Foundry “BOSH” – Concepts
                Stemcell
                • Base OS
                • “BOSH” Agent




            "BOSH"
Cloud Foundry “BOSH” – Concepts
                Stemcell         Release
                • Base OS        • Name
                • “BOSH” Agent
                                  Jobs
                                  • Software Packages
                                  • Configuration Templates
                                  • Scripts
            "BOSH"               Software Packages
                                 • Externally developed s/w
                                 • Internally developed s/w
Cloud Foundry “BOSH” – Concepts
Deployment Manifest            Stemcell         Release
• Release name and version     • Base OS        • Name
• # VMs, params for each Job   • “BOSH” Agent
• Stemcells to use                               Jobs
                                                 • Software Packages
                                                 • Configuration Templates
                                                 • Scripts
                         "BOSH"                 Software Packages
                                                • Externally developed s/w
                                                • Internally developed s/w
Cloud Foundry “BOSH” – Concepts
Deployment Manifest            Stemcell         Release
• Release name and version     • Base OS        • Name
• # VMs, params for each Job   • “BOSH” Agent
• Stemcells to use                               Jobs
                                                 • Software Packages
                                                 • Configuration Templates
                                                 • Scripts
                         "BOSH"                 Software Packages
                                                • Externally developed s/w
                                                • Internally developed s/w
Cloud Foundry “BOSH” – Concepts
Deployment Manifest                Stemcell         Release
• Release name and version         • Base OS        • Name
• # VMs, params for each Job       • “BOSH” Agent
• Stemcells to use                                   Jobs
                                                     • Software Packages
                                                     • Configuration Templates
                                                     • Scripts
                         "BOSH"                     Software Packages
                                                    • Externally developed s/w
                                                    • Internally developed s/w

    Environment
                          Configuration
                       Software Packages
                               Stemcell
Rolling Update of a Stateless Component
 Incoming HTTP         Incoming HTTP                    Incoming HTTP
 Requests              Requests                         Requests

     Router                 Router                            Router

                                     Create                                Create

       Cloud           Cloud          Cloud             Cloud           Cloud
      Controller      Controller     Controller        Controller      Controller
         v1              v1             v2                v1              v2
   Message Bus            Message Bus                      Message Bus

Starting with v1   Deploy a v2 VM                 If it works, add more v2
VMs                (canary)                       VMs...
Example: Rolling Update of a Stateless
 Component
Incoming HTTP                          Incoming HTTP
Requests   Router / LB                 Requests LB
                                          Router /
                                                            End Result:
                                                            We upgraded from v1
  Destroy          Create
                                                            to v2 with no
                                                            downtime by
       Cloud              Cloud               Cloud         building new VMs and
      Controller         Controller          Controller
         v1                 v2                  v2
                                                            destroying old ones

            Message Bus                   Message Bus

   … while removing v1                … until all VMs are
   VMs…                               v2
Deployment
§  Parallel
§  Canaries
§  Eventual consistency
Under the Hood
§  Components
     •  Director
     •  Agent
     •  CLI
§  Stemcell
Code Change
VM Update
VM Update
Cloud Provider Interface
•  Abstracts infrastructure
   –  Stemcells
      •  VM template
   –  VMs
   –  Disks
   –  Networks
IaaS neutral by design
vSphere: battle tested implementation,
thousands of deployments
                                                                    CPI: code complete
vCloud Director: “work in progress”, 2H 2012                        functional status: “work in progress”



                                         Cloud Foundry BOSH

                              Cloud Provider Interface (CPI)




                               contribute: github.com/cloudfoundry/bosh
CPI Providers
Learn More. Stay Connected.
Twitter
•  http://twitter.com/cloudfoundry
•  http://twitter.com/ramnivas

Sign up online at cloudfoundry.com
•  Website: http://cloudfoundry.org
•  Blog: http://blog.cloudfoundry.com and http://blog.cloudfoundry.org
•  GitHub: http://github.com/cloudfoundry
•  YouTube: http://youtube.com/cloudfoundry
Questions?
Cloud Foundry Architecture
                                                                  Ramnivas Laddad
                                                                    @ramnivas




© 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.

More Related Content

PDF
Cloudfoundry Introduction
PDF
Distributed Design and Architecture of Cloud Foundry
KEY
Cloud Foundry Bootcamp
PPTX
Cloud Foundry - Second Generation Code (CCNG). Technical Overview
PPTX
Cloud Foundry Technical Overview at IBM Interconnect 2016
PDF
As a Service: Cloud Foundry on OpenStack - Lessons Learnt
PDF
Introduction to Oracle Cloud Infrastructure Services
PDF
Cloud Foundry for PHP developers
Cloudfoundry Introduction
Distributed Design and Architecture of Cloud Foundry
Cloud Foundry Bootcamp
Cloud Foundry - Second Generation Code (CCNG). Technical Overview
Cloud Foundry Technical Overview at IBM Interconnect 2016
As a Service: Cloud Foundry on OpenStack - Lessons Learnt
Introduction to Oracle Cloud Infrastructure Services
Cloud Foundry for PHP developers

What's hot (20)

PPTX
Cloud Foundry: Hands-on Deployment Workshop
PDF
OS + CF Austin meetup
PDF
Cloud foundry Docker Openstack - Leading Open Source Triumvirate
PPTX
Cloud Foundry Diego, Lattice, Docker and more
PDF
How to build a Distributed Serverless Polyglot Microservices IoT Platform us...
PPTX
Multi-Cloud Micro-Services with CloudFoundry
PDF
Introduction to Platform-as-a-Service and Cloud Foundry
PDF
Cloud foundry
PPTX
Azure Service Fabric Overview
PDF
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
PDF
Cloud Foundry - An Open Innovation Platform
PDF
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
PPTX
Cloud Foundry a Developer's Perspective
PDF
Part 2: Architecture and the Operator Experience (Pivotal Cloud Platform Road...
PDF
Spring Into the Cloud
PDF
Cloud Native Application Development
PPTX
Delivering Developer Tools at Scale
PDF
Watson on bluemix
PDF
Part 4: Custom Buildpacks and Data Services (Pivotal Cloud Platform Roadshow)
PPTX
Oracle Code Keynote with Thomas Kurian
Cloud Foundry: Hands-on Deployment Workshop
OS + CF Austin meetup
Cloud foundry Docker Openstack - Leading Open Source Triumvirate
Cloud Foundry Diego, Lattice, Docker and more
How to build a Distributed Serverless Polyglot Microservices IoT Platform us...
Multi-Cloud Micro-Services with CloudFoundry
Introduction to Platform-as-a-Service and Cloud Foundry
Cloud foundry
Azure Service Fabric Overview
Cloud Foundry and Microservices: A Mutualistic Symbiotic Relationship
Cloud Foundry - An Open Innovation Platform
PaaS Anywhere - Deploying an OpenShift PaaS into your Cloud Provider of Choice
Cloud Foundry a Developer's Perspective
Part 2: Architecture and the Operator Experience (Pivotal Cloud Platform Road...
Spring Into the Cloud
Cloud Native Application Development
Delivering Developer Tools at Scale
Watson on bluemix
Part 4: Custom Buildpacks and Data Services (Pivotal Cloud Platform Roadshow)
Oracle Code Keynote with Thomas Kurian
Ad

Similar to Cloudfoundry architecture (20)

PPTX
Cloud Foundry Open Tour Keynote
PDF
Paving the Way to IT-as-a-Service
PDF
Spring into the Cloud - JDC2012 Cairo, Egypt
PPTX
Comm Gate Corporate Profile V0.4
PPTX
SPEC INDIA Java Case Study
KEY
Spring in the Cloud - using Spring with Cloud Foundry
PDF
MongoUK 2012
PDF
New Ways To Engage With Tiempo 2011
PDF
Google App Engine Update 2012
PPTX
V fabricoverveiw telkom
PDF
Makersbay Overview
PPTX
Florian adler minute project
PDF
Seeding The Cloud
PPTX
Cluster Computing with Dryad
PDF
Scalable Architecture on Amazon AWS Cloud - Indicthreads cloud computing conf...
PDF
Modern Architectures with Spring and JavaScript
PDF
Rails, ExtJs, and Netzke
PPTX
Successful PaaS and CI in the Cloud - EclipseCon 2012
PPTX
vFabric - Ideal Platform for SaaS Apps
KEY
Software architectures for the cloud
Cloud Foundry Open Tour Keynote
Paving the Way to IT-as-a-Service
Spring into the Cloud - JDC2012 Cairo, Egypt
Comm Gate Corporate Profile V0.4
SPEC INDIA Java Case Study
Spring in the Cloud - using Spring with Cloud Foundry
MongoUK 2012
New Ways To Engage With Tiempo 2011
Google App Engine Update 2012
V fabricoverveiw telkom
Makersbay Overview
Florian adler minute project
Seeding The Cloud
Cluster Computing with Dryad
Scalable Architecture on Amazon AWS Cloud - Indicthreads cloud computing conf...
Modern Architectures with Spring and JavaScript
Rails, ExtJs, and Netzke
Successful PaaS and CI in the Cloud - EclipseCon 2012
vFabric - Ideal Platform for SaaS Apps
Software architectures for the cloud
Ad

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
cuic standard and advanced reporting.pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Electronic commerce courselecture one. Pdf
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Spectral efficient network and resource selection model in 5G networks
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Dropbox Q2 2025 Financial Results & Investor Presentation
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Per capita expenditure prediction using model stacking based on satellite ima...
Empathic Computing: Creating Shared Understanding
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Understanding_Digital_Forensics_Presentation.pptx
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Unlocking AI with Model Context Protocol (MCP)
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...

Cloudfoundry architecture

  • 1. Cloud Foundry Architecture Ramnivas Laddad @ramnivas © 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.
  • 2. @ramnivas •  Spring framework committer •  Cloud Foundry committer •  Main interests –  Cloud computing –  Aspect-oriented programming –  Scala and functional programming •  Author of books and articles –  AspectJ in Action (1st and 2nd edition) •  Speaker at many professional conferences –  JavaOne, JavaPolis, SpringOne, Software Development, No Fluff Just Stuff, EclipseCon, O’Reilly OSCON etc. •  Active involvement in AspectJ, Spring, and Cloud Foundry since their early form
  • 3. Technologies “Я” Us Closure Java AMQP HTML5 Akka Mongo Spring Scala Redis JSF Grails Hibernate node.js RabbitMQ JDBC Lift Rails JMS Ruby Hadoop Sinatra Batch Job Django JTA Python MySQL Web Services JPA Caching LDAP Postgres Scripting Testing Security Neo4j REST
  • 4. Technologies “Я” Us Closure Java AMQP HTML5 Akka Mongo Spring Scala Redis JSF Grails Hibernate node.js RabbitMQ JDBC Lift Rails JMS Ruby Hadoop Sinatra Batch Job Django JTA Python MySQL Web Services JPA Caching LDAP Postgres Scripting Testing Security Neo4j REST
  • 5. Technologies “Я” Us Access logs Network Routing Hardware failures DNS Storage Load balancing Auditing Rolling Updates User management Security DoS Backups DBA OS Monitoring Patches
  • 6. Technologies “Я” Us Access logs Network Routing Hardware failures DNS Storage Load balancing Auditing Rolling Updates User management Security DoS Backups DBA OS Monitoring Patches
  • 7. Facets of complexity: Product §  More functionality §  Time to market pressure §  Complex integration §  Higher stake in quality
  • 8. Facets of complexity: Development §  Sound architecture: future proofing without overdoing §  Unit and integration tests §  Responding to changing business needs §  Confusing technology landscape
  • 9. Facets of complexity: Deployment and operation §  Choosing the right hardware, operating system, web server §  Monitoring applications §  Responding to scalability needs §  Dealing with hardware- and system-level failures §  Upgrading without substantial down time
  • 10. Inherent vs. Apparent Complexity Implementation
  • 11. Inherent vs. Apparent Complexity Implementation Functional logic
  • 12. Inherent vs. Apparent Complexity Implementation Functional logic Inherent complexity
  • 13. Inherent vs. Apparent Complexity Implementation overhead Implementation Functional logic Inherent complexity
  • 14. Inherent vs. Apparent Complexity Implementation overhead Apparent Implementation complexity Functional logic Inherent complexity
  • 15. Inherent vs. Apparent Complexity What can we do about this? Implementation overhead Apparent Implementation complexity Functional logic Inherent complexity
  • 16. What can we do? ?
  • 17. Three layers of Cloud Computing SaaS Software as a Service PaaS Platform as a Service IaaS Infrastructure as a Service
  • 18. Cloud Foundry open PaaS - Choice of clouds Data Services Private     Clouds     Msg Services Public   Clouds   Other Micro   Services Clouds  
  • 19. Cloud Foundry open PaaS - Choice of clouds Data Services Private     Clouds     Msg Services Public   Clouds   Other Micro   Services Clouds   Apache2 license
  • 20. Cloud Foundry open PaaS - Choice of clouds Data Services Private     Clouds     Partners   Msg Services Public   Clouds   Other Micro   Services Clouds   Apache2 license
  • 22. Architectural Goals •  No single point of failure •  Distributed state •  Self healing •  Horizontally scalable
  • 23. Architectural Principles •  Loose coupling •  Event-driven •  Asynchronous •  Non-blocking •  Idempotent •  Eventually consistent •  Language-independent communication
  • 24. Cloud Foundry Layers Clients Inner Shell Outer Shell Infrastructure as a Service Hardware (CPU, Memory, Storage, Network)
  • 25. Cloud Foundry Core Components The Inner Shell
  • 26. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents Services (DEA) Pool Messaging
  • 27. Zooming in… App meta data cloud stager health controller manager cc - db staging jobs package uaa - db cache dea dea redis dea dea blobstore dea uaa - AuthN dea staging logs © 2012 VMware, Inc. All rights reserved
  • 28. Design Principles •  Dynamically discoverable components •  No inter-component dependencies –  Launch in any order –  Scale up and down independently •  Monitor using HTTP end points
  • 30. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents Services (DEA) Pool Messaging
  • 31. Cloud Controller •  Interface with the clients –  VMC –  STS –  Portal •  Provides REST interface to domain objects –  Apps –  Services –  Orgs –  Spaces
  • 34. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents Services (DEA) Pool Messaging
  • 35. Stager •  Responsible for morphing user app into executable •  Pluggable architecture –  Each plugin understands a framework or a runtime •  Allow the DEA to view applications uniformly
  • 36. Stager’s role …………… …………… …………… Stager …………… …………… …………… …………… …………… …………… …………… …………… ………….. :::::::::: Spring Play Rails …
  • 37. From bits to executable app app.war
  • 38. From bits to executable app app.war
  • 39. From bits to executable app app.war
  • 40. From bits to executable app startup app.war stop
  • 42. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Services Messaging
  • 43. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents Services (DEA) Pool Messaging
  • 44. From bits to running app startup app.war stop
  • 45. From bits to running app startup app.war stop
  • 46. From bits to running app A startup g e app.war n t stop
  • 47. From bits to running app A startup g e app.war n t stop
  • 48. Droplet Execution Agent (DEA) •  Responsible for running all apps •  Monitors apps –  Memory and disk quota –  Stage changes •  Uniform view of all apps –  Runtime/framework differences sorted by the stager •  Ensures app isolation
  • 49. Application Isolation DEA Container API Host network Private network App Private File System Warden container
  • 51. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents Services (DEA) Pool Messaging
  • 52. Router •  Responsible to route requests to –  User apps –  External-facing components •  Cloud Controller •  UAA
  • 53. Application Routing Messaging
  • 54. Application Routing Router Messaging
  • 55. Application Routing Router url è host:port DEA Messaging
  • 56. Application Routing HTTP Router url è host:port DEA Messaging
  • 57. Application Routing HTTP Nginx (+Lua extension) Locator Services Router url è host:port DEA Messaging
  • 58. Application Routing HTTP Nginx (+Lua extension) Locator Services Router url è host:port DEA Messaging
  • 60. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App Execution Agents Services (DEA) Pool Messaging
  • 61. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents Services (DEA) Pool Messaging
  • 62. Health Manager §  Expected state: •  Cloud Controller §  Current state: •  DEAs §  Current state ç Expected state
  • 64. UAA •  Centralized Identity Management –  Authenticates users from multiple sources –  Presents a single standard protocol for consumers •  User Account Management •  Client Application Registration •  OpenID Connect and Oauth2 – delegated authorization –  Uses Spring Security
  • 65. Oauth2 for Cloud Foundry CF Portal Client Cloud controller User Resource server Resource owner UAA Identity provider
  • 66. Oauth2 for Cloud Foundry Who is this user What is he/she requesting Do I have the necessary authorization Accesses the portal CF Portal Client Cloud controller User Resource server Resource owner UAA Identity provider
  • 67. Oauth2 for Cloud Foundry Who is this user What is he/she requesting Do I have the necessary authorization Accesses the portal CF Portal Client Authenticate me Assert - Portal can only Cloud controller User read my apps Authenticates user Resource server Resource owner Issues authorization code UAA Identity provider
  • 68. Oauth2 for Cloud Foundry Who is this user What is he/she requesting Do I have the necessary authorization Accesses the portal CF Portal Client Redirect user along with the authcode Authenticate me Assert - Portal can only Cloud controller User read my apps Authenticates user Resource server Resource owner Issues authorization code UAA Identity provider
  • 69. Oauth2 for Cloud Foundry Who is this user What is he/she requesting Do I have the necessary authorization Accesses the portal CF Portal Client Redirect user along with the authcode Exchange authcode for an access token Authenticate me Assert - Portal can only Cloud controller User read my apps Authenticates user Resource server Resource owner Issues authorization code Issue access token scoped to cloud_controller.apps.read UAA Identity provider
  • 70. Oauth2 for Cloud Foundry Who is this user What is he/she requesting Do I have the necessary authorization Present token containing Accesses the portal CF Portal cloud_controller.apps.read Client Redirect user along with the authcode Exchange authcode for an access token Authenticate me Assert - Portal can only Cloud controller User read my apps Authenticates user Resource server Resource owner Issues authorization code Issue access token scoped to cloud_controller.apps.read UAA Identity provider
  • 72. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents (DEA) Pool Messaging
  • 73. Cloud Foundry Inner Shell and Up Developers Users Routers CloudControllers Stagers App App HealthManager Execution Agents Services (DEA) Pool Messaging
  • 74. Service Provisioning •  Service Gateway –  Provisions and unprovisions services –  Advertise service availability to CloudController •  Service Nodes –  Runs actual services –  Scale independently
  • 75. Access to services info VCAP_SERVICES: {! "postgresql-9.0": [{! "name": "env-postgresql",! "label": "postgresql-9.0",! "plan": "free",! "credentials": {! "name": "de24667f9344b4eeaad6b5a2326d52faa",! "host": "172.30.48.122",! "port": 5432,! "user": "u50ce600bba434bacbc99e034bb415644",! "password": "pf4dca5bd449d4732841f0c4ae3f299d0"! }! }]! }!
  • 76. Operating Cloud Foundry The Outer Shell
  • 77. Production Grade Cloud Foundry Clusters cloudfoundry.com §  500 – 5,000 VMs §  40+ unique node types §  75+ unique software packages §  2x/week cf.com updates §  24x7x365 non-stop operation §  No-downtime deployments §  Reliable, robust, repeatable deployments, updates, capacity adjustments §  Small teams manage many production, staging, stress, qa, instances dev
  • 78. What is BOSH? github.com/cloudfoundry/bosh Service Evolution Technology for Operating Cloud Foundry in Production Environments Automated Virtual Infrastructure •  At Cloud Scale •  Abstracted using a Cloud Provider Interface (CPI) Software Deployment, Configuration and Updates •  Optimized to Minimize Downtime •  Support for multiple VM roles Repeatable Process •  Release Management with Versioning Active Monitoring and Alerting BOSH has been used to run CloudFoundry.com since launch
  • 79. Cloud Foundry “BOSH” – Concepts "BOSH"
  • 80. Cloud Foundry “BOSH” – Concepts Stemcell • Base OS • “BOSH” Agent "BOSH"
  • 81. Cloud Foundry “BOSH” – Concepts Stemcell Release • Base OS • Name • “BOSH” Agent Jobs • Software Packages • Configuration Templates • Scripts "BOSH" Software Packages • Externally developed s/w • Internally developed s/w
  • 82. Cloud Foundry “BOSH” – Concepts Deployment Manifest Stemcell Release • Release name and version • Base OS • Name • # VMs, params for each Job • “BOSH” Agent • Stemcells to use Jobs • Software Packages • Configuration Templates • Scripts "BOSH" Software Packages • Externally developed s/w • Internally developed s/w
  • 83. Cloud Foundry “BOSH” – Concepts Deployment Manifest Stemcell Release • Release name and version • Base OS • Name • # VMs, params for each Job • “BOSH” Agent • Stemcells to use Jobs • Software Packages • Configuration Templates • Scripts "BOSH" Software Packages • Externally developed s/w • Internally developed s/w
  • 84. Cloud Foundry “BOSH” – Concepts Deployment Manifest Stemcell Release • Release name and version • Base OS • Name • # VMs, params for each Job • “BOSH” Agent • Stemcells to use Jobs • Software Packages • Configuration Templates • Scripts "BOSH" Software Packages • Externally developed s/w • Internally developed s/w Environment Configuration Software Packages Stemcell
  • 85. Rolling Update of a Stateless Component Incoming HTTP Incoming HTTP Incoming HTTP Requests Requests Requests Router Router Router Create Create Cloud Cloud Cloud Cloud Cloud Controller Controller Controller Controller Controller v1 v1 v2 v1 v2 Message Bus Message Bus Message Bus Starting with v1 Deploy a v2 VM If it works, add more v2 VMs (canary) VMs...
  • 86. Example: Rolling Update of a Stateless Component Incoming HTTP Incoming HTTP Requests Router / LB Requests LB Router / End Result: We upgraded from v1 Destroy Create to v2 with no downtime by Cloud Cloud Cloud building new VMs and Controller Controller Controller v1 v2 v2 destroying old ones Message Bus Message Bus … while removing v1 … until all VMs are VMs… v2
  • 88. Under the Hood §  Components •  Director •  Agent •  CLI §  Stemcell
  • 92. Cloud Provider Interface •  Abstracts infrastructure –  Stemcells •  VM template –  VMs –  Disks –  Networks
  • 93. IaaS neutral by design vSphere: battle tested implementation, thousands of deployments CPI: code complete vCloud Director: “work in progress”, 2H 2012 functional status: “work in progress” Cloud Foundry BOSH Cloud Provider Interface (CPI) contribute: github.com/cloudfoundry/bosh
  • 95. Learn More. Stay Connected. Twitter •  http://twitter.com/cloudfoundry •  http://twitter.com/ramnivas Sign up online at cloudfoundry.com •  Website: http://cloudfoundry.org •  Blog: http://blog.cloudfoundry.com and http://blog.cloudfoundry.org •  GitHub: http://github.com/cloudfoundry •  YouTube: http://youtube.com/cloudfoundry
  • 97. Cloud Foundry Architecture Ramnivas Laddad @ramnivas © 2012 SpringOne 2GX. All rights reserved. Do not distribute without permission.