1 of 9

Virtcontainers API extensions

For Kata Containers

2 of 9

Proposal Background

3 of 9

Virtcontainers API gaps

  • Missing external Pod based API
    • Current API always reconstructs pods from their stored metadata
  • Missing external runtime metadata storage API (aka Resource Persistence)
  • Missing storage and network hotplug external API
  • Missing agent and VM Go interfaces exposure
  • Missing built-in shim and proxy support

4 of 9

Proposed virtcontainers API extensions

  • Add pod based external API
  • Add storage and network pod hotplug API
  • Add plugin framework for supporting external implementations for:
    • Hypervisors (See @jon use case for proprietary VMMs)
    • Metadata storage (Resource Persistence)
    • VM cloning/caching
  • Add built-in shim and proxy virtcontainers implementation and types

5 of 9

Pod based external API

  • The current 1.0 API is designed for an OCI runtime binary needs
  • A pod/sandbox is always restored from storage between runtime calls
  • A CRI server can keep sandbox pointers in memory
  • Current API examples:
    • func StartPod(podID string) (VCPod, error)
    • func StartContainer(podID, containerID string) (VCContainer, error)
  • To be extended to, respectively:
    • func (VCPod *pod) StartPod() (error)
    • func (VCPod *pod) StartContainer(VCContainer *ctr) (error)

6 of 9

Storage and Network hotplug API

  • For optimizing the container creation process
  • API for attaching NICs and storage endpoints to a Pod/Sandbox
  • pod.AddStorage()
  • pod.AddNetwork()

7 of 9

Virtcontainers Plugins

  • Dynamically add external virtcontainers interfaces implementations
  • Clean way to allow for proprietary Kata runtime extensions
  • Leverage golang's plugin package
  • Plugins to call into the virtcontainers plugin API (RegisterPlugin())
  • Potentially supported plugin types:
    • Hypervisors
    • Metadata backend (For storing/fetching Kata runtime’s metadata)
    • VM caching/cloning

8 of 9

Built-in shim and proxy support

  • Support the standalone, process less shim and proxy use case
  • Build shim and proxy libraries from respectively kata-containers/shim and kata-containers/proxy
  • Implement virtcontainers builtin_shim.go and builtin_proxy.go
    • New shim and proxy virtcontainers types (Set through virtcontainers configuration)
    • Call into the respective shim and proxy APIs
    • Launch go routines to implement internal shim and proxy instances

9 of 9

Plan of actions

  1. Import virtcontainers into kata-containers/runtime/
  2. Implement Pod based external API
  3. Implement Storage and Network hotplug API
  4. Implement virtcontainers plugin framework
    1. Add support for hypervisor plugins
    2. Add support for metadata storage plugins (To be discussed)
    3. Add support for VM cloning/caching
      1. Implement VM cloning/caching framework
      2. Define VM cloning/caching plugin interface