Minified distributions of Kubernetes such as K3s, MicroK8s, Kind, and K3d are great for testing the shim; however, they are hard to configure to use custom build binaries of containerd, the shim and kubelet with debug symbols attached. For that reason, the best first step is to install vanilla K8s with kubeadm
. Here is a script that does it for you on Ubuntu:
If your node fails to start due to CNI issues, try reinstalling flannel:
/opt/kwasm/containerd-shim-spin-v2
for K3s with Kwasm configured)launch.json
to target itTroubleshooting
cargo clean -p containerd-shim-wasm && cargo build
Note: this section contains configuration on debugging both
ctr
andcontainerd
containerd
, checking out the release for the version you want to use
containerd/.vscode/tasks.json
file with tasks for building containerd and ctr, prerequisite to being able to debug them
containerd/.vscode/launch.json
for debugging containerd and ctr
containerd
Note: this section contains configuration on debugging both
ctr
andcontainerd
kubernetes
, checking out the release for the version you want to use. Be sure to specify a shallow clone β Kubernetes is hefty.
kubernetes/.vscode/launch.json
to configure debugging the kubelet process
kubelet
as the process name. Sometimes it takes a bit to restart if you refreshed the debugging sessionCreate a Spin app and push it to a registry
ctr
If you are just trying to test the shim's ability to execute an app, using ctr
to directly invoke containerd
is the quickest path
Utilize once or add the following to your ~/.bashrc
:
This expects the shim to be on path (such as /usr/bin/containerd-shim-spin-v2
). Update to point to your shim if needed:--runtime /opt/kwasm/containerd-shim-spin-v2
.
Execute: ctrpullrun ttl.sh/hellospinapp:48h hello
Curl: curl localhost:80
and see "Hello, Fermyon"
If not using the Spin Operator and SpinApp CRD, it can we hard to know how to template a deployment with the right runtime class. The following deployment can be used as reference:
Apply it to a running cluster configured with the shim and runtime class:
kubectl apply -f deployment.yaml