Asking for help? Comment out what you need so we can get more information to help you!
Kubernetes version: 1.19.3 (k3s)
Cloud being used: bare-metal
Installation method: na
Host OS: Unbuntu
CNI and version: na
CRI and version: na
I would like to execute a Cronjob which mounts volumes from pods of a statefulset.
To do this, i wrote this in the yaml :
- name : dbdata
- name: dbdata
The pb is that the “claimName” is a “fixed” string.
Here “datadir-db-0” is the claim for the first pod of the statefulset (which has the label app=db)
On the second pod of the statefulset, the second pod executed by the job will fail because “datadir-db-0” claim name does not exist.“datadir-db-1” claimname should be used instead.
How to mount the right persistent volume of the statfulset from each pods executed by the job ?