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.
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
11. 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
12. 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
13. 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
14. 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
15. 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…)
19. “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”
21. What is Serverless
Serverless on public cloud
● Limited language runtimes supported (Lambda, GCP, Azure etc..)
● Vendor-proprietary mechanisms to package and deploy the functions
22. What is Serverless
Serverless on public cloud
● Proprietary Event format
● Locked-in language runtime
● Limited support to run or debug functions locally
34. 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
37. Serverless & Kubernetes
Have to do Want to do
Write code
Build docker image
Push docker image to registry
Developer experience
38. Serverless & Kubernetes
Have to do Want to do
Write code
Build docker image
Push docker image to registry
Expose to internet
Developer experience
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
Developer experience
40. 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
41. 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
43. 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
44. 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
48. 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.
49. 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)
50. 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.
52. 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 👼.”
53. 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)
55. 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
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.
What you can do with Knative
57. 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
59. 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
60. 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
61. 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
66. 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
70. ● Container based language runtimes
● Multi/hybrid cloud and on your laptop
Serverless & Kubernetes
Serverless on Kubernetes:
71. Serverless & Kubernetes
Serverless on Kubernetes:
● Container based language runtimes
● Multi/hybrid cloud and on your laptop
● Mix and match stateless and stateful workloads
72. 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