From 53115c0de9d0c12467c2a5a53a9443ed2079c0e1 Mon Sep 17 00:00:00 2001 From: Eric Ernst Date: Wed, 30 Jan 2019 10:34:01 -0800 Subject: [PATCH] kata-deploy: add docker details to readme Add details for Docker configuration to the kata-deploy README Signed-off-by: Eric Ernst --- kata-deploy/README.md | 52 ++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 49 insertions(+), 3 deletions(-) diff --git a/kata-deploy/README.md b/kata-deploy/README.md index 9a181a0cb1..52df13e67b 100644 --- a/kata-deploy/README.md +++ b/kata-deploy/README.md @@ -2,7 +2,11 @@ - [kata-deploy](#kata-deploy) - * [Quick start](#quick-start-) + * [Docker quick start](#docker-quick-start-) + + [Install Kata and configure Docker](#install-kata-and-configure-docker) + + [Run a sample workload](#run-a-sample-workload-utilizing-kata-containers) + + [Remove Kata](#remove-kata) + * [Kubernetes quick start](#kubernetes-quick-start-) + [Install Kata on a running Kubernetes cluster](#install-kata-on-a-running-kubernetes-cluster) + [Run a sample workload](#run-a-sample-workload-) + [Remove Kata from the Kubernetes cluster](#remove-kata-from-the-kubernetes-cluster-) @@ -16,12 +20,54 @@ [kata-deploy](kata-deploy) provides a Dockerfile, which contains all of the binaries and artifacts required to run Kata Containers, as well as reference daemonsets, which can -be utilized to install Kata Containers on a running Kubernetes cluster. +be utilized to install Kata Containers for both Docker and on a running Kubernetes cluster. Note, installation through daemonsets successfully installs `kata-containers.io/kata-runtime` on a node only if it uses either containerd or CRI-O CRI-shims. -## Quick start: +## Docker quick start: + +The kata-deploy container image makes use of a script, `kata-deploy-docker`, for installation of +Kata artifacts and configuration of Docker to utilize the runtime. The following volumes are required to be mounted +to aid in this: +- /opt/kata: this is where all kata artifacts are installed on the system +- /var/run/dbus, /run/systemd: this is require for reloading the the Docker service +- /etc/docker: this is required for updating `daemon.json` in order to configure the kata runtimes in Docker + + +### Install Kata and configure Docker + +To install: + +``` +docker run -v /opt/kata:/opt/kata -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd -v /etc/docker:/etc/docker -it katadocker/kata-deploy kata-deploy-docker install +``` + +Once complete, `/etc/docker/daemon.json` is updated or created to include the Kata runtimes: kata-qemu and kata-fc, for utilizing +QEMU and Firecracker, respectively, for the VM isolation layer. + +### Run a sample workload utilizing Kata containers: + +Run a QEMU QEMU isolated Kata container: +``` +docker run --runtime=kata-qemu -itd alpine +``` + +Run a Firecracker isolated Kata container: +``` +docker run --runtime=kata-fc -itd alpine +``` + +### Remove Kata + +To uninstall: +``` +docker run -v /opt/kata:/opt/kata -v /var/run/dbus:/var/run/dbus -v /run/systemd:/run/systemd -v /etc/docker:/etc/docker -it katadocker/kata-deploy kata-deploy-docker remove +``` + +After completing, the original daemon.json, if it existed, is restored and all Kata artifacts from /opt/kata are removed. + +## Kubernetes quick start ### Install Kata on a running Kubernetes cluster