runwasi
runwasi copied to clipboard
Cannot run WasmEdge Rust HTTP service
I'm trying to run my independent WasmEdge Rust HTTP example service (ghcr.io/rgl/wasmedge-http-rust-example:0.0.4) under k3s, but it just enters the CrashLoopBackOff state without any obvious clue.
I'm using:
- k3s v1.28.5+k3s1
- k3s containerd v1.7.11-k3s2
- containerd-shim-wasmedge-v1 0.3.0
- my k3s playground wasmedge branch https://github.com/rgl/k3s-vagrant/tree/wasmedge (please look at the latest commit to known how containerd-shim-wasmedge-v1 installed and configured)
Please note that it works fine when executed directly by the wasmedge binary as wasmedge target/wasm32-wasi/release/wasmedge-http-rust-example.wasm.
Can you please help me understand why this is happening?
Here's the kubectl describe pods output:
$ kubectl describe pods
Name: example-wasmedge-6864476bff-2cfb7
Namespace: default
Priority: 0
Runtime Class Name: wasmedge
Service Account: default
Node: a1/10.11.0.41
Start Time: Sat, 10 Feb 2024 13:24:52 +0000
Labels: app=example-wasmedge
pod-template-hash=6864476bff
Annotations: <none>
Status: Running
IP: 10.12.1.30
IPs:
IP: 10.12.1.30
Controlled By: ReplicaSet/example-wasmedge-6864476bff
Containers:
example:
Container ID: containerd://97c1316ac9cd57f3df72fadda254644d427d7130567acbd9a86e08d126b05562
Image: ghcr.io/rgl/wasmedge-http-rust-example:0.0.4
Image ID: ghcr.io/rgl/wasmedge-http-rust-example@sha256:13314434e6bf3b7fc322589b2374742e4dec543490d7f6e8fc0d3f686167f62f
Port: 8080/TCP
Host Port: 0/TCP
SeccompProfile: RuntimeDefault
State: Terminated
Reason: Error
Exit Code: 9
Started: Sat, 10 Feb 2024 13:24:55 +0000
Finished: Sat, 10 Feb 2024 13:24:57 +0000
Last State: Terminated
Reason: Error
Exit Code: 9
Started: Sat, 10 Feb 2024 13:24:53 +0000
Finished: Sat, 10 Feb 2024 13:24:54 +0000
Ready: False
Restart Count: 1
Limits:
cpu: 100m
memory: 32Mi
Requests:
cpu: 100m
memory: 32Mi
Environment: <none>
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-9rmcj (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
kube-api-access-9rmcj:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional: <nil>
DownwardAPI: true
QoS Class: Guaranteed
Node-Selectors: <none>
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 12s default-scheduler Successfully assigned default/example-wasmedge-6864476bff-2cfb7 to a1
Normal Pulled 9s (x2 over 11s) kubelet Container image "ghcr.io/rgl/wasmedge-http-rust-example:0.0.4" already present on machine
Normal Created 9s (x2 over 11s) kubelet Created container example
Normal Started 9s (x2 over 11s) kubelet Started container example
Warning BackOff 7s kubelet Back-off restarting failed container example in pod example-wasmedge-6864476bff-2cfb7_default(ed1feb8e-9cf7-4883-ad39-ce2e45e62512)
The best way to debug this at the moment is to see the logs in containerd.