The Memory Machine Container Model

To manage containers, Memory Machine runs in a single pod on each container node and manages memory in a local persistent volume (PV). Application container pods on that node mount the PV to gain access to managed memory.

Memory Machine uses a supplied script, config-pmem.sh, to reconfigure the Persistent Memory namespace to fsdax mode. A daemonSet is used to create one Distributed Persistent Memory Engine (DPME) pod on each node. This pod runs mvmallocd, the Memory Machine memory manager.

A local PV is created on top of the configured PMEM fsdax directory. The Memory Machine DPME pod claims the PV, mounts it, and passes the PMEM file to mvmallocd. Application pods can mount this PV through persistent volume claim (PVC); the pods share the domain socket among the application pods and the DPME pod on each node.

See Memory Machine Container Architecture for a high-level picture of the container configuration.

An initContainer in the DPME pod copies Memory Machine binaries and dependent libraries to the shared PV. Before an application pod is started, Memory Machine uses a mutating webhook to inject an initContainer into the pod. The initContainer copies these binaries and libraries to the directories required by Memory Machine. The initContainer also configures Memory Machine environment variables on the application pod.

Figure 1. Memory Machine Container Architecture

For more in-depth information about the Memory Machine container implementation, see the MemVerge container GitHub repository.