-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the network commuication between k3s's pod and container failed #52
Comments
Hi @defims |
@hydai |
I test with new version and everything works! # run
git clone https://github.com/second-state/wasmedge_wasi_socket.git
cd examples/http_server/
cargo build --target wasm32-wasi --release
sudo buildah build -t http_server . # need buildah installed and use Dockerfile below
sudo buildah push localhost/http_server:latest oci-archive:http_server.tar:localhost/http_server:latest
sudo ctr images import --all-platforms http_server.tar
sudo kubectl delete -f wasm.yml # need runwasi installed, wasmedge installed and containerd configured
sudo kubectl apply -f wasm.yml
sudo curl localhost:1234
# got
echo: Dockerfile: FROM scratch
ADD target/wasm32-wasi/release/http_server.wasm /
CMD ["/http_server.wasm"] wasm.yml: ---
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: wasmedge
handler: wasmedge
---
apiVersion: v1
kind: Pod
metadata:
labels:
app: http-server
name: http-server
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
runtimeClassName: wasmedge
containers:
- image: localhost/http_server:latest
imagePullPolicy: Never
name: crud
resources:
limits:
memory: 2048Mi
cpu: "2"
requests:
memory: 512Mi
cpu: ".5" /var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl is: version = 2
[plugins."io.containerd.internal.v1.opt"]
path = "/var/lib/rancher/k3s/agent/containerd"
[plugins."io.containerd.grpc.v1.cri"]
stream_server_address = "127.0.0.1"
stream_server_port = "10010"
enable_selinux = false
enable_unprivileged_ports = true
enable_unprivileged_icmp = true
sandbox_image = "rancher/mirrored-pause:3.6"
[plugins."io.containerd.grpc.v1.cri".containerd]
snapshotter = "overlayfs"
disable_snapshot_annotations = true
[plugins."io.containerd.grpc.v1.cri".cni]
bin_dir = "/var/lib/rancher/k3s/data/84e02c125ef7644128a11b4ba4ebf72630b91abe0433e60a19586a247542e75b/bin"
conf_dir = "/var/lib/rancher/k3s/agent/etc/cni/net.d"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.wasmedge]
runtime_type = "io.containerd.wasmedge.v1"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
SystemdCgroup = true |
I create a test repository defims/wasmedge-hyper-server to reproduct this problem:
environment
wasm pod failed
the img.tar and wasmedge-hyper-server.wasm:
img-and-wasmedge-hyper-server.zip
# unzip img-and-wasmedge-hyper-server.zip and import the image sudo ctr image import --all-platforms img.tar
/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl:
the wasm.yml file:
nginx works
and the nginx.yml file:
single pod with hostNetwork failed:
pod.yml file:
wasm container works:
I'm sure anything oher than the network works
The text was updated successfully, but these errors were encountered: