close
Skip to content

cosmonic-labs/control-demos

Repository files navigation

Cosmonic Control Demos

This repository contains demos and examples for Cosmonic Control, an enterprise control plane for managing WebAssembly (Wasm) workloads in cloud native environments.

Cosmonic Control is built on wasmCloud, an Incubating project at the Cloud Native Computing Foundation (CNCF).

Install Cosmonic Control

In order to try these demos and examples, you will need a Kubernetes cluster and an installation of Cosmonic Control.

Install local Kubernetes environment

For local Kubernetes development, we recommend kind with host ports 80 and 443 forwarded to Traefik's NodePorts (the Cosmonic Control chart deploys Traefik as the edge proxy by default):

# kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
  - role: control-plane
    extraPortMappings:
      - containerPort: 30080
        hostPort: 80
        protocol: TCP
      - containerPort: 30443
        hostPort: 443
        protocol: TCP

The following command downloads the kind-config.yaml from this repository and creates a cluster from it:

curl -fLO https://raw.githubusercontent.com/cosmonic-labs/control-demos/refs/heads/main/kind-config.yaml && kind create cluster --config=kind-config.yaml && rm kind-config.yaml

For other local Kubernetes environments (k3d, k3s) and cloud clusters, see the Cosmonic Control documentation.

Install Cosmonic Control

Cosmonic Control is free to get started. Deploy with Helm:

helm install cosmonic-control oci://ghcr.io/cosmonic/cosmonic-control \
  --version 0.4.3 \
  --namespace cosmonic-system \
  --create-namespace

Deploy a HostGroup:

helm install hostgroup oci://ghcr.io/cosmonic/cosmonic-control-hostgroup \
  --version 0.4.3 \
  --namespace cosmonic-system

When installing a demo below, pass the demo's host to the cosmonic-control install via --set 'ingress.hosts[N].host=<demo>.localhost.cosmonic.sh' so Traefik routes external traffic for that host to Envoy. *.localhost.cosmonic.sh resolves to 127.0.0.1, so no /etc/hosts edits are required.

Contents

This repository includes...

Components

  • blobby: A blob storage ("blobby") fileserver backed by NATS, implemented as a Wasm component
  • blobstore-nats: A demonstration of blob storage operations that exposes the results via HTTP, implemented as a Wasm component
  • hello-world: "Hello world" Wasm component, built with Rust
  • hono-swagger-ui: Wasm component for documenting and testing RESTful APIs, built with TypeScript, Hono, and Swagger UI
  • http-server: Wasm component for an HTTP server with multiple endpoints, built with Go
  • petstore-mcp: An example of a TypeScript-based MCP server for the Swagger PetStore API, implemented as a Wasm component
  • welcome-tour: Wasm component introducing users to the core features of Cosmonic Control, built with TypeScript and Hono

Demos

  • integrations/argo-cd: Demo for using GitOps patterns with Argo CD, Cosmonic Control, and Wasm components

Configuration

  • kind-config.yaml: Configuration file for local Kubernetes clusters with kind

Makefile

This repository includes a Makefile enabling simplified usage of Helm commands from a local download of this repository using make:

  • make helm-render-<demo name>: Render chart templates locally and display the output for a given demo (Ex. make helm-render-blobby)
  • make helm-install-<demo name>: Deploy a given demo in a dedicated namespace with an HTTPTrigger. (Ex. make helm-install-blobby)
  • make helm-delete-<demo name>: Delete a given demo installed with make helm-install. (Ex. make helm-delete-blobby)

Further Reading

For more information on Cosmonic Control, visit cosmonic.com and the Cosmonic Control documentation.

For more on building components, see the Developer Guide in the Cosmonic Control documentation.

About

Demos and examples for Cosmonic Control, an enterprise control plane for managing WebAssembly (Wasm) workloads in cloud native environments.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors