- Update CC=gcc setting for Fedora s390x - osbuilder: Streamline s390x CMake & musl handling - runtime: remove the call to storeSandbox at the end of createSandboxFromConfig - virtcontainers: Add support for Secure Execution - agent: Conform to the latest nix version (0.21.0) - docs: Update the stable branch strategy to what was proposed in our ML - runtime: add more traces for network - tools/packaging: clone meson and dependencies before building QEMU - runtime: remove covertool from cli test - factory: Use lazy unmount - docs: Fix Release Process document - Add sandbox and container ID to trace spans - agent: Fix fd leak caused by netlink - metrics: Add virtiofsd exporter - versions: Update kubernetes to 1.21.1 - tracing: Add basic VSOCK tracing - agent: Upgrade tokio-vsock to fix fd leak of vsock socket - runtime: fix some comments and logs - runtime: Add support for PEF - cleanup TODOs in runtime - tracing: Make runtime span attributes more consistent - virtiofsd: refactor qemu.go to use code in virtiofsd.go - runtime: remove unused doc.go - cgroup: fix the issue of set mem.limit and mem.swap - agent: re-enable the standard SIGPIPE behavior - virtiofsd: Fix file descriptors leak and return correct PID - runtime: and cgroup and SandboxCgroupOnly check for check sub-command - kernel: add ppc64le fragments - docs: Use --ignore-preflight-errors=all flag - agent: fix start container failed when dropping all capabilities - agent: Remove unnecessary underscore(_) variables - docs: Add instructions for getting QEMU source - qemu: align before memory hotplug on arm64 - workflows: release kata 2.x snap through the stable channel - Sandbox bindmount cleanup - docs: Update add customer agent command - agent: Stop relying in the unmaintained prctl crate - how-to-use-virtio-mem-with-kata.md: Update doc to make it clear - docs: Add document for memory hotplug on arm64 - github: Run require porting labels only at main - kernel: add confidential guest build option - rustjail: separated the propagation flags from mount flags - runtime: improve sandbox cleanup logic - docs: add note for connecting debug console for old versions - image_build: align image size to 128M for arm64 - agent: avoid reaping the exit signal of execute_hook in the reaper - agent: move the dependency tempfile to the dev-dependencies section - docs: Document test repository changes when creating a stable branch - docs: Remove horizontal ruler markers that disable spell checks - docs/Developer-Guide: Add instructions to apply QEMU patches - runtime: make dialing timeout configurable - Get sandbox metrics cli - Support TDx - packaging/kata-cleanup: add k3s containerd volume - osbuilder: Upgrade alpine version to 3.13.5 - Monitor cleanup - Open CONFIG_VIRTIO_MEM in x86_64 Linux kernel - agent: delete code which is no longer used - cli: delete tracing code for kata-runtime binary - docs: add per-Pod Kata configurations for `enable_pprof` - Fix issue of virtio-mem - Set fixed NOFILE limit value for kata-agent - ci/install_yq.sh: install_yq: Check version before return - runtime: use s.ctx instead ctx for checking cancellation - runtime: fix some commentsa1247bc0agent: Conform to the latest nix version (0.21.0)3130e66druntime: remove storeSandbox at the end of createSandboxFromConfig7593ebf9runtime: Use CC=gcc on Fedora s390xa484d6dbosbuilder: Streamline s390x CMake & musl handlingda2d9ab8osbuilder: Remove CC=gcc for Fedora s390xc0c05c73virtcontainers: Add support for Secure Execution78f21710virtcontainers/s390x: Put consts into one block784025bbruntime: add more traces for network9ec9bbbatools/packaging: clone meson and dependencies before building QEMU9158ec68docs: Fix Release Process document9e3349c1agent: Fix fd leak caused by netlink3d0e0b27tracing: Add network model to span8ca02072tracing: Add sandbox and container ID to trace spansa9a0eccftracing: Add basic VSOCK tracing2234b730metrics: Add virtiofsd exporter9bf781d7agent: Upgrade tokio-vsock to fix fd leak of vsock socketb68334a1runtime: fix some comments and logs1f5b229bruntime: remove FIXME in SandboxState about CgroupPathfee0004aruntime: remove TODO about hot add memory in qemu.go2e29ef9cruntime: remove TODO comment from StatusContainer72cd8f5evirtiofsd: refactor qemu.go to use code in virtiofsd.go0b22c48druntime: remove unused doc.go30f4834ccgroup: fix the issue of set mem.limit and mem.swap0ae364c8agent: re-enable the standard SIGPIPE behavior05a46fedtracing: Make runtime span attributes more consistent727bfc45runtime: and cgroup and SandboxCgroupOnly check for check sub-commandb25ad1abtracing: Make trace-forwarder async45f02227tracing: Add trace points773deca2virtiofsd: Fix file descriptors leak and return correct PID37a426b4runtime: Add support for PEFfe670c5ddocs: Use --ignore-preflight-errors=all flag5b5047bddocs: Add instructions for getting QEMU source3e4ebe10agent: fix start container failed when dropping all capabilities9a43d76dworkflows: release kata 2.x snap through the stable channel7f1030d3sandbox-bindmount: persist mount information089a7484sandbox: Cleanup if failure to setup sandbox-bindmount occursf65acc20docs: Update add customer agent command20a382c1agent: Remove unnecessary underscore(_) variables4b88532cdocs: Don't use Docker as an example of a container manager4142e424docs: Don't mention 1.x components as part of the stable branch strategya0af2bd7docs: Use stable-2.x / 2.x.y as example in the branch strategy documenta5e1f66adocs: Maintain only one stable branch per major release419773b8docs: Emphasize behaviour changes may be a reason for a major bump54a75008docs: Refer to `main` branch in the stable branch strategy document7dde0b5dkernel: add ppc64le fragments84906181kernel: skip fragments for ppc64le9676b86bkernel: move CONFIG_RANDOMIZE_BASEbd0cde40factory: Use lazy unmountf52468beagent/agent-ctl: Replace prctl crate by the capctl oned289b1d6agent-ctl: Perform a `cargo update`bc36b7b4qemu: align before memory hotplug on arm648aefc793agent: Perform a `cargo update`785be0bbhow-to-use-virtio-mem-with-kata.md: Update doc to make it clearf8a16c17kernel: add confidential guest build optiona65f11eadocs: Add document for memory hotplug on arm641b607056runtime: remove covertool from cli testfc42dc07github: Run require porting labels only at maindbef2b29versions: Update kubernetes to 1.21.135151f17runtime: sandbox delete should succeed after verifying sandbox statee5fe572frustjail: separated the propagation flags from mount flagsffbb4d9bdocs: add note for connecting debug console for old versionsa5bb383cagent: avoid reaping the exit signal of execute_hook in the reaperce7a5ba2agent: move the dependency tempfile to the dev-dependencies sectione24e9462docs/Developer-Guide: Add instructions to apply QEMU patches850cf8cddocs: Document test repository changes when creating a stable branch8068a469kata-runtime: add `metrics` command37873061kata-monitor: export get stats for sandbox01b56d6cruntime: make dialing timeout configurablee8038718osbuilder: Upgrade alpine version to 3.13.53caed6f8runtime: shim: dedup client, socket addr code4bc006c8runtime: Short the shim-monitor path5fdf617edocs: Fix spell-check errors found after new text is discovered42425456docs: Remove horizontal ruler markers that disable spell checks3883e4e2kernel: configs: Open CONFIG_VIRTIO_MEM in x86_64 Linux kernel4f61f4b4virtcontainers: Support TDX0affe886virtcontainers: define confidential guest framework539afba0runtime: define config options to enable confidential computing79831fafruntime: use s.ctx instead ctx for checking cancellationf6d5fbf9runtime: fix some comments9381e5f3packaging/kata-cleanup: add k3s containerd volume7f7c3fc8qemu.go: qemu: resizeMemory: Fix virtio-mem resize overflow issuec9053ea3qemu.go: qemu: setupVirtioMem: let sizeMB be multiple of 2Miba188577eagent: Set fixed NOFILE limit value for kata-agent88cf3db6runtime: implement CPUFlags function2b0d5b25image_build: align image size to 128M for arm64d601ae34agent: delete not used comments6038da19agent: delete rustjail/src/configs directory84ee8aa8agent: delete not used functionsd8896157ci/install_yq.sh: install_yq: Check version before return95e54e3fdocs: add per-Pod Kata configurations for enable_pprof13c23feccli: delete tracing code for kata-runtime binary Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
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.
Note, installation through DaemonSets successfully installs katacontainers.io/kata-runtime on
a node only if it uses either containerd or CRI-O CRI-shims.
Kubernetes quick start
Install Kata on a running Kubernetes cluster
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy
$ kubectl apply -f kata-rbac/base/kata-rbac.yaml
$ kubectl apply -f kata-deploy/base/kata-deploy.yaml
or on a k3s cluster:
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy
$ kubectl apply -k kata-deploy/overlays/k3s
Run a sample workload
Workloads specify the runtime they'd like to utilize by setting the appropriate runtimeClass object within
the Pod specification. The runtimeClass examples provided define a node selector to match node label katacontainers.io/kata-runtime:"true",
which will ensure the workload is only scheduled on a node that has Kata Containers installed
runtimeClass is a built-in type in Kubernetes. To apply each Kata Containers runtimeClass:
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/runtimeclasses
$ kubectl apply -f kata-runtimeClasses.yaml
The following YAML snippet shows how to specify a workload should use Kata with Cloud Hypervisor:
spec:
template:
spec:
runtimeClassName: kata-clh
The following YAML snippet shows how to specify a workload should use Kata with Firecracker:
spec:
template:
spec:
runtimeClassName: kata-fc
The following YAML snippet shows how to specify a workload should use Kata with QEMU:
spec:
template:
spec:
runtimeClassName: kata-qemu
To run an example with kata-qemu:
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/examples
$ kubectl apply -f test-deploy-kata-qemu.yaml
To run an example with kata-fc:
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/examples
$ kubectl apply -f test-deploy-kata-fc.yaml
The following removes the test pods:
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy/examples
$ kubectl delete -f test-deploy-kata-qemu.yaml
$ kubectl delete -f test-deploy-kata-fc.yaml
Remove Kata from the Kubernetes cluster
$ cd $GOPATH/src/github.com/kata-containers/kata-containers/tools/packaging/kata-deploy
$ kubectl delete -f kata-deploy/base/kata-deploy.yaml
$ kubectl apply -f kata-cleanup/base/kata-cleanup.yaml
$ kubectl delete -f kata-cleanup/base/kata-cleanup.yaml
$ kubectl delete -f kata-rbac/base/kata-rbac.yaml
$ kubectl delete -f runtimeclasses/kata-runtimeClasses.yaml
kata-deploy details
Dockerfile
The Dockerfile used to create the container image deployed in the DaemonSet is provided here. This image contains all the necessary artifacts for running Kata Containers, all of which are pulled from the Kata Containers release page.
Host artifacts:
cloud-hypervisor,firecracker,qemu-system-x86_64, and supporting binariescontainerd-shim-kata-v2kata-collect-data.shkata-runtime
Virtual Machine artifacts:
kata-containers.imgandkata-containers-initrd.img: pulled from Kata GitHub releases pagevmlinuz.containerandvmlinuz-virtiofs.container: pulled from Kata GitHub releases page
DaemonSets and RBAC
Two DaemonSets are introduced for kata-deploy, as well as an RBAC to facilitate
applying labels to the nodes.
Kata deploy
This DaemonSet installs the necessary Kata binaries, configuration files, and virtual machine artifacts on
the node. Once installed, the DaemonSet adds a node label katacontainers.io/kata-runtime=true and reconfigures
either CRI-O or containerd to register three runtimeClasses: kata-clh (for Cloud Hypervisor isolation), kata-qemu (for QEMU isolation),
and kata-fc (for Firecracker isolation). As a final step the DaemonSet restarts either CRI-O or containerd. Upon deletion,
the DaemonSet removes the Kata binaries and VM artifacts and updates the node label to katacontainers.io/kata-runtime=cleanup.
Kata cleanup
This DaemonSet runs of the node has the label katacontainers.io/kata-runtime=cleanup. These DaemonSets removes
the katacontainers.io/kata-runtime label as well as restarts either CRI-O or containerd systemctl
daemon. You cannot execute these resets during the preStopHook of the Kata installer DaemonSet,
which necessitated this final cleanup DaemonSet.