In our continuous effort to enhance Convox's v3 Kubernetes (k8s) Racks, we are excited to introduce support for emptyDir
volumes. This feature allows for more flexible management of temporary data within your applications, facilitating high-performance and stateless computation workloads.
emptyDir
volumes are a vital feature in Kubernetes, providing temporary file storage that is tied to the lifecycle of a pod. When a pod is created on a node, Kubernetes creates an associated emptyDir
volume, which remains as long as the pod runs on that node. Data in emptyDir
volumes is ephemeral and is deleted once the pod is removed or deleted.
The introduction of emptyDir
volumes in Convox v3 Kubernetes racks enables your applications to utilize temporary storage that is fast and node-specific. These volumes do not persist data across pod restarts, making them ideal for temporary workloads and high-speed data processing.
To leverage emptyDir
volumes in your Convox Kubernetes applications, you can specify them in your convox.yml
file as follows:
environment:
- PORT=3000
services:
app:
build: .
port: 3000
volumeOptions:
- emptyDir:
id: "my-vol1"
mountPath: "/data"
- emptyDir:
id: "my-vol2"
mountPath: "/data2"
medium: Memory
The medium
attribute in emptyDir
volumes allows you to specify the storage medium. Setting this to Memory
utilizes RAM, providing faster access speeds beneficial for certain cache or workload scenarios, whereas the default (null) uses the node's local storage.
While emptyDir
volumes are versatile, they are best suited for:
Remember, data in emptyDir
volumes is not durable and should not be used for critical data that requires persistence.
To use emptyDir
volumes, ensure your rack is updated to version 3.16.0 or later. Although emptyDir
itself introduces no breaking changes, it is important to note that the 3.16.0 rack update includes critical Kubernetes version updates.
If you are on a version prior to 3.16.0, you can update your rack using:
convox rack update 3.16.0 -r rackName
It's crucial to verify you're on at least version 3.15.0 before this update. For detailed instructions on updating your rack, refer to the Convox documentation on "Updating a Rack".
The support for emptyDir
volumes in Convox's Kubernetes platform underscores our commitment to providing robust and flexible solutions for your containerized applications. By leveraging this feature, you can optimize your applications for performance and efficiency, ensuring that your temporary data management is seamless and effective.