<p>Because I have tried creating persistence volume but not getting any value in there as I am creating volume in my minikube vm hosted in virtualbox.</p>
<p>yaml file for my deployment:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1    
kind: Deployment
metadata:
  name: python-flask-app-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: python-flask-app-dep
  template:
    metadata:
      labels:
        app: python-flask-app-dep
    spec:
      volumes:
      - name: mypod-pvc
        persistentVolumeClaim:
          claimName: mypvc
      containers:
        - name: python-app-container
          image: jackazjimmy/flask-test-demo-eks:v1
          volumeMounts:
           - mountPath: /app/instance/
             name: mypod-pvc
          ports:
            - containerPort: 31816  # Exposed port in your Dockerfile
          resources:
            limits:
              cpu: 500m
            requests:
              cpu: 200m
---
apiVersion: v1
kind: Service
metadata:
  name: python-app-service
spec:
  selector:
    app: python-flask-app-dep
  ports:
    - protocol: TCP
      port: 8080  # External port
      targetPort: 31816  # Container port
  type: NodePort
</code></pre>
<p>Pvc yaml file:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mypvc
spec:
  storageClassName: &quot;&quot;
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
     storage: 10Gi
</code></pre>
<p>Pv yaml file:</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: mypv
spec:
storageClassName: &quot;&quot;
capacity:
   storage: 10Gi
accessModes:
   - ReadWriteOnce
hostPath:
   path: &quot;/home/mydata&quot;
</code></pre>
<p>After applying or creating all the required resources, whenever I connect through minikube ssh not able to get the files stores in local volume.
Any suggestion would be helpful:)</p>

jackazjimmy
<p>K8s almost support PV and PVC for all the apps runnable on K8s. As per your files, you left the storage class empty. It took the default storage class. There are high chance you don't have any storage class, or it might not be 10GB. Firstly you create a storage class where you want to store the volumes. It might be local or NFS outside of the cluster or using 3rd party solution like Minio or Rook. You also define this storage class's size (e.g., 10GB 100GB). Then you create a PV with this storage class with a unique name related to the app where you want to use it. Finally, you mount the PVC(Persistent Volume claim) with PV. Now your application will store data into PVC which is mounted with PV and that PV stores data into storage class.
This is an example of a storage class yaml file.</p>
<pre><code>apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: standard
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
reclaimPolicy: Retain
allowVolumeExpansion: true
mountOptions:
  - debug
volumeBindingMode: Immediate
</code></pre>
<p>I hope this help.</p>
