Skip to content

Commit 867bd7c

Browse files
Merge pull request #578 from kate-goldenring/samples-with-arch
Add separate sample Shim files for each architecture for Spin and Wastime shims
2 parents caf55d5 + ebf02ab commit 867bd7c

6 files changed

Lines changed: 125 additions & 2 deletions

File tree

config/samples/kustomization.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ resources:
44
- test_shim_slight.yaml
55
- test_shim_spin.yaml
66
- test_shim_wws.yaml
7+
- sample_shim_spin_x86_64.yaml
8+
- sample_shim_spin_aarch64.yaml
9+
- sample_shim_wasmtime_x86_64.yaml
10+
- sample_shim_wasmtime_aarch64.yaml
711
#+kubebuilder:scaffold:manifestskustomizesamples
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
apiVersion: runtime.spinkube.dev/v1alpha1
2+
kind: Shim
3+
metadata:
4+
name: spin-v2
5+
labels:
6+
app.kubernetes.io/name: spin-v2
7+
app.kubernetes.io/instance: spin-v2
8+
app.kubernetes.io/part-of: runtime-class-manager
9+
app.kubernetes.io/managed-by: kustomize
10+
app.kubernetes.io/created-by: runtime-class-manager
11+
spec:
12+
nodeSelector:
13+
spin: "true"
14+
15+
fetchStrategy:
16+
type: anonymousHttp
17+
anonHttp:
18+
location: "https://github.com/spinframework/containerd-shim-spin/releases/download/v0.22.0/containerd-shim-spin-v2-linux-aarch64.tar.gz"
19+
20+
# Each runtime can provide a set of containerd runtime options to be set in the containerd
21+
# configuration file.
22+
containerdRuntimeOptions:
23+
# The following option to pass cgroup driver information is available to runwasi based runtimes.
24+
# For runwasi, the default cgroup driver is cgroupfs. Failure to configure the correct cgroup
25+
# driver for runwasi shims may result in pod metrics failing to propagate accurately.
26+
SystemdCgroup: "true"
27+
28+
runtimeClass:
29+
# Note: this name is used by the Spin Operator project as its default:
30+
# https://github.com/spinframework/spin-operator/blob/main/config/samples/spin-shim-executor.yaml
31+
name: wasmtime-spin-v2
32+
handler: spin-v2
33+
34+
rolloutStrategy:
35+
type: recreate
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: runtime.spinkube.dev/v1alpha1
2+
kind: Shim
3+
metadata:
4+
name: spin-v2
5+
labels:
6+
app.kubernetes.io/name: spin-v2
7+
app.kubernetes.io/instance: spin-v2
8+
app.kubernetes.io/part-of: runtime-class-manager
9+
app.kubernetes.io/managed-by: kustomize
10+
app.kubernetes.io/created-by: runtime-class-manager
11+
spec:
12+
nodeSelector:
13+
spin: "true"
14+
15+
fetchStrategy:
16+
type: anonymousHttp
17+
anonHttp:
18+
location: "https://github.com/spinframework/containerd-shim-spin/releases/download/v0.22.0/containerd-shim-spin-v2-linux-x86_64.tar.gz"
19+
# Each runtime can provide a set of containerd runtime options to be set in the containerd
20+
# configuration file.
21+
containerdRuntimeOptions:
22+
# The following option to pass cgroup driver information is available to runwasi based runtimes.
23+
# For runwasi, the default cgroup driver is cgroupfs. Failure to configure the correct cgroup
24+
# driver for runwasi shims may result in pod metrics failing to propagate accurately.
25+
SystemdCgroup: "true"
26+
27+
runtimeClass:
28+
# Note: this name is used by the Spin Operator project as its default:
29+
# https://github.com/spinframework/spin-operator/blob/main/config/samples/spin-shim-executor.yaml
30+
name: wasmtime-spin-v2
31+
handler: spin-v2
32+
33+
rolloutStrategy:
34+
type: recreate
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: runtime.spinkube.dev/v1alpha1
2+
kind: Shim
3+
metadata:
4+
name: wasmtime-v1
5+
labels:
6+
app.kubernetes.io/name: wasmtime-v1
7+
app.kubernetes.io/instance: wasmtime-v1
8+
app.kubernetes.io/part-of: runtime-class-manager
9+
app.kubernetes.io/managed-by: kustomize
10+
app.kubernetes.io/created-by: runtime-class-manager
11+
spec:
12+
nodeSelector:
13+
wasmtime: "true"
14+
15+
fetchStrategy:
16+
type: anonymousHttp
17+
anonHttp:
18+
location: "https://github.com/containerd/runwasi/releases/download/containerd-shim-wasmtime%2Fv0.6.0/containerd-shim-wasmtime-aarch64-linux-musl.tar.gz"
19+
20+
runtimeClass:
21+
name: wasmtime-v1
22+
handler: wasmtime
23+
24+
rolloutStrategy:
25+
type: recreate
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: runtime.spinkube.dev/v1alpha1
2+
kind: Shim
3+
metadata:
4+
name: wasmtime-v1
5+
labels:
6+
app.kubernetes.io/name: wasmtime-v1
7+
app.kubernetes.io/instance: wasmtime-v1
8+
app.kubernetes.io/part-of: runtime-class-manager
9+
app.kubernetes.io/managed-by: kustomize
10+
app.kubernetes.io/created-by: runtime-class-manager
11+
spec:
12+
nodeSelector:
13+
wasmtime: "true"
14+
15+
fetchStrategy:
16+
type: anonymousHttp
17+
anonHttp:
18+
location: "https://github.com/containerd/runwasi/releases/download/containerd-shim-wasmtime%2Fv0.6.0/containerd-shim-wasmtime-x86_64-linux-musl.tar.gz"
19+
20+
runtimeClass:
21+
name: wasmtime-v1
22+
handler: wasmtime
23+
24+
rolloutStrategy:
25+
type: recreate

deploy/helm/templates/NOTES.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ Create one or more Wasm Shim custom resources. See the samples in https://github
66

77
> Note: Ensure that the `location` for the specified shim binary points to the correct architecture for your Node(s)
88

9-
For example, install the Spin shim:
9+
For example, install the Spin shim on nodes with x86_64 architecture:
1010

1111
```shell
12-
kubectl apply -f https://raw.githubusercontent.com/spinframework/runtime-class-manager/refs/heads/main/config/samples/test_shim_spin.yaml
12+
ARCH=x86_64 kubectl apply -f https://raw.githubusercontent.com/spinframework/runtime-class-manager/refs/heads/main/config/samples/sample_shim_spin_$ARCH.yaml
1313
```
1414

1515
Next, annotate one or more nodes with a label corresponding to the `nodeSelector` declared in the Shim, runtime-class-manager will install the shim as well as create the corresponding RuntimeClass:

0 commit comments

Comments
 (0)