<p>Whatever mount path i add for PVC it is creating lost+found folder and deleting all other content.</p>

<p>I am trying to setup deployment with PVC</p>

<pre><code>FROM python:3.5 AS python-build
ADD . /test
WORKDIR /test
CMD [ "python3", "./run.py" ]


apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: test-core
  labels:
    app: test-core
spec:
  selector:
    matchLabels:
      app: test-core
      tier: frontend
  strategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: test-core
        tier: frontend
    spec:
      containers:
      - image: &lt;My image&gt;
        securityContext:
          privileged: true
          runAsUser: 1000
        resources:
          requests:
            memory: "128Mi"
            cpu: .05
          limits:
            memory: "256Mi"
            cpu: .10
        name: test-core
        ports:
        - containerPort: 9595
          name: http
        - containerPort: 443
          name: https
        readinessProbe:
            httpGet:
              path: /
              port: 9595
            initialDelaySeconds: 5
            periodSeconds: 3
            timeoutSeconds: 3
            successThreshold: 1
            failureThreshold: 4
        envFrom:
        - secretRef:
            name: test-secret
        - configMapRef:
            name: test-new-configmap
        volumeMounts:
        - name: core-data
          mountPath: /test
        imagePullPolicy: Always
      volumes:
      - name: core-data
        persistentVolumeClaim:
          claimName: core-claim
</code></pre>

<p>When i apply this file from kubernetes it's giving an error in the log cannot find file run.py that mean PVC going empty.</p>

<p>Whatever mount path a add it is creating lsot+found folder and deleting all other content.</p>

<p>Thanks</p>

Harsh Manvar
<p>According your <code>Dockerfile</code>, when you run <code>docker build -t &lt;imagename&gt; .</code>, it will copy all files on your current directory to container image. And when you start this container, it will look for <code>run.py</code>. </p>

<p>If one of theese files is <code>run.py</code>, which actually should be, then your deployment yaml file is not correct, because you mount another PV to that directory, which will overwrite your files which you copied before and it won't able to find <code>run.py</code></p>

<p>Hope it helps.</p>
