Slide 1

Slide 1 text

Cloud-Native vNext WebAssembly in Azure & AKS Thorsten Hans @ThorstenHans Cloud-Native Consultant

Slide 2

Slide 2 text

Consultant @ Thinktecture #Azure #Kubernetes #CloudNative #Docker [email protected] thinktecture.com thorsten-hans.com @ThorstenHans Microsoft MVP | Docker Captain Thorsten Hans

Slide 3

Slide 3 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 4

Slide 4 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 5

Slide 5 text

Key Concepts • WebAssembly (Wasm) • WebAssembly System Interface (WASI) • WebAssembly Gateway Interface (WAGI) Introduction

Slide 6

Slide 6 text

WebAssembly (Wasm) WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications. Introduction https://webassembly.org/

Slide 7

Slide 7 text

WebAssembly (Wasm) Introduction fast Near native execution performance, leveraging available hardware capabilities safe Wasm is a memory-safe and sandboxed execution environment portable All major browsers support Wasm & multiple server runtimes are available open WebAssembly Text Format .wat can be used to learn, read ,debug Wasm

Slide 8

Slide 8 text

WebAssembly System Interface (WASI) • A standard engine-independent non-web system-oriented API for WebAssembly • WASI is here to standardize how Wasm is executed outside of the browser • Wasm uses platform agnostic APIs provided by WASI • WASI interacts with platform specific APIs • WASI aligns with the Wasm promise of being a secure sandbox • As developer, WASI is your compilation target cargo build --target wasm32-wasi Introduction

Slide 9

Slide 9 text

Portability Introduction https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

Slide 10

Slide 10 text

Security – Before WASI Introduction https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

Slide 11

Slide 11 text

Security – Before WASI Introduction https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

Slide 12

Slide 12 text

Security – Before WASI Introduction https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

Slide 13

Slide 13 text

Security – With WASI Introduction https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

Slide 14

Slide 14 text

WebAssembly Gateway Interface (WAGI) • Use WebAssembly modules as HTTP handlers • Think of a hyper-focused microservices runtime • Comman Gateway Interface (CGI) implementation • HTTP headers become environment variables • HTTP payloads are piped to stdin • HTTP responses must be written to stdout Introduction

Slide 15

Slide 15 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 16

Slide 16 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 17

Slide 17 text

• Fermyon Technologies (founded in November 2021) • https://www.fermyon.com/ • ”Pioneering the next wave of cloud computing” • Many familiar faces that you may know from Deis Labs (aquired by Microsoft in April 2017) • Fermyon is all about WebAssembly on the server and in the cloud Who is Fermyon

Slide 18

Slide 18 text

• Spin is a runtime that hosts and instantiates Wasm modules when triggers are invoked • It leverages the WebAsssembly Component Model • Spin is an SDK • That provides APIs for common scenarios like outbound HTTP, Redis, PostgreSQL • Spin is a developer toolchain • For crafting, running, and deploying your applications • Spin is language agnostic • You can use any language that compiles to wasm32_wasi What is Spin

Slide 19

Slide 19 text

Hands-On Fermyon Spin - Let’s get started with Spin Demo

Slide 20

Slide 20 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 21

Slide 21 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 22

Slide 22 text

• Microsoft (especially the OSS team in the Azure Division) is already adopting it in AKS • https://www.infoworld.com/article/3681853/azure-kubernetes-doubles-down-on-webassembly.html • Previously Krustlet (Kubelet written in Rust 🦀) was used to run WebAssembly workloads • Microsoft announced the preview of their new WASM story at Ignite 2022 • Dedicated AKS Node Pools support wasm32_wasi leveraging runwasi • runwasi is used in conjunction with containerd-shims for SpiderLightning (slight) and Spin 🎉 WebAssembly in Azure and AKS

Slide 23

Slide 23 text

• TBH: its still early • Plain Container Image is used for distribution • As of today, only simple workloads are supported WebAssembly in Azure and AKS

Slide 24

Slide 24 text

WebAssembly in AKS with Spin - Distributing your Spin applications - Run a Spin application in AKS Demo

Slide 25

Slide 25 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 26

Slide 26 text

• Introduction • Let’s meet Fermyon Spin • WebAssembly in Azure with AKS • Conclusion Agenda

Slide 27

Slide 27 text

• The combination of Containers & WASM will become the default • The imapact of Wasm will be way bigger for backend devs compared to frontend devs • Running Wasm workloads in the cloud will allow better resource utilization • Strict sandboxing (WASI) will enahnce overall platform security and robustness • It’s still early – especially in managed Kubernetes (where we’ve limited control) • Spin and Fermyon Cloud (or Platform) currently drive developer adoption Conclusion

Slide 28

Slide 28 text

Thanks for your attention @ThorstenHans