I created Kubernetes persistent volume and claim & used them in deployment file.
Deployment working fine. But error i am having is data is still storing inside containers.
i want data to be store in pv which i created on local.
Below is my PVC.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: admin-pvc
labels:
app: data
spec:
accessModes:
- ReadWriteMany
storageClassName: local-storage
resources:
requests:
storage: 2Gi
selector:
matchLabels:
type: local
Below is my pv
apiVersion: v1
kind: PersistentVolume
metadata:
name: task-pv-volume
labels:
type: local
spec:
storageClassName: local-storage
capacity:
storage: 2Gi
accessModes:
- ReadWriteMany
hostPath:
path: "/mnt/data"
still my data is going inside pod.
which i want to be go inside pv.