I have applied the following pvc yaml.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ebs-claim
spec:
accessModes:
- ReadWriteOnce
storageClassName: ebs-sc
resources:
requests:
storage: 4Gi
I now want my statefulset to use the PVC I have created. Instead, it is creating new PVC of a different storageclass.
apiVersion: v1
kind: statefulset
metadata:
name: example
spec:
# Name for the service object created by the operator
serviceName: mongodb-service
selector: {}
# Specifies a size for the data volume different from the default 10Gi
volumeClaimTemplates:
- metadata:
name: ebs-claim
template:
spec:
nodeSelector:
eks.amazonaws.com/nodegroup: managed-ng-private-1
How can I get my statefulset to use existing PVCs instead of creating new ones?