Volumes
How to add a game Part 4 (Volumes)
Containers don't have persistent storage volumes or drives, therefore, volumes must be configured. There are two types: Persistent and Ephemeral.
PVCs
Persistent Volume Claims (PVCs henceforth) need to be defined through the menu. PVCs must be created so servers from your game can have storage.
Creating a PVC
PVC Name: There are three name types: Data (primary game data storage), Shared (shared files across instances) or Custom. It's shown as suffix, for example:
server-{serverId}-dataorserver-{serverId}-shared. Whatever is set to custom will be used as a suffix (eg.server-{serverId}-backup)Scope: Whether the PVC is limited to be uniquely assigned to a server or a shared cluster. If it's Per-Server, the PVC will be only available and unique to a specific server. If it's Shared (Cluster), the storage will be shared across all servers in your billing cluster. Soulmask/Ark: Survival Evolved use this system, for example. For games using this, the controller will ensure servers using this PVC are scheduled on the same node.
Storage Size: Specifies the size of the storage in
Gi(gigabytes) orMi(megabytes). Eg:10Gi(10 GBs) while800Mi(800 MBs).Description: Simple written description of the purpose of the PVC.
Ephemeral Volumes
Another type of volumes for containers. Unlike PVCs, Ephemeral (emptyDir), as their name implies, are not persistent. In this section, temporary storage volumes shared between containers within a pod can be defined.
Data in Ephemeral volumes is erased when the pod is terminated.
Use Case: Share tokens, temporary files, or cache between init containers and main containers. Init containers run and complete their tasks before the main application container starts.
Storage Medium:
Diskuses node storage,Memory(in tmpfs) uses RAM which is faster but limited.Size Limit: Optional, but recommended for Memory medium to prevent out-of-memory issues.
Sizing an ephemeral volume
A disk-backed ephemeral volume's Size Limit is added to the ephemeral-storage bound the platform puts on the main container. That bound starts at a 20Gi baseline and grows by the size limits of the disk-backed ephemeral volumes mounted by any container in the pod, whether init, main or sidecar. A Memory volume is charged to the container's memory limit instead and adds nothing to that bound. A volume with no Size Limit also adds nothing, so set one on any disk volume that holds real data.
When you use an ephemeral volume as the server's data volume, set Size Limit to at least the installed size of the game plus anything the server writes while it runs. A copy larger than the limit gets the pod evicted part way through the install. Baked-In Game Files has the three steps for mounting an ephemeral volume as the data volume, and Choosing How Game Files Reach Your Servers compares persistent and ephemeral storage against each content model.