Slide 1

Slide 1 text

Cloud-Native vNext with WebAssembly?! Using Krustlet & Fermyon Spin Thorsten Hans @ThorstenHans Cloud-Native Consultant

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

What we will cover today • Introduction • WebAssembly beyond the browser • Running WebAssembly workloads in Kubernetes • Running WebAssembly without Kubernetes • Conclusion Talking Points

Slide 4

Slide 4 text

What we will cover today • Introduction • Hello Spin & Hello Krustlet • Run Wasm modules with Spin • Run Wasm workloads with Krustlet • Conclusion Talking Points

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

WebAssembly (Wasm) • It’s virutal machine that processes stack-based instructions • Instruction are in binary format • For us as devs It’s a compiler target – so we compile our code into WebAssembly modules Introduction

Slide 7

Slide 7 text

WebAssembly (Wasm) • Fast 🏃‍‍‍ • Near native execution performance, leveraging available hardware capabilities • Safe 💪‍ • Wasm is a sandboxed, memory-safe execution environment • Portable 🧊 • All major browsers support Wasm & multiple ”server” Wasm runtimes available Introduction

Slide 8

Slide 8 text

WebAssembly System Interface (WASI) • Platform Integration 🧬 • WASI is a wrapper for underlying platform (OS) capabilities • Think of things like File:: open() • Portable 🚀 • WASI could become the default compiling target for EVERYONE! • Secure 👮‍ • Permissions can be defined per app (module) 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 Introduction https://hacks.mozilla.org/2019/03/standardizing-wasi-a-webassembly-system-interface/

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

Security 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

What we will cover today • Introduction • WebAssembly beyond the browser • Running WASM with Krustlet • Running WASM with Fermyon Spin • Conclusion Talking Points

Slide 16

Slide 16 text

Kubernetes-rust-kubelet • Krustlet is a kubelet written in Rust 🦀 • It responds to well-know Kubernetes requests like kubectl logs, kubectl describe, kubectl delete, … • Krustlet communicates with Kubernetes API server using HTTPs and reports status back like a regular kubelet, • Krustlet comes with providers. A provider specifies requirements for underlying Wasm runtime. Krustlet uses wastime by default, but you can choose a different provider such as WasmCloud or CRI What is krustlet

Slide 17

Slide 17 text

Kubernetes-rust-kubelet • It’s a binary – which attaches compute power to a Kubernetes cluster • Krustlet can be added to a wide variety of different Kubernetes distributions • Start small with dev environments like minikube or KIND • Grow to full blown Kubernetes distributions like bare metal Kubernetes or managed Kubernetes offerings like AKS, EKS, GKS What is krustlet

Slide 18

Slide 18 text

• Install krustlet with your Kubernetes cluster • krustlet is “Kubernetes-vendor” agnostic • Check https://docs.krustlet.dev/ for detailed installation guidance • Gain access to a container registry (must be OCI distribution spec compliant) • Azure Container Registry is used during this talk • Compile your code against wasm32-wasi • rustup target add wasm32-wasi && cargo build --release --target wasm32-wasi Krustlet

Slide 19

Slide 19 text

Krustlet integration with Kubernetes - Add krustlet to Kubernetes - Inspect krustlet nodes in a cluster Demo

Slide 20

Slide 20 text

What we will cover today • Introduction • What is krustlet and how can I get it • Running WebAssembly workloads in Kubernetes • Running WebAssembly without Kubernetes • Conclusion Talking Points

Slide 21

Slide 21 text

WebAssembly beyond the server in Action 🎉 - Running simple Wasm workloads in Kubernetes - Running WASI workloads in Kubernetes Demo

Slide 22

Slide 22 text

What we will cover today • Introduction • What is krustlet and how can I get it • Running WebAssembly workloads in Kubernetes • Running WebAssembly without Kubernetes • Conclusion Talking Points

Slide 23

Slide 23 text

• Fermyon (https://www.fermyon.com/) is massively driving Wasm for cloud computing • Spin – a framework to build microservices with WebAssembly • Fermyon Platform is a platform for running WebAssembly workloads • Could be hosted in your private datacenter too using Nomand • No hazzle with managing underlying Kubernetes • Feels ”serverless” for the developer Running WebAssembly without Kubernetes

Slide 24

Slide 24 text

Let’s give spin a spin 🚀 - Create a microservice with spin - Run microservices with spin Demo

Slide 25

Slide 25 text

What we will cover today • Introduction • What is krustlet and how can I get it • Running WebAssembly workloads in Kubernetes • Running WebAssembly without Kubernetes • Conclusion Talking Points

Slide 26

Slide 26 text

• Running Wasm workloads in the cloud will allow better resource utilization • We don’t need to package applications in containers • 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 Platform currently drive developer adoption in the community Conclusion

Slide 27

Slide 27 text

further questions?!?! Thorsten Hans @ThorstenHans Consultant Don’t be afraid. Shoot your question now in person, or later at thorsten.hans@outlook.com or @ThorstenHans thorsten-hans.com