Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# runtime-class-manager
# Runtime Class Manager

[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/spinframework/runtime-class-manager/badge)](https://securityscorecards.dev/viewer/?uri=github.com/spinframework/runtime-class-manager)

The runtime-class-manager is the spiritual successor to the kwasm-operator. kwasm has been developed as an experimental, simple way to install Wasm runtimes. This experiment has been relatively successful, as more and more users utilized it to fiddle around with Wasm on Kubernetes. However, the kwasm-operator has some limitations that make it difficult to use in production. The runtime-class-manager is an attempt to address these limitations to make it a reliable and secure way to deploy arbitrary containerd shims.
## Overview

The implementation of runtime-class-manager follows [this](https://hackmd.io/TwC8Fc8wTCKdoWlgNOqTgA) community proposal.
Runtime Class Manager is Kubernetes Operator that assists with [Wasm](https://webassembly.org/) runtime installation and configuration on a Kubernetes cluster. It does so by handling creation and installation of [RuntimeClasses](./docs/runtimeclass.md) and [containerd](https://containerd.io/) shim binaries for each [Shim](./docs/shim.md) custom resource created on a cluster.

The name should be treated as a working title and is hopefully subject to change.
## Background

The Runtime Class Manager is the spiritual successor to the kwasm-operator. kwasm has been developed as an experimental, simple way to install Wasm runtimes. This experiment has been relatively successful, as more and more users utilized it to fiddle around with Wasm on Kubernetes. However, the kwasm-operator has some limitations that make it difficult to use in production. The Runtime Class Manager is an attempt to address these limitations to make it a reliable and secure way to deploy arbitrary containerd shims.

The implementation of Runtime Class Manager follows [this](https://hackmd.io/TwC8Fc8wTCKdoWlgNOqTgA) community proposal.

## Roadmap

For the 1.0 release of runtime-class-manager, we consider three milestones:
For the 1.0 release of Runtime Class Manager, we consider three milestones:

- **M1: [RCM MVP for Spinkube](https://github.com/spinframework/runtime-class-manager/milestone/1)**
This milestone is about getting RCM to a state where Spinkube can rely on RCM and use it as a dependency instead of Kwasm. This means, that the focus is on managing lifecycle of [containerd-shim-spin](https://github.com/spinframework/containerd-shim-spin) on nodes.
This milestone is about getting RCM to a state where Spinkube can rely on RCM and use it as a dependency instead of Kwasm. This means, that the focus is on managing lifecycle of [containerd-shim-spin](https://github.com/spinframework/containerd-shim-spin) on nodes. _This is now complete._
- **M2: [Kwasm Feature Parity](https://github.com/spinframework/runtime-class-manager/milestone/2)**
All shims that kwasm can install, should be installable via rcm. Automated tests are in place to ensure installation of RCM and shims that are supported by Kwasm.
- **M3: [Full implementation of the initial spec](https://github.com/spinframework/runtime-class-manager/milestone/3)**
Expand All @@ -23,7 +27,7 @@ Stable spec of the Shim CRD based on the [initial proposal](https://hackmd.io/Tw
- alternative shim installation via Daemonset instead of Jobs
- treating node-installer as a daemon process, to enable better conflict resolution

## Usage
## Development

### To Deploy on the cluster

Expand Down
14 changes: 7 additions & 7 deletions docs/runtimeclass.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## RuntimeClass

The Operator is designed to create a RuntimeClass for each shim. `spec.runtimeClass` configures the RuntimeClass that will be created.
Runtime Class Manager is in charge of creating a [RuntimeClass](https://kubernetes.io/docs/concepts/containers/runtime-class) for each [Shim](./shim.md) resource created on the cluster.

The `spec.runtimeClass` section of the Shim resource configures the RuntimeClass that will be created.

* `spec.runtimeClass.name`: Name of the Kubernetes RuntimeClass
- This name should match what is expected by shim-specific operator(s) on the cluster
- For example, the [Spin Operator](https://github.com/spinframework/spin-operator) utilizes a [SpinAppExecutor](https://www.spinkube.dev/docs/reference/spin-app-executor/) resource
to run Spin Apps; the default RuntimeClass name it expects can be seen [here](https://github.com/spinframework/spin-operator/blob/main/config/samples/spin-shim-executor.yaml)
Comment thread
vdice marked this conversation as resolved.
* `spec.runtimeClass.handler`: Name of the shim as it is referenced in the containerd config

**Discuss later:**

- At this point in time `spec.RuntimeClass` is a mendatory field
- pro: it will make sure a RuntimeClass exist for the shim thats going to be installed
- con: possible that runtimeclass is created by other means
- Should `spec.RuntimeClass.handler` be optional? Is it even required?
> Note: The RuntimeClass's `scheduling.nodeSelector` will be set to the same key/value pair as configured in the [Shim](./shim.md) resource. This ensures that applications targeting the RuntimeClass are only scheduled on nodes where the corresponding runtime shim has been installed.
19 changes: 19 additions & 0 deletions docs/shim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## Shim

Runtime Class Manager operates on `Shim` custom resources based on the [Shim CRD](../config/crd/bases/runtime.spinkube.dev_shims.yaml).

Whenever a Shim is created, updated or deleted, Runtime-Class-Manager will perform the necessary actions, e.g. creating, updating or removing the associated [RuntimeClass](./runtimeclass.md), installing or removing shim binaries on any [Nodes](https://kubernetes.io/docs/concepts/architecture/nodes/) labeled with a corresponding to its `nodeSelector`, etc.

### Configuration

For full, detailed configuration options, see the [Shim CRD](../config/crd/bases/runtime.spinkube.dev_shims.yaml). Here we point out a few pertinent items.

* `spec.nodeSelector`: The label key and value applied to Nodes where this particular shim should be installed
* `spec.fetchStrategy`: The strategy for fetching the shim binary
* `spec.fetchStrategy.type`: `anonymousHttp` is the only option currently supported.
* `spec.fetchStrategy.anonHttp.location`: The URL where the shim binary can be downloaded
* `spec.containerdRuntimeOptions`: Options specific to the shim that should be added to the containerd configuration

### Operation

You may observe the "install" and "uninstall" [Jobs](https://kubernetes.io/docs/concepts/workloads/controllers/job/) responsible for downloading and installing (or uninstalling) the shim binary. These will run on every Node that matches the Shim's `nodeSelector`.
10 changes: 0 additions & 10 deletions docs/shim_delete.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/supported_distros.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ We support the same Kubernetes distributions as Kwasm.
|---------------------|------|------------------|----------------|----------------|--------------------------|-----------------|----------------------|----------|--------------------|
| WasmEdge | ✅ | ✅ | (✅) | (✅) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Wasmtime | ✅ | ✅ | (✅) | (✅) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Fermion Spin | ✅ | ✅ | (✅) | (✅) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Spin | ✅ | ✅ | (✅) | (✅) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Wasm Workers Server | ✅ | ✅ | (✅) | (✅) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Lunatic | ✅ | ✅ | (✅) | (✅) | ✅ | ✅ | ✅ | ✅ | ✅ |
| Slight | ✅ | ✅ | (✅) | (✅) | ✅ | ✅ | ✅ | ✅ | ✅ |
Expand Down
Loading