I'm wondering if one needs to format an EBS volume (e.g. via mkfs.xfs
) before it can be used by a container running in kubernetes. I've examples where in people just create the volumes and have it mounted by kubernetes. Does kubernetes format the volume before using it first?
According to the official documentation:
An
awsElasticBlockStore
volume mounts an Amazon Web Services (AWS) EBS Volume into your Pod. UnlikeemptyDir
, which is erased when a Pod is removed, the contents of an EBS volume are preserved and the volume is merely unmounted. This means that an EBS volume can be pre-populated with data, and that data can be "handed off" between Pods.
So it does not have to be formatted before being used.
You can find more details and examples in the linked documentation.