democratize serverless platform with knative · 2019. 9. 12. · cloud provider’s serverless...

30
Democratize Serverless Platform With Knative Mahesh Veerabathiran Guhan Selvaraj

Upload: others

Post on 03-Oct-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Democratize Serverless Platform With Knative

Mahesh Veerabathiran Guhan Selvaraj

Page 2: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Is Serverless only FaaS?

Serverless is a pattern of sharing responsibilities between

developers and operators.

Page 3: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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?

Page 4: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Existing hosted serverless platforms

Source: https://landscape.cncf.io/format=serverless

Page 5: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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

Page 6: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

COLD START

Page 7: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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

Page 8: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

PA

IN A

RE

AS

Page 9: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

“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”

Page 10: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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

Page 11: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler
Page 12: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Beyond stateless workloads

Source: The State of k8s 2018 by Heptio

Page 13: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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”

Page 14: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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!

Page 15: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Container vs Serverless

Page 16: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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

Page 17: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Knative embraces Istio, an open-source service mesh, to

connect, secure, control & observe traffic.

Source: https://github.com/knative/docs

Page 18: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Knative - Primitives

Page 19: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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!"

Page 20: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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

Page 21: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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.

Page 22: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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

Page 23: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

@mahes

hvra

https://www.linkedin.com/in/a

boutmahesh

Thank you!

Questions?

Page 24: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

Appendix

Page 25: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

• 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.

Page 26: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler
Page 27: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

OSS FAAS frameworks

• Knative

• Openfaas

• Nuclio

• Fission

• Kubeless

• Project Riff

Page 28: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

“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

Page 29: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

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.

Page 30: Democratize Serverless Platform With Knative · 2019. 9. 12. · cloud provider’s serverless platform. Two built-in types: - Concurrency based autoscaler - CPU usage based autoscaler

“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