Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

The path to a serverless-native era with Kubernetes

327 views

Published on

In this talk we'll talk about how the Serverless paradigms are changing the way we develop applications and cloud infrastructure and how we can implement them in a
efficient and seamless way with Kubernetes.
We'll go through the latest Kubernetes Serverless technologies, talking about all the aspects
including pricing, scalability, observability and best practices.

Published in: Internet
  • Be the first to comment

The path to a serverless-native era with Kubernetes

  1. 1. The path to a Serverless-native era with Kubernetes
  2. 2. Who i am Paolo Mainardi @paolomainardi ➔ ➔ CTO of Sparkfabrik ➔ CKA(D) certified, GCP Cloud Architect ➔ We are hiring!
  3. 3. What is Serverless The session ● What is the hype ● Serverless concepts (FaaS, BaaS, *aaS) ● Serverless on Kubernetes
  4. 4. The hype
  5. 5. The hype
  6. 6. The hype
  7. 7. WHAT IS SERVERLESS ?
  8. 8. “Serverless computing refers to the concept of building and running applications that do not require server management” CNCF Serverless Whitepaper v1.0 - https://github.com/cncf/wg-serverless/tree/master/whitepapers/serverless-overview
  9. 9. SERVERLESS IS ALL ABOUT THE DEVELOPER EXPERIENCE
  10. 10. 1. Cost and resource efficient — scale down to zero 2. Pay as you go — scale up on demand 3. Automation — of scale, failure handling, and recovery 4. Supporting the full dev cycle — dev, build, CI, prod SERVERLESS IS ALL ABOUT THE DEVELOPER EXPERIENCE Functions
  11. 11. What is Serverless How we think about Serverless FUNCTIONS EVENTS A piece of code (usually written in Javascript ) to perform a specific task. A response to something that happens in the cloud that triggers my functions. and
  12. 12. Functions Use case #1 Credits: https://github.com/mhausenblas/2018-state-of-faas-on-kube Translate a text file from Italian to English*. * only pay what you use
  13. 13. Functions Use case #2 Credits: https://github.com/mhausenblas/2018-state-of-faas-on-kube Process real-time data and push notifications to clients* * only pay what you use
  14. 14. What is Serverless Credits: https://www.gocd.org/2017/06/26/serverless-architecture-continuous-delivery/ Key properties of FaaS: ● Independent, server-side, logical functions ● Stateless, ephemeral ● Event-triggered ● Scalable from 0 to N ● Short-lived processes ● Fully managed by a third party (AWS Lambda, GCP Functions, Azure Functions, Alibaba Cloud Function Compute…)
  15. 15. SERVERLESS ≠ FAAS
  16. 16. BAAS - Backend as a service Credits: https://blog.neap.co/the-serverless-series-what-is-serverless-d651fbacf3f4
  17. 17. Credits: https://blog.neap.co/the-serverless-series-what-is-serverless-d651fbacf3f4 SERVERLESS IS ALL ABOUT THE BILLING MODEL
  18. 18. “A Serverless solution is one that costs you nothing to run if nobody is using it (excluding data storage)” “A simple definition of serverless,Paul Johnston, 2017”
  19. 19. What is Serverless What is Serverless ?
  20. 20. What is Serverless Serverless on public cloud ● Limited language runtimes supported (Lambda, GCP, Azure etc..) ● Vendor-proprietary mechanisms to package and deploy the functions
  21. 21. What is Serverless Serverless on public cloud ● Proprietary Event format ● Locked-in language runtime ● Limited support to run or debug functions locally
  22. 22. LOCK-IN
  23. 23. Functions Use case #3 Convert CSV files to JSON {JSON}
  24. 24. Functions Use case #3 Convert CSV files to JSON coming from multiple cloud providers {JSON}
  25. 25. Event format Use case #3 - Event format
  26. 26. Functions Use case #3 {JSON}
  27. 27. Functions Use case #3 {JSON}
  28. 28. Functions Use case #3 {JSON}
  29. 29. CloudEvents CLOUDEVENTS IS A SPECIFICATION FOR DESCRIBING EVENT DATA IN A COMMON WAY
  30. 30. CloudEvents
  31. 31. CloudEvents CloudEvents on public cloud https://azure.microsoft.com/de-de/blog/announcing-first -class-support-for-cloudevents-on-azure/ Contributors https://github.com/cloudevents/spec/blo b/master/community/contributors.md Azure Event Grid
  32. 32. WHY SERVERLESS ON KUBERNETES ?
  33. 33. Serverless & Kubernetes Developing on Kubernetes is not easy 1. It’s not the right abstractions for end-developer experience (eg: deployment, service, ingress, hpa, monitoring) 2. But it’s a great platform to build a PaaS on top of it: Primitives, Extensibility
  34. 34. Serverless & Kubernetes Developer experience Have to do Want to do Write code
  35. 35. Serverless & Kubernetes Developer experience Have to do Want to do Write code Build docker image
  36. 36. Serverless & Kubernetes Have to do Want to do Write code Build docker image Push docker image to registry Developer experience
  37. 37. Serverless & Kubernetes Have to do Want to do Write code Build docker image Push docker image to registry Expose to internet Developer experience
  38. 38. Serverless & Kubernetes Have to do Want to do Write code Build docker image Push docker image to registry Expose to internet Set-up monitoring Developer experience
  39. 39. Serverless & Kubernetes Have to do Want to do Write code Build docker image Push docker image to registry Expose to internet Set-up monitoring Set-up autoscaling Developer experience
  40. 40. Serverless & Kubernetes Have to do Want to do Write code Write code Build docker image Push docker image to registry Expose to internet Set-up monitoring Set-up autoscaling Developer experience
  41. 41. BUILD A SERVERLESS EXPERIENCE ON KUBERNETES
  42. 42. Knative ● Something to wake-up your workloads on request ● Something to scale-up and scale back to zero ● Something to turn your code into a container ● Something to collect metrics and export telemetry ● Traffic splitting and rollout strategies ● An eventing system with configurable sources and subscribers DIY FaaS on Kubernetes
  43. 43. Knative Kubernetes-based platform to build deploy and manage modern serverless workloads. Knative offers features like scale-to-zero, autoscaling and eventing framework for cloud-native applications on Kubernetes. https://knative.dev KNATIVE
  44. 44. Knative Knative collaborators
  45. 45. Knative Knative building blocks
  46. 46. Knative Knative building blocks
  47. 47. Knative What is Knative ● A set of building blocks to construct your own Paas/FaaS ○ Abstracts common Kubernetes API objects (Build, Deploy, Serve) ● An abstraction on top of Kubernetes ○ It’s still Kubernetes: It just run containers.
  48. 48. Knative Knative serving 1. Scale-up and scale back to zero 2. Fine-grained traffic routing 3. Automatic metrics and telemetry 4. Point-in-time snapshot (revisions)
  49. 49. Knative Knative eventing 1. A complete eventing system for event-driven apps. 2. Easy for developers to consume events (CloudEvents spec) 3. Pluggable, Customizable Event Sources.
  50. 50. Knative Knative build
  51. 51. Knative Knative build “Deprecating Knative Build would resolve this confusion as it would make it clear that the "building the service(s) image" part is not Knative's responsability and user can use whatever tools is capable of doing that — preferably Tekton Pipelines 👼.”
  52. 52. Knative Tektonik pipeline 1. The Tekton Pipelines project provides Kubernetes-style resources for declaring CI/CD-style pipelines 2. Builds are ran completely within Kubernetes (no need of Docker) 3. Build Templates are prepackaged descriptions of different ways to build code (Kaniko, Buildpacks and more)
  53. 53. Knative Knative-based platforms
  54. 54. Knative ● As a developer: Use it directly to deploy your stuff in a more streamlined way than raw Kubernetes. What you can do with Knative
  55. 55. Knative ● As a developer: Use it directly to deploy your stuff in a more streamlined way than raw Kubernetes. ● As an operator: Put a level of abstractions between Kubernetes and your devs; Keep the costs under control by scaling to 0 unused workloads. What you can do with Knative
  56. 56. Knative ● As a developer: Use it directly to deploy your stuff in a more streamlined way than raw Kubernetes. ● As an operator: Put a level of abstractions between Kubernetes and your devs; Keep the costs under control by scaling to 0 unused workloads. ● As a platform architect: Build your own PaaS/FaaS platform, relying on the Knative primitives. What you can do with Knative
  57. 57. KNATIVE-NATIVE PLATFORMS
  58. 58. Knative - Pivotal Riff Pivotal Riff 1. Open source project from Pivotal Vmware 2. Deep Kubernetes integration using CRDs 3. Pluggable application runtimes [Core, Knative...] 4. A custom builder based on buildpacks.io (source to container) 5. A custom cli tool “riff” to manage the entire lifecycle
  59. 59. Knative - Google Cloud Run Google CloudRun 1. Fully GCP managed beta Serverless platform based on Knative 2. Event-driven architecture (HTTP + Pub/Sub) 3. Cloud Run on GKE + Anthos (aka: GKE-on prem) 4. A sort of managed Knative + Istio Credits: https://twitter.com/ahmetb/status/1116041166359654400
  60. 60. Knative - Openshift serverless Openshift Serverless 1. OpenShift Serverless is a Technology Preview feature only (not yet supported) 2. Based on Knative Serving + Eventing + Tekton pipeline 3. Can be integrated with other OpenShift services, such as Pipelines, Service Mesh, Monitoring and Metering
  61. 61. BREAKING NEWS!
  62. 62. BREAKING NEWS https://www.theregister.co.uk/2019/10/02/google_knative_will_not_be_donated_to_any_foundation/
  63. 63. BREAKING NEWS
  64. 64. KUBERNETES-NATIVE PLATFORMS
  65. 65. Kubernetes-native serverless platforms ➔ Open source platforms ➔ Flexible language runtimes ➔ Custom CLIs ➔ Written in GO (OpenWhisk in Scala) ➔ Backed by big vendors (Oracle, IBM, Vmware) Kubernetes open-source serverless platforms
  66. 66. CNCF Serverless landscape
  67. 67. Serverless & Kubernetes Serverless on Kubernetes:
  68. 68. Serverless & Kubernetes Serverless on Kubernetes: ● Container based language runtimes
  69. 69. ● Container based language runtimes ● Multi/hybrid cloud and on your laptop Serverless & Kubernetes Serverless on Kubernetes:
  70. 70. Serverless & Kubernetes Serverless on Kubernetes: ● Container based language runtimes ● Multi/hybrid cloud and on your laptop ● Mix and match stateless and stateful workloads
  71. 71. Serverless & Kubernetes Serverless on Kubernetes: ● Container based language runtimes ● Multi/hybrid cloud and on your laptop ● Mix and match stateless and stateful workloads ● Kubernetes as the operating system for cloud-native development
  72. 72. Serverless & Kubernetes
  73. 73. In the cloud platforms, Serverless & k8s will essentially converge: “Kubernetes, just run my code”
  74. 74. GRAZIE

×