<p>I really dont understand this issue. In my <code>pod.yaml</code> i set the <code>persistentVolumeClaim</code> . i copied on my lastapplication declaration with PVC &amp; PV.
  i've checked that the files are in the right place !
on my Deployment file i've just set the port and the spec for the containers. </p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: ds-mg-cas-pod
  namespace: ds-svc
spec:
  containers:
  - name: karaf
    image: docker-all.xxxx.net/library/ds-mg-cas:latest
    env:
    - name: JAVA_APP_CONFIGS
      value: "/apps/ds-cas-webapp/context"
    - name: JAVA_EXTRA_PARAMS
      value: "-Djava.security.auth.login.config=./config/jaas.config -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6402"

    volumeMounts:
    - name: ds-cas-config
      mountPath: "/apps/ds-cas-webapp/context"
  volumes:
    - name: ds-cas-config
      persistentVolumeClaim:
        claimName: ds-cas-pvc
</code></pre>

<p>the <code>PersistentVolume</code>  &amp; <code>PersistenteVolumeClaim</code></p>

<pre><code>kind: PersistentVolume
apiVersion: v1
metadata:
  name: ds-cas-pv
  namespace: ds-svc
  labels:
    type: local
spec:
  storageClassName: generic
  capacity:
    storage: 5Mi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: "/apps/ds-cas-webapp/context"
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: ds-cas-pvc
  namespace: ds-svc
spec:
  storageClassName: generic
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Mi
</code></pre>

<p>The error i get when i run the pod </p>

<pre><code>    java.io.FileNotFoundException: ./config/truststore.jks (No such file or directory)
</code></pre>

<p>I run the same image manually with docker. i didn't had an error. My question is where i can made a mistake because i really dont see :( 
 i set everything </p>

<ul>
<li>the mountpoints</li>
<li>the ports</li>
<li>the variable</li>
</ul>

<p><em>the docker command that i used to run the container</em> :</p>

<pre><code>docker run --name ds-mg-cas-manually
-e JAVA_APP=/apps/ds-cas-webapp/cas.war
-e JAVA_APP_CONFIGS=/apps/ds-cas-webapp/context
-e  JAVA_EXTRA_PARAMS="-Djava.security.auth.login.config=./config/jaas.config -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=6402"
-p 8443:8443 
-p 6402:640 
-d 
-v /apps/ds-cas-webapp/context:/apps/ds-cas-webapp/context 
docker-all.attanea.net/library/ds-mg-cas  
/bin/sh -c
</code></pre>

morla
<p>Your PersistentVolumeClaim is probably bound to the wrong PersistentVolume.</p>

<p>PersistentVolumes exist cluster-wide, only PersistentVolumeClaims are attached to a namespace:</p>

<pre><code>$ kubectl api-resources
NAME                     SHORTNAMES   APIGROUP   NAMESPACED   KIND
persistentvolumeclaims   pvc                     true         PersistentVolumeClaim
persistentvolumes        pv                      false        PersistentVolume
</code></pre>
