democratize serverless platform with knative · 2019. 9. 12. · cloud provider’s serverless...
TRANSCRIPT
Democratize Serverless Platform With Knative
Mahesh Veerabathiran Guhan Selvaraj
Is Serverless only FaaS?
Serverless is a pattern of sharing responsibilities between
developers and operators.
How To Fit In
• Should we change the way we code?
• Should we switch to another language to
fit in?
• Should we change our deployment
pipeline to conform to cloud provider
services?
Existing hosted serverless platforms
Source: https://landscape.cncf.io/format=serverless
FaaS Providers Comparison
AWS GOOGLE AZURE
• Supports Java, Go,
PowerShell, Node.js, C#,
Python, and Ruby
• Supports Node.js (6 & 8),
Python (Beta), and Go (Beta)
• Supports C#, F#, Node.js (6,
8, 10), Java (v8 Preview),
Python (Preview)
• Should implement handler
function from AWS libraries
to execute the application
business logic
• Limitations on migrating
existing services to
serverless platform
• Limitations on migrating
existing services to
serverless platform
• Can be invoked only through
AWS specific triggers
• No platform specific libraries
required for implementation
• Implements platform specific
libraries, create json files
COLD START
Vendor lock-in
• Cannot avoid it after modifying application
to run in vendor environment.
• Closes the door for easy migration.
• Step functions are cool, but now you’re in
their web.
• Forced to use provider specific monitoring
and tracing tools.
• Integrating with other open-source solutions is
cumbersome.
• Get isolated from rest of enterprise services
monitoring dashboard.
Varied monitoring
PA
IN A
RE
AS
“Kubernetes is a Leading Container Orchestrator for cloud
native application, it governs container orchestration,
scheduling and cluster management”
“K8s is the de-facto standard for container orchestration”
Reasons to love K8s
Load balancing &
Autoscaling are built
into K8s core.
Supports rolling
updates by default.
Ensure zero-downtime
deployments
Native features to
implement Blue/Green
& Canary deployment
Failover built-in. K8s
maintains desired
state.
Cloud provider
agnostic. Supports
Multi-cloud & Hybrid
infra.
Well defined
specification for CRI,
CSI. #Extensible
Beyond stateless workloads
Source: The State of k8s 2018 by Heptio
K8s motivates OSS adoption
Kubernetes appears to be
helping build people’s
confidence in open source
software as a whole.
Source: The State of k8s 2018 by Heptio
“K8s is an operating system for the cloud native world”
How K8s transforming Serverless landscape
K8s closes the gap between container & serverless workloads.
They are not poles apart, in fact, they have lot in common!
Containers Orchestrator Image registry
*Ownership and Abstraction differs!
Container vs Serverless
Knative
Knative leverages the strong foundation of K8s and built middleware
components to support capabilities similar to managed service platform.
An opensource serverless add-on built on K8s
Knative current partners includes IBM, Pivotal, RedHat
Knative embraces Istio, an open-source service mesh, to
connect, secure, control & observe traffic.
Source: https://github.com/knative/docs
Knative - Primitives
E.g. Simple function deployment manifest
apiVersion: serving.knative.dev/v1alpha1 # Current version of Knative
kind: Service
metadata:
name: hello-go # The name of the app
namespace: default # The namespace the app will use
spec:
runLatest:
configuration:
revisionTemplate:
spec:
container:
image: gcr.io/devfestkc/hello-go # container image
env:
- name: TARGET # environment variable
value: "Hello everyone!"
Serving - Under the hood
KNATIVE SERVICE
CONFIGURATION
Revision
DEPLOYMENT
P P P
DEPLOYMENT
P P P
DEPLOYMENT
P P P
ROUTES
P => K8s Pod
Revision
Revision
Leverage Istio
ingress gateway
to route traffic to
pinned or latest
version
Configuration maintains revision
of point-in-time snapshot of
function code & config.
Manages the desired
state of deployment.
Scale up pods and
back to zero based
on demand
Higher order K8s resource for
managing lifecycle of a SLS
workload
Supports autoscaling on-demand as good as any
cloud provider’s serverless platform.
Two built-in types:
- Concurrency based autoscaler
- CPU usage based autoscaler
Fine grained control of lower and upper bound
configuration of pod autoscaling at function level
Defaults to scale up a pod for
every 1000 concurrent requests
Defaults to scale up a pod when current
CPU usage exceeds 80 percent
Provides superior configuration
control and transparency in
autoscaling.
Avoid cold-start issues by disabling scale
back to zero.
Configuration support of defining global
autoscaling parameters.
Supports blue-green deployment
apiVersion: serving.knative.dev/v1alpha1
kind: Route
metadata:
name: blue-green-demo
namespace: default
spec:
traffic:
- revisionName: blue-green-demo-00001
percent: 100 # All traffic still going to the first revision
- revisionName: blue-green-demo-00002
percent: 0 # 0% of traffic routed to the second revision
name: v2 # A named route
@mahes
hvra
https://www.linkedin.com/in/a
boutmahesh
Thank you!
Questions?
Appendix
• Need to re-implement in either go,
python, node.js for better
performance.
• Implement pingers to prevent
applications from going cold.
• Increased cold start time when
implemented in VPCs.
Cold start Code portability
• Code needs to be changed to extend
provider specific interfaces to expose
as a service.
• Forced to change the code to satisfy
the SDKs provided by platform.
• New configurations are needed to
provide access to the service.
OSS FAAS frameworks
• Knative
• Openfaas
• Nuclio
• Fission
• Kubeless
• Project Riff
“Kubernetes does the things that the very best system administrator
would do: automation, failover, centralized logging, monitoring. It takes
what we’ve learned in the DevOps community and makes it the default,
out of the box” – Kelsey Hightower
The state of OSS FAAS Adoption in enterprise
K8s was not the first one to
hit market. ECS is still being
used largely by early
adopters.
Since most of the enterprise
workloads are stateless in
nature, don’t see a enough
reason to move to k8s.
Early adopters of containers Operational burden NoOps movement
K8s has strong reputation of
being complex and involves
steep learning curve.
Any container orchestrator
brings in operational
maintenance which is
frowned upon.
Fall of DevOps this year,
followed by overwhelming
support request to DPE
teams, leading to the path
of NoOps.
Enterprise loves fully
managed services.
“K8s mainstream adoption is critical to the success
of Knative and other OSS FAAS.”
K8s has enough features beyond the dream of multi-cloud.
Managed K8s service will thrive and increase adoption.
EKS enterprise readiness is very important for next wave of adoption.
Knative attempts to bring life to the concept of Funtainers.
The concept has lot of potential to become a standard