runtime-rs: ctr run --runtime=io.containerd.kata-dragonball.v2 load TOML config failed
sidneychang opened this issue · comments
Issue Description:
I'm trying to run containers on my machine using Kata Containers, and I've installed it using the kata-deploy script with the latest images in k3s. After applying each Kata Containers runtimeClass, I attempted to use ctr run to start a pod.
Steps to Reproduce:
Install Kata Containers using the kata-deploy script.
Apply Kata Containers runtimeClass using
kubectl apply -f https://raw.githubusercontent.com/kata-containers/kata-containers/main/tools/packaging/kata-deploy/runtimeclasses/kata-runtimeClasses.yaml
Try to use ctr run to start a pod.
Problem Description:
When attempting to start a pod using ctr run, I encountered the following error:
ctr run --runtime=io.containerd.kata-dragonball.v2 docker.io/library/nginx:latest nginx-sandbox
ctr: failed to create shim task: Others("failed to handle message try init runtime instance\n\nCaused by:\n 0: load config\n 1: load TOML config failed (tried [\"/etc/kata-containers/runtime-rs/configuration.toml\", \"/usr/share/defaults/kata-containers/runtime-rs/configuration.toml\", \"/opt/kata/share/defaults/kata-containers/runtime-rs/configuration.toml\"])\n 2: guest kernel image file /usr/share/kata-containers/vmlinux-dragonball-experimental.container is invalid: No such file or directory (os error 2)"): unknown
Attempted Solutions:
I checked the /opt/kata/share/defaults/kata-containers/runtime-rs/configuration.toml file and found that it is actually a symbolic link pointing to configuration-dragonball.toml. So, I manually copied the configuration-dragonball.toml file to /etc/kata-containers/runtime-rs/configuration.toml, which resolved the problem.
root@localhost ~]# cp /opt/kata/share/defaults/kata-containers/runtime-rs/configuration-dragonball.toml /etc/kata-containers/runtime-rs/configuration.toml
[root@localhost ~]# ctr container rm nginx-sandbox
[root@localhost ~]# ctr run --runtime=io.containerd.kata-dragonball.v2 docker.io/library/nginx:latest nginx-sandbox
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/05/13 04:45:42 [notice] 1#1: using the "epoll" event method
2024/05/13 04:45:42 [notice] 1#1: nginx/1.25.5
2024/05/13 04:45:42 [notice] 1#1: built by gcc 12.2.0 (Debian 12.2.0-14)
2024/05/13 04:45:42 [notice] 1#1: OS: Linux 5.10.25
Environment:
Operating System:
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"
Kata Containers Version:
kata-runtime : 3.4.0
commit : 7e12d588c0cf45258f3c369d696b6b449aaf3fe0
OCI specs: 1.1.0-rc.1
Container Runtime:
containerd containerd.io 1.6.31 e377cd56a71523140ca6ae87e30244719194a521
I found that in https://github.com/kata-containers/kata-containers/blob/main/src/libs/kata-types/src/config/mod.rs#L212 will get one exist path in the pathlist as config path. I dont know its problems in my machine or in the kata-deploy script?
Hi @sidneychang
Actually your issue was that kata will search the config files from /etc, /usr and /opt, but it first find the configuration from /usr/share/defaults/kata-containers/runtime-rs/configuration.toml, but it seemed that this config specified the kernel image as /usr/share/kata-containers/vmlinux-dragonball-experimental.container , which didn't exist. So can double you check who deployed the configuration files in /usr/share/kata-containers/ ?
@lifupan i used to build runtime-rs manually, maybe that's the reason. thanks a lot!