Applications
Overview
Applications combine all of the previous concepts into a declarative, deployable unit. wasmCloud supports the imperative management of actors, providers, and links, which can be useful for experimentation or debuggging. However, these are generally considered low-level operations. wasmCloud supports complex distributed applications that can be dynamically adjusted at runtime, and managing a combination of actors, providers, links, and configuration one command at a time quickly becomes unwieldy.
Applications are the primary way to deploy workloads in a wasmCloud lattice. Applications are declarative, versioned, defined using a familiar syntax (YAML or JSON), and leverage an existing manifest standard. Define your app, hit "deploy", and wasmCloud will take care of the rest.
If you're familiar with Kubernetes or Nomad, you can think of a wasmCloud application as a Deployment or Job, respectively.
Application Manifests
wasmCloud application manifests are composed of two sections: metadata and a spec
. The metadata contains the application's name, version, and description. The spec
contains a list of the application's components (actors and capability providers), each of which can have traits
. Traits define configuration for the component, links, and how the component should be deployed. Examples of deployment traits include:
- run a single instance on a specific host
foo
- run
N
instances on each host in the lattice - 80% on hosts with label
foo
, 20% on hosts with labelbar
The following is an example of a simple wasmCloud application manifest:
apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: echo
annotations:
version: v1.2.3
description: My echo app
spec:
components:
- name: echo
type: actor
properties:
image: wasmcloud.azurecr.io/echo:0.3.8
traits:
- type: spreadscaler
properties:
replicas: 1
- type: linkdef
properties:
target: httpserver
values:
address: 0.0.0.0:8080
- name: httpserver
type: capability
properties:
contract: wasmcloud:httpserver
image: wasmcloud.azurecr.io/httpserver:0.19.1
traits:
- type: spreadscaler
properties:
replicas: 1
wasmCloud Application Deployment Manager (WADM)
To deploy and manage applications, wasmcloud uses WADM. WADM uses a control loop to react to events and reconcile requested state with desired state.
For an in-depth guide into how how wasmCloud manages applications, see the WADM documentation.