O slideshow foi denunciado.
Seu SlideShare está sendo baixado. ×

基於 K8S 開發的 FaaS 專案 - riff

Mais Conteúdo rRelacionado

Audiolivros relacionados

Gratuito durante 30 dias do Scribd

Ver tudo

基於 K8S 開發的 FaaS 專案 - riff

  1. 1. © Copyright 2017 Pivotal Software, Inc. All rights Reserved. Version 1.0 Version 1.0 September 2017 Introduction to riff
  2. 2. Cover w/ Image Agenda ■ Introduction to Cloud Foundry Foundation ■ From BOSH to CFCR ■ What is riff ? ■ Use Case
  3. 3. Introduction to CF Foundation
  4. 4. Moments in Containers History
  5. 5. Members of Cloud Foundry Foundation
  6. 6. Analytics APM Batch BPM Cache/LB CI/CD DB Commerce CRM IAASETLIAMIDE/Code ITIL Messaging Mobile Search Security SIEM/Log/Audit API/SOA/uS/IOT Test Other ❓ Networking Brokered Services: Cloud Foundry Ecosystem
  7. 7. From BOSH to CFCR
  8. 8. BORG BORG++ BOSH
  9. 9. CLI Micro BOSH Postgres NATS Director HM Registry Blobstore Agent Cmds agent agent Deployment “A” VMs Deployment “B” VMs BOSH Managed Deployments • Director uses CPI to create and configure VMs based on manifest • Agent assists in configuration of VM on start up • Director and Agent install and configure packaging on VMs • Agent reports health and status of VMs to Director • Director manages lifecycle of VM in case of upgrade or failure CloudProviderInterface(CPI) BOSH Architecture
  10. 10. BOSH Architecture
  11. 11. What is riff?
  12. 12. App Platforms + Functions Comparing the experience for Devs + Ops App Platform Abstraction Functions Abstraction runs apps runs functions push app to deploy server register function and bind it to a trigger server runs and waits for requests function doesn't run until triggered server listens to network platform deploys and invokes functions server handles lots of requests functions handle events and then go away scale out manually or by policy auto-scale based on concurrent event load pay per instance pay per use – time & memory
  13. 13. Stream Processing • IoT streams • Log ingestion • Event streams e.g. with Kinesis • ML pipelines Web Events • Website back-end services like form post handlers, authentication, tracking and logging. • APIs to back-end data services for mobile and web apps e.g GraphQL • Webhook handlers • Chat integrations • Digital assistant services e.g. Alexa skills Event-based Integration • Scheduled tasks, ETL • File processing e.g. images and videos • Security scanning • Complex Event Processing and Change Data Capture • Monitoring, notifications and alerting • Custom auth e.g. via API Gateway FaaS Use Cases
  14. 14. Riff is for functions
  15. 15. What is riff ? riff provides developers with a service for executing Functions in response to Events. Features ★ event streaming ★ polyglot ★ Kubernetes-native f(x) Functions Events riff
  16. 16. functions scale with events riff function controller ★ interacts with K8s API ★ scales functions 0-1 and 1-N ★ monitors event-lag in Kafka Functions Controller Event Broker K8S API
  17. 17. Installing riff via helm Set up helm Set up riff
  18. 18. Spring Cloud Function • Focus on the implementation of business logic via functions • Decouple the business logic from any specific runtime (HTTP, Message) • Support a uniform programming model across FaaS providers • Run standalone(locally or in a PaaS) • Enable Spring Boot features on FaaS providers FaaS Portable And run in Spring Boot REST, Tasks, or Streams
  19. 19. MessageHTTP Functions Spring Cloud Function Message Spring Cloud Function Web Spring Boot
  20. 20. MessageHTTP Functions Spring Cloud Function Adapter FaaS Provider Currently • AWS lambda • Azure Function • Apache Open Whisk are supported
  21. 21. Source Code
  22. 22. Use Case
  23. 23. Breaking in Monolith – Conway’s law and Microservices Order Mgmt User Mgmt Inventory Shipping Payment Order Mgmt User Mgmt Inventory Shipping Payment
  24. 24. Order Service Customer Service Product Service Microservices Architecture Order Address Item Customer Product
  25. 25. Transaction Flow – if-else init auth deduct
  26. 26. State and Command Pattern <<INTERFACE>> State Init Auth Deduct OrderRev Cancel Exception Fail Context init auth deduct exceptionfail orderRev cancel PNumCri <<INTERFACE>> Criteria IDCri StateCri Java Reflection com.example.criteria.PNumCri com.example.criteria.IDCri com.example.criteria.StateCri
  27. 27. Domain Driven Design Order Service Customer Service Message Bus createOrder orderCreateEvent orderCreateEvent creditReservedEventcreditReservedEvent
  28. 28. init auth deduct exceptionfail orderRev cancel entity id entity type event id event type event data 1010 ORDER 901 INIT 180501180104
  29. 29. init auth deduct exceptionfail orderRev cancel entity id entity type event id event type event data 1010 ORDER 901 INIT 180501180104 1010 ORDER 902 AUTH 180501180106
  30. 30. init auth deduct exceptionfail orderRev cancel entity id entity type event id event type event data 1010 ORDER 901 INIT 180501180104 1010 ORDER 902 AUTH 180501180106 1010 ORDER 903 DEDUCT 180501180109
  31. 31. SpringOne Platform 2018
  32. 32. Transforming How The World Builds Software © Copyright 2017 Pivotal Software, Inc. All rights Reserved.

×