On my local machine I can do mkdir
and trust that this operation is atomic. I can thus use it as a lock. Can I similarly use mkdir
on an EC2 instance with EBS attached and have it be atomic?
For further context, I am thinking of a situation where I have multiple Kubernetes Pods running on a Kubernetes Node with one persistentVolume
(AWS EBS) between them. If one of these pods is looking to get exclusive access to a folder in this volume, can it do so? The pods are sharing read-only data, but I to trigger an aws s3 sync
only once per week, not once-per-pod-per-week.