Last active
November 1, 2022 19:47
-
-
Save 0xE282B0/e8856dee091fb234b3768ebe4b5a12e8 to your computer and use it in GitHub Desktop.
A short code listing to run WasmEdge container on KinD Kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kind create cluster | |
# Takes some time ... | |
# Install KWasm operator | |
helm repo add kwasm http://kwasm.sh/kwasm-operator/ | |
helm install -n kwasm --create-namespace kwasm-operator kwasm/kwasm-operator | |
# Provision Nodes | |
kubectl annotate node --all kwasm.sh/kwasm-node=true | |
# Add runtime class for crun | |
echo 'apiVersion: node.k8s.io/v1 | |
kind: RuntimeClass | |
metadata: | |
name: crun | |
handler: crun' | kubectl apply -f - | |
# Run wasm image | |
echo 'apiVersion: v1 | |
kind: Pod | |
metadata: | |
annotations: | |
module.wasm.image/variant: compat-smart | |
labels: | |
run: wasi-demo | |
name: wasi-demo | |
spec: | |
containers: | |
- args: | |
- /wasi_example_main.wasm | |
- "50000000" | |
image: wasmedge/example-wasi:latest | |
name: wasi-demo | |
runtimeClassName: crun | |
restartPolicy: Never' | kubectl apply -f - | |
# Output logs | |
kubectl logs wasi-demo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment