安装脚本
cd $GOPATH/src/github.com/kata-containers/tests/.ci
./install_kata.sh
root@ubuntu:/opt/gopath/src/github.com/kata-containers/proxy# docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 11b07c26a07d nginx "/docker-entrypoint.…" 28 minutes ago Up 28 minutes 80/tcp awesome_shannon Error: No such container: nginx root@ubuntu:/opt/gopath/src/github.com/kata-containers/proxy# docker exec -it awesome_shannon bash
root@ubuntu:~/kata# ps -elf | grep qemu 7 S root 65015 64960 1 80 0 - 801175 sys_po 20:03 ? 00:00:02 /usr/share/kata-containers/binary/qemu-system-aarch64 -name sandbox-11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d -uuid 47335785-f601-4e07-a32b-562ae33e6776 -machine virt,usb=off,accel=kvm,gic-version=host,nvdimm -cpu host,pmu=off -qmp unix:/run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/qmp.sock,server,nowait -m 2048M,slots=10,maxmem=257176M -device pcie-pci-bridge,bus=pcie.0,id=pcie-bridge-0,addr=2,romfile= -device virtio-serial-pci,disable-modern=false,id=serial0,romfile= -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path=/run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/console.sock,server,nowait -device nvdimm,id=nv0,memdev=mem0 -object memory-backend-file,id=mem0,mem-path=/usr/share/kata-containers/binary/kata-containers.img,size=184549376 -device virtio-scsi-pci,id=scsi0,disable-modern=false,romfile= -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0,romfile= -device virtserialport,chardev=charch0,id=channel0,name=agent.channel.0 -chardev socket,id=charch0,path=/run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/kata.sock,server,nowait -device virtio-9p-pci,disable-modern=false,fsdev=extra-9p-kataShared,mount_tag=kataShared,romfile= -fsdev local,id=extra-9p-kataShared,path=/run/kata-containers/shared/sandboxes/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/shared,security_model=none -netdev tap,id=network-0,vhost=on,vhostfds=3,fds=4 -device driver=virtio-net-pci,netdev=network-0,mac=02:42:ac:11:00:02,disable-modern=false,mq=on,vectors=4,romfile= -rtc base=utc,driftfix=slew,clock=host -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic --no-reboot -daemonize -kernel /usr/share/kata-containers/binary/vmlinuz-5.4.34-88 -append console=hvc0 console=hvc1 iommu.passthrough=0 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro ro rootfstype=ext4 debug systemd.show_status=true systemd.log_level=debug panic=1 nr_cpus=64 agent.use_vsock=false systemd.unit=kata-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket scsi_mod.scan=none agent.log=debug agent.log=debug -pidfile /run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/pid -D /run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/qemu.log -smp 1,cores=1,threads=1,sockets=64,maxcpus=64 0 S root 65093 42480 0 80 0 - 1097 pipe_w 20:05 pts/1 00:00:00 grep --color=auto qemu root@ubuntu:~/kata# ps -elf | grep kata 4 S root 64041 1 2 80 0 - 1392031 futex_ 20:00 ? 00:00:07 /usr/bin/dockerd -D --add-runtime kata-runtime=/usr/local/bin/kata-runtime --default-runtime=runc --storage-driver=overlay2 0 S root 64960 17232 0 80 0 - 27087 futex_ 20:03 ? 00:00:00 containerd-shim -namespace moby -workdir /var/lib/containerd/io.containerd.runtime.v1.linux/moby/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d -address /run/containerd/containerd.sock -containerd-binary /usr/bin/containerd -runtime-root /var/run/docker/runtime-kata-runtime 7 S root 65015 64960 1 80 0 - 801175 sys_po 20:03 ? 00:00:02 /usr/share/kata-containers/binary/qemu-system-aarch64 -name sandbox-11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d -uuid 47335785-f601-4e07-a32b-562ae33e6776 -machine virt,usb=off,accel=kvm,gic-version=host,nvdimm -cpu host,pmu=off -qmp unix:/run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/qmp.sock,server,nowait -m 2048M,slots=10,maxmem=257176M -device pcie-pci-bridge,bus=pcie.0,id=pcie-bridge-0,addr=2,romfile= -device virtio-serial-pci,disable-modern=false,id=serial0,romfile= -device virtconsole,chardev=charconsole0,id=console0 -chardev socket,id=charconsole0,path=/run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/console.sock,server,nowait -device nvdimm,id=nv0,memdev=mem0 -object memory-backend-file,id=mem0,mem-path=/usr/share/kata-containers/binary/kata-containers.img,size=184549376 -device virtio-scsi-pci,id=scsi0,disable-modern=false,romfile= -object rng-random,id=rng0,filename=/dev/urandom -device virtio-rng-pci,rng=rng0,romfile= -device virtserialport,chardev=charch0,id=channel0,name=agent.channel.0 -chardev socket,id=charch0,path=/run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/kata.sock,server,nowait -device virtio-9p-pci,disable-modern=false,fsdev=extra-9p-kataShared,mount_tag=kataShared,romfile= -fsdev local,id=extra-9p-kataShared,path=/run/kata-containers/shared/sandboxes/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/shared,security_model=none -netdev tap,id=network-0,vhost=on,vhostfds=3,fds=4 -device driver=virtio-net-pci,netdev=network-0,mac=02:42:ac:11:00:02,disable-modern=false,mq=on,vectors=4,romfile= -rtc base=utc,driftfix=slew,clock=host -global kvm-pit.lost_tick_policy=discard -vga none -no-user-config -nodefaults -nographic --no-reboot -daemonize -kernel /usr/share/kata-containers/binary/vmlinuz-5.4.34-88 -append console=hvc0 console=hvc1 iommu.passthrough=0 root=/dev/pmem0p1 rootflags=dax,data=ordered,errors=remount-ro ro rootfstype=ext4 debug systemd.show_status=true systemd.log_level=debug panic=1 nr_cpus=64 agent.use_vsock=false systemd.unit=kata-containers.target systemd.mask=systemd-networkd.service systemd.mask=systemd-networkd.socket scsi_mod.scan=none agent.log=debug agent.log=debug -pidfile /run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/pid -D /run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/qemu.log -smp 1,cores=1,threads=1,sockets=64,maxcpus=64 0 S root 65024 64960 0 80 0 - 287658 futex_ 20:03 ? 00:00:00 /usr/libexec/kata-containers/kata-proxy -listen-socket unix:///run/vc/sbs/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/proxy.sock -mux-socket /run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/kata.sock -sandbox 11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d -log debug -agent-logs-socket /run/vc/vm/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/console.sock 0 S root 65034 64960 0 80 0 - 308802 futex_ 20:03 pts/5 00:00:00 /usr/libexec/kata-containers/kata-shim -agent unix:///run/vc/sbs/11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d/proxy.sock -container 11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d -exec-id 11b07c26a07df622a942d31bebd458ee3f08a177beca41b222e76cb995db953d -terminal -log debug 0 S root 65095 42480 0 80 0 - 1097 pipe_w 20:05 pts/1 00:00:00 grep --color=auto kata root@ubuntu:~/kata#
操作系统
root@ubuntu:~# uname -a uname -a Linux ubuntu 5.0.0-23-generic #24~18.04.1-Ubuntu SMP Mon Jul 29 16:10:24 UTC 2019 aarch64 aarch64 aarch64 GNU/Linux root@ubuntu:~# cat /etc/os-release cat /etc/os-release NAME="Ubuntu" VERSION="18.04.3 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.3 LTS" VERSION_ID="18.04" HOME_URL="https://www.ubuntu.com/" SUPPORT_URL="https://help.ubuntu.com/" BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/" PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy" VERSION_CODENAME=bionic UBUNTU_CODENAME=bionic root@ubuntu:~#
go 版本
root@ubuntu:~/kata# go version go version go1.14.6 linux/arm64 root@ubuntu:~/kata#
kata-runtime -version
root@ubuntu:~/kata# kata-runtime -version kata-runtime : 1.12.0-alpha1 commit : 04c77eb20e9bd603cab5c711bcbe7c69db58b040-dirty OCI specs: 1.0.1-dev root@ubuntu:~/kata# /usr/local/bin/kata-runtime kata-runtime kata-runtime.bak root@ubuntu:~/kata# /usr/local/bin/kata-runtime kata-runtime kata-runtime.bak root@ubuntu:~/kata# /usr/local/bin/kata-runtime.bak -version kata-runtime : 1.12.0-alpha1 commit : 011c73f24a94118c74a1833fb2f27da0eaf3b576 OCI specs: 1.0.1-dev root@ubuntu:~/kata#
root@ubuntu:/opt/gopath/src/github.com/kata-containers/proxy# ls CODE_OF_CONDUCT.md CONTRIBUTING.md Gopkg.toml LICENSE proxy.go README.md signals_test.go VERSION CODEOWNERS Gopkg.lock kata-proxy Makefile proxy_test.go signals.go vendor root@ubuntu:/opt/gopath/src/github.com/kata-containers/proxy# cat VERSION 1.12.0-alpha1 root@ubuntu:/opt/gopath/src/github.com/kata-containers/proxy# cat ../shim/VERSION 1.12.0-alpha1 root@ubuntu:/opt/gopath/src/github.com/kata-containers/proxy# cat ../runtime/VERSION 1.12.0-alpha1 root@ubuntu:/opt/gopath/src/github.com/kata-containers/proxy#
qemu
root@ubuntu:/usr/share/kata-containers/binary# /usr/share/kata-containers/binary/qemu-system-aarch64 -version /usr/share/kata-containers/binary/qemu-system-aarch64 -version QEMU emulator version 5.1.0 (v5.1.0-dirty) Copyright (c) 2003-2020 Fabrice Bellard and the QEMU Project developers root@ubuntu:/usr/share/kata-containers/binary#
内核版本
root@ubuntu:~/kata# docker run --rm -it --runtime kata-runtime busybox uname -r 5.4.34 root@ubuntu:~/kata#
配置文件
path = "/usr/share/kata-containers/binary/qemu-system-aarch64" kernel = "/usr/share/kata-containers/binary/vmlinuz-5.4.34-88" image = "/usr/share/kata-containers/binary/kata-containers.img"
path = "/usr/libexec/kata-containers/kata-shim" path = "/usr/libexec/kata-containers/kata-proxy"
root@ubuntu:~/kata# cat /etc/systemd/system/docker.service.d/kata-containers.conf [Service] Environment="" Environment="" ExecStart= ExecStart=/usr/bin/dockerd -D --add-runtime kata-runtime=/usr/local/bin/kata-runtime --default-runtime=runc --storage-driver=overlay2 root@ubuntu:~/kata#
查看日志
journalctl -r -t kata-proxy journalctl -r -t kata-shim journalctl -r -t kata-shim