WebAssembly, or Wasm, is a technology that has generated diverse opinions in the tech community. Some consider it an alternative to JavaScript, others an improved cloud execution system, and others a replacement for Docker. However, in this article we will focus on its use within Kubernetes.
WebAssembly is not a programming language as such, but a binary code format that can be generated from languages like Go or Rust. In this case, we have chosen Rust to implement an HTTP server that simulates an endpoint of the HTTPBin test API.
Three different approaches were evaluated:
- Traditional compilation from Rust to native code
- Compilation to WebAssembly using an embedded runtime like WasmEdge
- Compilation to WebAssembly using an external runtime
One of the main reasons WebAssembly stands out is its security. Unlike traditional executables, Wasm does not have direct access to the host system, making it more secure. However, to run an HTTP server, it is necessary to open network sockets, something Wasm cannot do directly. This is where the WebAssembly System Interface (WASI) comes into play, providing standardized access for operations such as file system access, networking, and random number generation.
To run WebAssembly on Kubernetes, a compatible runtime is required. Among the most popular are Wasmtime, Wasmer, and WasmEdge, opting for the latter due to its cloud focus. However, running WebAssembly in containers requires configuring Kubernetes to handle this type of workload through a 'shim' that acts as a bridge between containerd and the Wasm runtime.
To do this, the following configurations were made:
- Installation of the WasmEdge runtime in a minikube-based environment
- Configuration of a new runtime in containerd
- Creation of pods and services capable of running WebAssembly on Kubernetes
The results showed that containers built with WebAssembly are considerably lighter compared to traditional images. While a native image had a size of 8.71 MB, the WebAssembly-based version weighed only 1.15 MB. This significant size reduction has benefits in deployment times and security.
At Q2BSTUDIO, a company specialized in development and technology services, we constantly explore new technologies to optimize cloud deployments and improve the security and efficiency of our systems. WebAssembly represents an important advance in how applications are executed in modern environments, and its integration with Kubernetes opens new opportunities for developing scalable, secure, and high-performance solutions.
The future of WebAssembly in production environments still has challenges, mainly in terms of native support from cloud infrastructure providers. However, as improvements continue to be integrated into runtimes and compatibility with Kubernetes advances, WebAssembly could establish itself as a key solution to improve security and efficiency in running cloud applications.




