Building and Running an Enterprise-grade Serverless Platform on Kubernetes Quinton Hoole, Technical VP Ying Huang, Sr. Architect US R&D, Huawei
Outlines Introduction to Serverless Computing The Architecture of Huawei Cloud Serverless Solution (FunctionStage) Demo Challenges and Solutions Resources
What is Serverless Computing Function-as-a-Service – a cloud computing execution model Event-driven Resource allocation per function Auto scaling in/out based on actual workload - no tedious planning for peak traffic Billing based on actual resource usage - no cost for idle Fast response: cold start < 2s No VM/OS maintenance Natural fast design/development/publish based on rich ecosystem
A Typical Serverless Application Object Storage Function API Gateway Function AI Service Function Relational DB
Current Serverless Platforms and Products
Huawei Serverless Computing Solution – FunctionStage Overview IAAS PaaS Core (based on Kubernetes): IAM, Logging, Monitor, etc. Serverless Framework DMS Trigger DIS Trigger OBS Trigger HTTP Trigger … Function Runtime DMS Developers DIS OBS HTTP Function Repository Product design and development platform Code Bank CI/CD SMN SMN Trigger Resources Data Input FunctionStage Core
Function Model Function definition – customer source code + library Function instance Wrapped to container, distributed by docker and Kubernetes Three layer of images OS Layer Language specific function runtime library (public) Customer function User Function Runtime Library OS Layer
FunctionStage Architecture Overview Service Event SMN Trigger API Gateway 1. Customer Request Request Http Trigger 2. Function Call Async Call Service Event OBS Trigger Request Dispatcher / Instance Cache Message Queue Function Repository 3. Get Container 6. Function Call Kubernetes API Server 5. Pull function code 4. Schedule Container Function Runtime A1 Function Runtime B1 Function Runtime N1 Function Runtime Ai Function Runtime Bj Function Runtime Nm
Demo Use case: as a person who likes photography and travel, I want to share my pictures with friends immediately Travel light with ability to share best pictures immediately A low cost website that can upload and process pictures for me A Static webpage hosted by Huawei Object Storage that can upload pictures into OBS bucket A function to process the picture hosted by FunctionStage OBS object uploads triggers function to process the picture and save into anther bucket
Challenges and Solutions Challenge 1 - fast response requirement (cold start < 2s) Current Kubernetes offering limited pod scheduling capacities Solutions Resource pool managed by Kubernetes (-2s+) System controlled code injection into empty runtime JVM resource sharing
Challenges and Solutions - continue Challenge 2 – Security vs. Usability Causes: Huawei Cloud uses internal certified linux system – Centos Third party libraries that are not certified are not allowed to built into system Many standard libraries are not built into function runtime Solution: Be our own customer, felt the pain and invent solution
Challenges and Solutions - continue Challenge 3 - N How to catch up fast with big players ahead for 3+ years Company VPN Cross continental (America/Asia), multi countries design/development team (America/Canada/China/India) You name it, we have it
Resources Huawei Cloud: https://www.huaweicloud.com FunctionStage: http://www.huaweicloud.com/product/functionstage.html Function Examples: https://github.com/FunctionStage Demo: https://goo.gl/8EiQXG
Questions?
Thank You! Quinton Hoole Ying Huang