I created a gp2 storageclass in my eks cluster. When I create a statefulset instance, it will automatically creates a volume in AWS's EBS.
I backed up the mounted volumes bound to statefulset by using AWS's Backup service. But after I restore the Recovery point, it just created a newly mounted volume with a different name. How do I bind this new volume to statefulset's pod?
I tried to edit pv/pvc yaml but failed.
If you are using the
volumeClaimTemplatesin your YAML definition. it will use the create unique replicas for stateful sets with postfix -0, -1.If you have already created the new PVC you and mount it to statefulset simply as the normal way we do in deployment with volume.
Example
if you have multiple replicas running and have multiple PVC to attach you can use the
volumeClaimTemplatesitself.ref link : Using a pre-existing disk in a StatefulSet