-
-
Save egernst/3622a780e11c7efe9c8b0897bb1651e6 to your computer and use it in GitHub Desktop.
v2-shim kata quick start
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo apt-get update | |
| ### INSTALL KATA | |
| #QEMU KATA: | |
| ARCH=$(arch) | |
| sudo sh -c "echo 'deb http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/ /' > /etc/apt/sources.list.d/kata-containers.list" | |
| curl -sL http://download.opensuse.org/repositories/home:/katacontainers:/releases:/${ARCH}:/master/xUbuntu_$(lsb_release -rs)/Release.key | sudo apt-key add - | |
| sudo -E apt-get update | |
| sudo -E apt-get -y install kata-runtime kata-proxy kata-shim | |
| #FC Kata: | |
| wget https://github.com/kata-containers/runtime/releases/download/1.5.0-rc2/kata-fc-static-1.5.0-rc2-x86_64.tar.gz | |
| sudo tar -xvf kata-fc-static-1.5.0-rc2-x86_64.tar.gz -C / | |
| sudo modprobe vhost_vsock | |
| ### INSTALL + CONFIGURE DOCKER: | |
| sudo -E apt-get -y install apt-transport-https ca-certificates software-properties-common | |
| curl -sL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
| arch=$(dpkg --print-architecture) | |
| sudo -E add-apt-repository "deb [arch=${arch}] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
| sudo -E apt-get update | |
| sudo -E apt-get -y install docker-ce=18.06.1~ce~3-0~ubuntu | |
| sudo apt-mark hold docker-ce | |
| cat <<EOF | sudo tee /etc/docker/daemon.json | |
| { | |
| "runtimes": { | |
| "kata-qemu": { | |
| "path": "/usr/bin/kata-runtime" | |
| }, | |
| "kata-fc": { | |
| "path": "/opt/kata/bin/kata-runtime" | |
| } | |
| }, | |
| "storage-driver": "devicemapper" | |
| } | |
| EOF | |
| sudo systemctl daemon-reload | |
| sudo systemctl restart docker | |
| #### INSTALL CONTAINERD: | |
| export VERSION=1.2.1 | |
| wget https://storage.googleapis.com/cri-containerd-release/cri-containerd-${VERSION}.linux-amd64.tar.gz | |
| sudo tar --no-overwrite-dir -C / -xzf cri-containerd-${VERSION}.linux-amd64.tar.gz | |
| sudo systemctl start containerd | |
| rm cri-containerd-${VERSION}.linux-amd64.tar.gz | |
| ### Configure containerd: | |
| curl -O https://storage.googleapis.com/golang/go1.11.2.linux-amd64.tar.gz | |
| tar -xvf go1.11.2.linux-amd64.tar.gz | |
| sudo mv go /usr/local | |
| cat <<EOF | sudo tee -a $HOME/.profile | |
| export GOPATH=$HOME/go | |
| export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin | |
| EOF | |
| source ~/.profile | |
| sudo apt-get install gcc make | |
| ### get CNI: | |
| go get github.com/containernetworking/plugins | |
| pushd $GOPATH/src/github.com/containernetworking/plugins | |
| ./build_linux.sh | |
| mkdir /opt/cni | |
| cp -r bin /opt/cni/ | |
| popd | |
| ### cri-tools: | |
| go get github.com/kubernetes-incubator/cri-tools | |
| pushd $GOPATH/src/github.com/kubernetes-incubator/cri-tools | |
| make | |
| sudo -E make install | |
| popd | |
| #### CONFIGURE CONTAINERD: | |
| sudo cp /etc/containerd/config.toml /etc/containerd/config.toml.backup | |
| sudo mkdir /etc/containerd | |
| cat <<EOF | sudo tee /etc/containerd/config.toml | |
| [plugins.cri.containerd] | |
| no_pivot = false | |
| [plugins.cri.containerd.runtimes] | |
| [plugins.cri.containerd.runtimes.runc] | |
| runtime_type = "io.containerd.runc.v1" | |
| [plugins.cri.containerd.runtimes.runc.options] | |
| NoPivotRoot = false | |
| NoNewKeyring = false | |
| ShimCgroup = "" | |
| IoUid = 0 | |
| IoGid = 0 | |
| BinaryName = "runc" | |
| Root = "" | |
| CriuPath = "" | |
| SystemdCgroup = false | |
| [plugins.cri.containerd.runtimes.kata-qemu] | |
| runtime_type = "io.containerd.kata-qemu.v2" | |
| [plugins.cri.containerd.runtimes.kata-qemu.options] | |
| NoPivotRoot = false | |
| NoNewKeyring = false | |
| ShimCgroup = "" | |
| IoUid = 0 | |
| IoGid = 0 | |
| BinaryName = "/usr/bin/containerd-shim-kata-v2" | |
| Root = "" | |
| CriuPath = "" | |
| SystemdCgroup = false | |
| [plugins.cri.containerd.runtimes.kata-fc] | |
| runtime_type = "io.containerd.kata-fc.v2" | |
| [plugins.cri.containerd.runtimes.kata-fc.options] | |
| NoPivotRoot = false | |
| NoNewKeyring = false | |
| ShimCgroup = "" | |
| IoUid = 0 | |
| IoGid = 0 | |
| BinaryName = "/opt/kata/bin/containerd-shim-kata-v2" | |
| Root = "" | |
| CriuPath = "" | |
| SystemdCgroup = false | |
| [plugins.cri.containerd.runtimes.kata-fc-cli] | |
| runtime_type = "io.containerd.runc.v1" | |
| [plugins.cri.containerd.runtimes.kata-fc-cli.options] | |
| NoPivotRoot = false | |
| NoNewKeyring = false | |
| ShimCgroup = "" | |
| IoUid = 0 | |
| IoGid = 0 | |
| BinaryName = "/opt/kata/bin/kata-runtime" | |
| Root = "" | |
| CriuPath = "" | |
| SystemdCgroup = false | |
| [plugins.cri.containerd.runtimes.kata-qemu-cli] | |
| runtime_type = "io.containerd.runc.v1" | |
| [plugins.cri.containerd.runtimes.kata-qemu-cli.options] | |
| NoPivotRoot = false | |
| NoNewKeyring = false | |
| ShimCgroup = "" | |
| IoUid = 0 | |
| IoGid = 0 | |
| BinaryName = "/usr/bin/kata-runtime" | |
| Root = "" | |
| CriuPath = "" | |
| SystemdCgroup = false | |
| EOF | |
| #### above is not working... | |
| ### Setup bridge: | |
| sudo mkdir -p /etc/cni/net.d | |
| /etc/cni/net.d/10-mynet.conf: | |
| { | |
| "cniVersion": "0.2.0", | |
| "name": "mynet", | |
| "type": "bridge", | |
| "bridge": "cni0", | |
| "isGateway": true, | |
| "ipMasq": true, | |
| "ipam": { | |
| "type": "host-local", | |
| "subnet": "172.19.0.0/24", | |
| "routes": [ | |
| { "dst": "0.0.0.0/0" } | |
| ] | |
| } | |
| } | |
| sudo ctr run --runtime io.containerd.runc.v1 -t --rm docker.io/library/busybox:latest hello sh |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tests: