安装linux
source /etc/os-release
sudo yum -y install yum-utils
ARCH=$(arch)
BRANCH="${BRANCH:-master}"
sudo -E yum-config-manager --add-repo "http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/${BRANCH}/CentOS_${VERSION_ID}/home:katacontainers:releases:${ARCH}:${BRANCH}.repo"
sudo -E yum -y install kata-runtime kata-proxy kata-shim
复制代码
注意:BRANCH对应的系统,有些版本不是那么全,笔者使用是master对应的没有centos7,报了404,所以使用的是“stable-1.10”。docker
http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/stable-1.10/CentOS_${VERSION_ID}/home:katacontainers:releases:${ARCH}:stable-1.10.repo
复制代码
验证kata是否安装未完成centos
sudo kata-runtime kata-check
System is capable of running Kata Containers
System can currently create Kata Containers
复制代码
docker安装安全
yum remove -y docker docker-common container-selinux docker-selinux docker-engine
yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum makecache fast
yum install docker-ce
systemctl start docker
复制代码
docker集成bash
配置文件/etc/systemd/system/docker.service.d/kata-containers.confmarkdown
[Service]
Type=simple
ExecStart=
ExecStart=/usr/bin/dockerd -D --default-runtime runc --add-runtime kata-runtime=/usr/bin/kata-runtime
复制代码
重启docker网络
systemctl daemon-reload
systemctl restart docker.service
docker info | grep runtime
复制代码
启动一个容器用来验证,此处笔者启动了两个,分别使用了不一样的方式性能
docker run -d --name centos-latest --runtime kata-runtime centos:latest sleep 3600
复制代码
Q: 使用的VmWare能够出现的报错 ui
一、ERROR: System is not capable of running Kata Containers
二、ERRO[0000] CPU property not found
复制代码
A:在虚拟机的设置中开启“Intel VT-x/EPT”centos7
Q: 报错以下“ERROR: could not insert 'vhost_vsock': Device or resource busy”
WARN[0000] modprobe insert module failed: modprobe: ERROR: could not insert 'vhost_vsock': Device or resource busy
arch=amd64 error="exit status 1" module=vhost_vsock name=kata-runtime pid=1932 source=runtime
ERRO[0000] kernel property not found arch=amd64 description="Host Support for Linux VM Sockets" name=vhost_vsock pid=1932 source=runtime type=module
System is capable of running Kata Containers
System can currently create Kata Containers
复制代码
A: 缘由是linux 检测到在 vmware 环境中运行时,会加载一些 vmware 的模块并使用 vsock 从而产生了冲突
sudo tee /etc/modprobe.d/blacklist-vmware.conf << EOF blacklist vmw_vsock_virtio_transport_common blacklist vmw_vsock_vmci_transport EOF
复制代码