---
title: "WebAssembly on Kubernetes — wasmCloud Operator | wasmCloud"
description: "Run WebAssembly on Kubernetes with the wasmCloud operator — native CRDs, Helm-based install, and ergonomic integration with your existing K8s cluster."
canonical: "https://wasmcloud.com/docs/kubernetes-operator/"
---

Version: v2

# Kubernetes Operator

## The wasmCloud operator makes it easy to run wasmCloud and WebAssembly workloads on Kubernetes.

We use the [operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) to run wasmCloud on Kubernetes, leveraging the orchestrator to schedule wasmCloud infrastructure and workloads.

By aligning to Kubernetes, teams can adopt WebAssembly (Wasm) progressively—and integrate wasmCloud with existing tooling for ingress, registries, CI/CD, and other areas of the cloud-native ecosystem.

## The wasmCloud platform on Kubernetes

Along with the wasmCloud operator, the wasmCloud platform on Kubernetes consists of these core parts:

- [**Custom resource definitions (CRDs)**](https://wasmcloud.com/docs/kubernetes-operator/crds/) for wasmCloud infrastructure and Wasm workloads.
- [**wasmCloud host(s)**](https://wasmcloud.com/docs/glossary/#host) - Sandboxed runtime environments for WebAssembly components. (By default, these are `wash` binaries using the `wash host` command to run a [cluster host (washlet)](https://wasmcloud.com/docs/runtime/washlet/) that surfaces the `wash-runtime` API over NATS.)
- [**NATS with JetStream**](https://wasmcloud.com/docs/glossary/#nats) - CNCF project that provides a connective layer for transport between operator and hosts, along with built-in object storage through JetStream. NATS carries all control-plane traffic to the host (the host never communicates directly with the Kubernetes API). The operator sends workload start/stop requests to individual hosts via NATS subjects, and hosts self-register by publishing heartbeat messages the operator subscribes to. The Helm chart bundles NATS automatically—you can also connect an existing NATS cluster by setting `nats.enabled: false` and pointing the operator at your endpoint.

HTTP traffic reaches workloads through standard Kubernetes Services: the operator manages an EndpointSlice for each user-defined Service referenced by a workload, so cluster DNS (e.g. `my-svc.default.svc.cluster.local`) resolves directly to the host pods. See [Expose a Workload via Kubernetes Service](https://wasmcloud.com/docs/recipes/expose-workload-via-kubernetes-service/) for the full pattern.

> **Runtime Gateway (deprecated)**
>
> Earlier releases proxied HTTP traffic through a separate Runtime Gateway deployment. It is deprecated (since 2.0.3) and will be removed in a future release. The chart still installs the gateway pod by default for backwards compatibility; set [`gateway.enabled: false`](https://wasmcloud.com/docs/kubernetes-operator/operator-manual/helm-values/#gateway-deprecated) to skip it.

The entire platform can be deployed with [Helm](https://helm.sh/docs) using the [**wasmCloud operator Helm chart**](https://github.com/wasmCloud/wasmCloud/tree/main/charts/runtime-operator). (NATS and hosts can also be installed separately, if you wish.)

For a detailed breakdown of each component's responsibilities and the request flow, see the [Operator Overview](https://wasmcloud.com/docs/kubernetes-operator/operator-manual/overview/). For commonly-overridden chart values, see the [Helm Values Reference](https://wasmcloud.com/docs/kubernetes-operator/operator-manual/helm-values/).

## Get started with the wasmCloud operator

Installation requires the following tools:

- [`kubectl`](https://kubernetes.io/docs/tasks/tools/#kubectl)
- [Helm](https://helm.sh/docs) v3.8.0+

Select your Kubernetes environment:

**Existing cluster**

If you already have a Kubernetes cluster, skip cluster creation. Verify your `kubectl` context is pointing to the right cluster:

shell

```shell
kubectl cluster-info
```

**kind**

[kind](https://kind.sigs.k8s.io/) runs Kubernetes nodes as Docker containers.

**Requirements:** [Docker](https://docs.docker.com/get-started/get-docker/) · [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)

The following command downloads a `kind-config.yaml` from the [`wasmCloud/wasmCloud`](https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/deploy/kind/kind-config.yaml) repository, starts a cluster with port 80 mapped for ingress, and deletes the config upon completion:

shell

```shell
curl -fLO https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/deploy/kind/kind-config.yaml && kind create cluster --config=kind-config.yaml && rm kind-config.yaml
```

**k3d**

[k3d](https://k3d.io/) runs a lightweight [k3s](https://k3s.io/) cluster inside Docker.

**Requirements:** [Docker](https://docs.docker.com/get-started/get-docker/) · [k3d](https://k3d.io/#installation)

The `--port` flag maps host port 80 to NodePort 30950 on the server node. The hello-world manifest exposes the workload as a `NodePort` Service on port 30950, so this maps the Wasm component directly to `localhost:80` without going through k3d's bundled Traefik LoadBalancer:

shell

```shell
k3d cluster create wasmcloud --port "80:30950@server:0"
```

If you'd prefer the `LoadBalancer` pattern more typical of k8s production deployments, see the [Expose a Workload via Kubernetes Service](https://wasmcloud.com/docs/recipes/expose-workload-via-kubernetes-service/#exposing-the-service-externally) recipe.

**k3s**

[k3s](https://k3s.io/) is a lightweight Kubernetes distribution. **Linux only.**

Install k3s:

shell

```shell
curl -sfL https://get.k3s.io | sh -
```

Configure `kubectl` to use the k3s cluster:

shell

```shell
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $USER ~/.kube/config
```

### Install the wasmCloud operator

Use Helm to install the wasmCloud operator from an OCI chart image:

**Existing cluster**

shell

```shell
helm install wasmcloud --version 2.13.0 oci://ghcr.io/wasmcloud/charts/runtime-operator \
  --namespace wasmcloud --create-namespace \
  -f https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/charts/runtime-operator/values.local.yaml
```

**kind**

The [`values.local.yaml`](https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/charts/runtime-operator/values.local.yaml) file configures the host HTTP port to 80, which the kind cluster config maps to host port 80 via a NodePort Service:

shell

```shell
helm install wasmcloud --version 2.13.0 oci://ghcr.io/wasmcloud/charts/runtime-operator \
  --namespace wasmcloud --create-namespace \
  -f https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/charts/runtime-operator/values.local.yaml
```

**k3d**

shell

```shell
helm install wasmcloud --version 2.13.0 oci://ghcr.io/wasmcloud/charts/runtime-operator \
  --namespace wasmcloud --create-namespace \
  -f https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/charts/runtime-operator/values.local.yaml
```

**k3s**

shell

```shell
helm install wasmcloud --version 2.13.0 oci://ghcr.io/wasmcloud/charts/runtime-operator \
  --namespace wasmcloud --create-namespace \
  -f https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/charts/runtime-operator/values.local.yaml
```

Along with the wasmCloud operator, wasmCloud CRDs, and NATS, the Helm chart will deploy **three wasmCloud hosts** using the [`wasmcloud/wash`](https://github.com/wasmCloud/wasmCloud/pkgs/container/wash) container image.

You can extend hosts with [host plugins](https://wasmcloud.com/docs/glossary/#host-plugin): native plugins require a custom host build, while host component plugins run on the published all-features image (`2.13.0-all-features`, since 2.10.0).

> **Note**
>
> You can find the full set of configurable values for the chart in [`wasmCloud/wasmCloud/charts/runtime-operator`](https://github.com/wasmCloud/wasmCloud/blob/main/charts/runtime-operator/values.yaml).

Verify the deployment:

shell

```shell
kubectl get pods -l app.kubernetes.io/instance=wasmcloud -n wasmcloud
```

Once all pods are running, you're ready to deploy a Wasm workload.

### Deploy a Wasm component

Deploying a Wasm component that handles HTTP traffic takes two resources: a Kubernetes `Service` that exposes the component, and a [`WorkloadDeployment`](https://wasmcloud.com/docs/kubernetes-operator/crds/#workloaddeployment) that references the Service. The operator creates an EndpointSlice for the Service pointing at whichever host pods are running the workload.

yaml

```yaml
apiVersion: v1
kind: Service
metadata:
  name: hello-world
spec:
  type: ClusterIP
  ports:
    - port: 80
      targetPort: 80
      protocol: TCP
---
apiVersion: runtime.wasmcloud.dev/v1alpha1
kind: WorkloadDeployment
metadata:
  name: hello-world
spec:
  replicas: 1
  template:
    spec:
      hostSelector:
        hostgroup: default
      kubernetes:
        service:
          name: hello-world
      components:
        - name: hello-world
          image: ghcr.io/wasmcloud/components/hello-world:0.1.0
      hostInterfaces:
        - namespace: wasi
          package: http
          interfaces:
            - incoming-handler
```

This manifest deploys a simple "Hello world!" component that uses the `wasi:http` interface, scheduled on the `default` hostgroup and reachable inside the cluster at `hello-world.default.svc.cluster.local`.

For a kind-optimized NodePort variant that answers `curl localhost` on port 80, see the [wasmCloud-hosted hello-world manifest](https://raw.githubusercontent.com/wasmCloud/wasmCloud/refs/heads/main/templates/http-hello-world/manifests/workloaddeployment.yaml) used by the [Installation](https://wasmcloud.com/docs/installation/#deploy-a-wasm-workload) guide.

> **Note**
>
> Learn more about `WorkloadDeployments` and other wasmCloud resources in the [Custom Resource Definitions (CRDs) section](https://wasmcloud.com/docs/kubernetes-operator/crds/). For the full Service-routing walk-through, see [Expose a Workload via Kubernetes Service](https://wasmcloud.com/docs/recipes/expose-workload-via-kubernetes-service/). To scale a `WorkloadDeployment` with HPA or KEDA, see [Autoscaling](https://wasmcloud.com/docs/kubernetes-operator/operator-manual/autoscaling/). For a workload that belongs on every host rather than on a share of them, see [`WorkloadDaemonSet`](https://wasmcloud.com/docs/kubernetes-operator/crds/#workloaddaemonset) (since 2.12.0).

Verify the component is reachable from inside the cluster:

shell

```shell
kubectl run curl --rm -it --image=curlimages/curl --restart=Never -- \
  curl -s http://hello-world.default.svc.cluster.local
```

text

```text
Hello from wasmCloud!
```

## Clean up

Delete the workload deployment and its Service:

shell

```shell
kubectl delete workloaddeployment hello-world
kubectl delete service hello-world
```

Uninstall wasmCloud:

shell

```shell
helm uninstall wasmcloud
```

Delete the local Kubernetes environment:

**Existing cluster**

No action needed — your cluster remains running.

**kind**

shell

```shell
kind delete cluster
```

**k3d**

shell

```shell
k3d cluster delete wasmcloud
```

**k3s**

shell

```shell
/usr/local/bin/k3s-uninstall.sh
```

## Next steps

- Explore the [`wash/examples` directory](https://github.com/wasmCloud/wasmCloud/tree/main/examples) for more advanced Wasm component examples.
- The [Custom Resource Definitions (CRDs)](https://wasmcloud.com/docs/kubernetes-operator/crds/) section explains the custom resources used by wasmCloud.
- The [API reference](https://wasmcloud.com/docs/kubernetes-operator/api-reference/) provides a complete API specification.
- For securing workloads in production, see [Workload Security](https://wasmcloud.com/docs/kubernetes-operator/workload-security/) for the sandbox model, `allowedHosts`, and NetworkPolicy.
- For edge or resource-constrained deployments, see [Lightweight Deployments](https://wasmcloud.com/docs/kubernetes-operator/operator-manual/lightweight-deployments/) for a lightweight alternative to kind.

Last updated on **Nov 8, 2026** by **Eric Gregory**
