Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WebAssembly beyond the browser: Let's conquer t...

Thorsten Hans
December 07, 2021

WebAssembly beyond the browser: Let's conquer the cloud with WASM in AKS

WebAssembly is the next big thing on the server and in the cloud. By leveraging tools like krustlet, we can get rid of containers in Kubernetes! What does that mean? What can you achieve today, and what is still experimental? And how can you get hands-on right now? Join this talk by Azure MVP and cloud-native enthusiast Thorsten Hans to get those questions answered. It's time to embrace the platform of the future.

Thorsten Hans

December 07, 2021
Tweet

More Decks by Thorsten Hans

Other Decks in Technology

Transcript

  1. What we will cover today • Introduction • What is

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

    krustlet and how can I get it • Running WebAssembly workloads in Kubernetes • Conclusion Talking Points
  3. 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
  4. WebAssembly System Interface (WASI) • Platform Integration 🧬 • WASI

    is a wrapper for underlying platform (OS) capabilities • Think of things like File::open() • Secure 👮 • Permissions can be defined per app (module) • Future 🚀 • WASI could become the default compiling target for EVERYONE! Introduction
  5. 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
  6. What we will cover today • Introduction • What is

    krustlet and how can I get it • Running WebAssembly workloads in Kubernetes • Conclusion Talking Points
  7. 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
  8. 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
  9. • 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
  10. Why Azure • Krustlet is developed in the open, mostly

    by Microsoft FTEs • Azure is an early adopter for krustlet • We can add krustlet to Azure Kubernetes Service (AKS) • Azure CLI extension is currently in preview • It brings support for WebAssembly Gateway Interface (WAGI) out of the box Krustlet
  11. What we will cover today • Introduction • What is

    krustlet and how can I get it • Running WebAssembly workloads in Kubernetes • Conclusion Talking Points
  12. WebAssembly beyond the server in Action 🎉 - Running simple

    Wasm workloads in Kubernetes - Running WASI workloads in Kubernetes - Running WAGI workloads in AKS Demo
  13. What we will cover today • Introduction • What is

    krustlet and how can I get it • Running WebAssembly workloads in Kubernetes • Conclusion Talking Points
  14. • Running Wasm workloads in the cloud will allow better

    resource utilization • We don’t need to package applications in containers • Strickt sandboxing (WASI) will enahnce overall platform security and robustness • It’s still a bit early – especially in managed Kubernetes (where we’ve limited control) Conclusion
  15. further questions?!?! Thorsten Hans @ThorstenHans Consultant Don’t be afraid. Shoot

    your question now in person, or later at [email protected] or @ThorstenHans thns.io/slides