安裝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
複製代碼