ApplySharedMemory
Applies shared memory configuration to a Kubernetes PodSpec. It adds a shared memory volume to the pod and mounts it into the primary container, ensuring no naming conflicts with existing volumes or mounts.
def ApplySharedMemory(
podSpec: *v1.PodSpec,
primaryContainerName: string,
SharedMemory: *core.SharedMemory
) - > error
Applies shared memory configuration to a given pod specification by adding a shared memory volume and mounting it to the primary container. This function ensures that the shared memory mount name and path are unique within the pod and container.
Parameters
| Name | Type | Description |
|---|---|---|
| podSpec | *v1.PodSpec | The Kubernetes PodSpec to which the shared memory volume and mount will be added. This object will be modified in place. |
| primaryContainerName | string | The name of the primary container within the podSpec where the shared memory volume will be mounted. This container must exist in the podSpec. |
| SharedMemory | *core.SharedMemory | A SharedMemory object containing the configuration details for the shared memory, including its mount name, mount path, and optional size limit. |
Returns
| Type | Description |
|---|---|
error | Returns an error if the shared memory mount name or path is not set, if the primary container is not found, if a volume or mount with the same name or path already exists, or if the size limit cannot be parsed. |