.. _k8s-sandboxed-containers: *************************************** Security - Running Sandboxed Containers *************************************** Containers typically share kernel resources of the host VM with other containers. While this is generally considered to be one of the key benefits of containers as it makes them more lightweight, it also makes them less secure than traditional VMs. For additional security in a Kubernetes cluster it can be useful to run certain containers in a restricted runtime environment known as a *sandbox*. A sandboxed container is isolated from the host kernel as well as other containers. One approach to acheiving this is to use a lightweight virtual machine to isolate the container. This is the method used by `Kata Containers`_. .. _`Kata Containers`: https://katacontainers.io Another approach is to intercept calls between the containerised application and the host kernel. This is the method used by `gVisor`_. gVisor acts much like a mini kernel. It receives system calls from the containerised application and decides whether to respond to them, pass them on to the host kernel or just ignore them. Unlike Kata Containers which require nested virtualisation, ``gVisor`` just requires ``runsc``, the executable implemented in Golang. .. _`gVisor`: https://gvisor.dev/docs Running containers with gVisor ============================== All Catalyst Cloud Kubernetes cluster nodes come with the gVisor executable, ``runsc``, installed and configured for ``containerd``. The only thing you need to in order to begin running sandboxed containers is create a ``RuntimeClass`` object in your cluster as follows: .. code-block:: bash cat <