azure - How to use Kubernetes Statefulset to load existing PersistentVolumes? -
it seems of examples of statefulsets show persistentvolumes (pvs) being dynamically created on startup. keeps pvs around after stop statefulste. that's also. that's great, periodically want stop kubernetes cluster , take of nodes offline. it's great way save money. stopping kubernetes delete remaining persistentvolumeclaims (pvcs). @ point, pvs released , reclaimed. can avoided if change pvs reclaimpolicy 'retain' after created. great.
but when restart cluster , create statefulset once again, reuse same underlying storage still alive in cloud provider (azure). happen, not need pvs recreated (which i'm willing manually), need individual nodes pair correct pv. instance, once pv hold master mysql database data. other pv hold slave mysql database data.
i don't see how possible within statefulset definition in persistentvolumeclaimtemplate.
am approaching wrong way? possible? initial startup (no data), use statefulset? should subsequent restarts use else, 'deployment'?
or, use same statefulset initial creation , restart, have separate script loads in data old pvs new ones? i'm not quite sure how work.
this question similar question, i'm looking go 1 step further.
Comments
Post a Comment