33
Packaging Applications in a Serverless World - Sebastien Goasguen @sebgoa 1

Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Packaging Applications in a Serverless World

- Sebastien Goasguen @sebgoa

1

Page 2: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Hi,

2

● 14 years in US, long time in Academia● Electromagnetics and Nanoelectronics● Open Science Grid, TeraGrid, CERN● System Experimentators● Advocate / Speaker / Writer● Product Owner / Product Manager

Page 3: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

K8s work

● kompose (second project in incubator after helm)

● kmachine● Cabin● kubeless (github.com/kubeless/kubeless)● O’Reilly training, LF training for certification …

3

Page 4: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Serverless: A few basics to warmup

4

Page 5: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Preface

no silver bullet

an evolution

that we must pay attention to, understand it

ease of application deployment -> dev onboarding

5

Page 6: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

6

Page 7: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Serverless

7

Page 8: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

AWS Lambda

8

Page 9: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

AWS CLI

$ aws lambda create-function \--region us-west-2 \--function-name CreateThumbnail \--zip-file fileb://file-path/CreateThumbnail.zip \--role role-arn \--handler CreateThumbnail.handler \--runtime runtime \--profile adminuser \--timeout 10 \--memory-size 1024

9

Page 10: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

What is a serverless application ?

“service full”

“finer pay as you use model”

10

Page 11: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

What type of Apps ?

11

Page 12: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Data Streams and Processing

12

Page 13: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Concepts

● Function endpoints ( CGI ? )

● Triggers

● Events

13

Page 14: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Serverless and FaaS Solutions

14

Page 15: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Building Kubeless

15

● FaaS on on-premises, does it even make sense ?

Page 16: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Kubernetes Native

● Extend Kubernetes● Use Kubernetes API Objects● Leverage other primitives like: Horizontal Pod AutoScaler● Use CNCF monitoring - Prometheus● Use Istio/Envoy for traffic encryption, distributed tracing and more

Extend Kubernetes

16

Page 17: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Architecture

17

Page 18: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

But this is all about Events and Triggers !

18

Page 19: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

CloudEvents

19

Page 20: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Decoupling Runtimes and Triggers

To be able to scale languages and event sources

Break up the event consuming mechanism from the runtime

All function are now called over HTTP

“Trigger” controllers spawns consumers and dispatches to endpoints.

20

Page 21: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Scaling Event Sources

21

Page 22: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Triggers (aka binding) as CRD

apiVersion: kubeless.io/v1beta1

kind: KafkaTrigger

metadata:

labels:

created-by: kubeless

function: slack

name: slack

spec:

functionSelector:

matchLabels:

created-by: kubeless

function: slack

topic: slack

22

Page 23: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

CI/CD and Packaging

23

Closely tied to how you package a k8s app

Page 24: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Docker as a package

Function/code inside the image, onus on the users to build docker

Where are we on the spectrum ? (k8s or PaaS or something else)

Reproducibility (base image ?) and immutability issues (tags ? )

24

Page 25: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Applications on k8s

Multiple containers

Lots of other _things_ (services, ingress, pvc, cm …)

60 configuration tools

Helm as the leading package manager (chart as a tarball of k8s manifests)

25

Page 26: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

CI/CD on AWS

26

Page 27: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

CI/CD on GCP/GKE

27

Page 28: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Google Container Builder

28

Page 29: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

No package

Users do not write Dockerfile

Users do not write k8s manifest

There is no artifact (at least in the eye of the beholder)

There is just code

… and a declarative manifest

29

Page 30: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Loving it !

Not infra focused

Not build focused

Code focused

but Delivery focused

30

Page 31: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Service Full App Package

https://github.com/bitnami-labs/redisdemo

A tarball / zip of declarative manifests

Includes functions

Includes cloud services

helm install --name todo . --set ingress.host=todo.kubeless.sh

31

Page 32: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Serverless is coming

Still very early

Cloud vs On-premises

CI/CD in the Cloud

A blob is a blob is a blob

Immutable and reproducible

32

Page 33: Serverless World Packaging Applications in a · 2018. 6. 22. · What is a serverless application ? “service full” “finer pay as you use model” 10. What type of Apps ? 11

Thank You@sebgoahttps://github.com/kubeless/kubeless

33