I have Kubernates jobs which each require ~300GB of temporary disk space whilst they are running, then send files to an external service when done.
Currently I’m using DigitalOcean managed Kubernates with their storage optmised Droplets. However this is much more expensive than using Droplets with less vCPU but atatched block storage.
These jobs are automated (run by a Python script). DigitalOcean’s support article talks about creating a StatefulSet but I don’t understand how to do this at each jobs runtime, or if this is the right approach.
So how would you reccomend the following? Running Kubernates jobs which each require ~300GB of temp space but relatively low vCPU and Memory.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there @d825171ca273f05,
What I would do in this case is to also use a block storage and a PVC. That way you could attach the storage to a specific deployment and use it as a volume just like you would with a standard Droplet.
So rather than a StatefulSet you could use a standard Kubernetes deployment, for example:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: your-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
storageClassName: do-block-storage
apiVersion: apps/v1
kind: Deployment
metadata:
name: your_app
spec:
selector:
matchLabels:
app: your_app
template:
metadata:
labels:
app: your_app
spec:
containers:
- name: your_app
image: your_image:latest
securityContext:
privileged: true
volumeMounts:
- mountPath: "/var/lib/your_path"
name: do-block-storage
volumes:
- name: do-block-storage
persistentVolumeClaim:
claimName: your-pvc
Here is a similar discussion here:
The main thing that you need to keep in mind is that the volume can be attached as ReadWriteOnce meaning that it would only be available on one node. So in case that you need to use multiple pods, they all need to be scheduled on the same node.
Hope that this helps! Regards, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.