State of Serverless

Serverless and FaaS computing are gaining in popularity to easily create microservice applications. In this talk we will discuss what are the characteristics of serverless, the status of the serverless working group within the CNCF and the new CloudEvents specification they’re working on, as well as the open source options available for running serverless and associated services with a focus on Kubernetes.
展开查看详情

1.State of Serverless Doug Davis ( dug@us.ibm.com | @duginabox )

2.Agenda • What is Serverless? • Why and when to use Serverless? – Serverless vs … – Use cases • CNCF Serverless Working Group • CloudEvents and beyond

3. But first...Functions as a Service (FaaS) Increasing focus on business logic Functions • Faster start-up times Containers • Better resource utilization • Finer-grained management Virtual machines • Splitting up the monolith Bare Metal Decreasing concern (and control) over infrastructure implementation 3

4.What is a Function? EVENT SHORT STATELESS LOWER DRIVEN DURATION COST

5.What is a Function? • Example: /* Javascript example */ function main(params) { var name = params.name || 'World'; return {payload: 'Hello, ' + name + '!'}; } e.g. https://openwhisk.ng.bluemix.net/api/v1/web/dug%40us.ibm.com_dev/default/test.json • Framework handles hosting and infrastructure to deal with incoming messages and response – Provide access via an HTTP(s) API – Connect to a set of "Actions" – Chaining functions to orchestrate

6.Functions as a Service Event Sources Function Execution Backend Services Kubernetes, Docker, and/or Business Hypervisor Intelligence Analytics Actions Compute, Network, Storage Databases

7.Back to Serverless... • Serverless takes FaaS and adds the notion of: • Infrastructure manages the auto-scaling of the functions based on demand • Infrastructure manages the scaling down to zero instances when not being invoked • Fine grained, pay just for what you use, cost model • Zero cost when not being executed (more on this later) • Except for persistent storage type of resources • "Serverless" means not needing to worry about managing the server

8.Serverless vs PaaS / CaaS • Very similar – Especially if PaaS / CaaS has auto-scaling feature • Similar mind-shift for VM -> PaaS / CaaS – Remove the OS and just deploy your app – Remove the "app" and just deploy a "set of functions (APIs)” • Biggest difference is the scope of the code being deployed • Function vs Application – Decompose monolithic app to individual function endpoints – E.g. can scale just "GETs" vs "Entire App" (or microservice) based on demand

9.Serverless / FaaS use cases ƒ(x) micro-service Easily implement fine-grained, micro-service APIs. Power various mobile, web and IoT app use cases by scaling and simplifying IoT the programming model of orchestrating various services. Batch and Stream Automate and control batch and stream processing Processing Automate DevOps pipeline based on events triggered from successful DevOps builds or completed staging or a go-live event. Allow an easier deployment model for administrative functions (bots) to IT/Ops run for IT/Ops. Net: Event Driven & Reusable Utilities

10.CNCF Serverless Working Group

11.CNCF Serverless Working Group • June 2017 at the request of CNCF Technical Oversight Committee (TOC) • State of tech/community & recommendations for possible involvement • Most key Serverless players involved – IBM, VMWare, Google, Red Hat, Huawei, Microsoft, AW S, SolarW inds, Docker, iguazio, Amazon, MasterCard, Pivotal, Serverless Inc., Clay Labs, The New Stack, A Cloud Guru, Platform9, Bitnami, Auth0, Hyper, ... – To date, 51 different companies have been involved – On average ~30 people join our weekly calls

12.CNCF Serverless WG: White Paper • Describes & defined Serverless as it exists today in the community – Common vocabulary – Differentiates Serverless from FaaS, PaaS, CaaS and Container Orchestration – Describes the mechanics of a generic Serverless system – Roles: Provider vs Developer – Zero cost when idle (except e.g. stateful storage costs) – Public vs Private • Highlights promising use cases and areas where already proven value • Recommendations for potential future CNCF activities

13.CNCF Serverless WG: Landscape

14.CNCF Serverless WG: Recommendations • Maintain the landscape of Serverless implementations and features • Produce additional documents and samples that educate community • Document integration with other CNCF projects, such as how to monitor and observe • Potential collaboration / harmonization on: D eve – Event format lo p e r In te – Function definition / packaging & deployment / workflow ro p

15.CNCF Serverless WG: CloudEvents • Proposed and got agreement from CNCF TOC to work on Events • Creating a common format for events – Useful across entire Cloud Native deployments, beyond just Serverless • Considering a few proposals as a starting point: – OpenEvents – (Serverless, Inc.) – Cloud-Native Event Mapping (CNEM) – (iguazio) – Cloud Auditing Data Federation (CADF) – (DMTF, IBM) • CloudEvents was born – https://cloudevents.io

16.CloudEvents Project • Define the common metadata of an Event { "cloudEventsVersion" : "0.1", "eventType" : "com.example.someevent", "eventTypeVersion" : "1.0", Its not about data. "source" : "/mycontext", "eventID" : "A234-1234-1234", Its about metadata! "eventTime" : "2018-04-05T17:31:00Z", "contentType" : "text/xml", "data" : "<much wow=\"xml\"/>" }

17.CloudEvents Use Cases • Normalize events, web-hooks, across environments • Facilitate integrations across platforms – Leave the event business logic processing to the application • First step towards portability of functions

18.CloudEvents Deliverables • CloudEvents Specification – define the metadata • Serialization Rules Specifications – JSON event format – AMQP event format • Transport Bindings Specifications – HTTP – binary and structured – MQTT – AMQP – NATS – Web-hooks • Primer

19.CloudEvents Interop Demo – KubeCon EU Publishers Middleware Subscribers Log Google Cloud Function IBM Cloud Function Azure Function Amazon S3 Serverless Event SAP Kubeless Function Gateway Nuclio Function VM Ware Dispatch Function Twitter Oracle fn Function Huawei Function RedHat OpenW hisk + OpenShift Function AW S Lambda Function Alibaba Cloud Function Azure Blob Storage Azure Event Grid https://youtu.be/TZPPjAv12K

20. CloudEvents Interop Demo – KubeCon EU https://twitter.com/CloudEventsDemo/lists/demo

21.CloudEvents Status • Released v0.1 in April 2018 • Multiple implementations planned – Kudos to Microsoft for already supporting it in Event Grid • Approved as a CNCF Sandbox Project ! • Looking at next workstream... Function Workflow Definition – Chaining, orchestrating functions • Considering others too...

22.Additional Information • CNCF Serverless Working Group – https://github.com/cncf/wg-serverless – Weekly calls on Thursdays at 8am PT Come join in! • CNCF Serverless Working Group White Paper – https://docs.google.com/document/d/1UjW 8bt5O8QBgQRILJVKZJej_IuNnxl20AJu9wA8wcdI • CNCF Serverless Landscape – https://docs.google.com/spreadsheets/d/10rSQ8rMhYDgf_ib3n6kfzwEuoE88qr0amUPRxKbwVCk • CloudEvents – https://github.com/cloudevents/spec – http://cloudevents.io

23.Questions Thank You Doug Davis STSM, IBM ( dug@us.ibm.com ) duglin @duginabox

24.