In kubelet logs, do you see the volume getting mounted?

On Mon, Feb 19, 2018, 08:49 Marcus <marcus.hun...@gmail.com> wrote:

> Hi,
>
> I've created a PV, PVC and Pod using it as a volume. As provider for the
> PV, flexVolume with a script to mount a cifs-share is used. The PV is
> claimed and the pod starts, everything looks fine. On the node, I see the
> share mounted, as it should.
>
> But inside the container, the volume is mounted as tmpfs and it's contents
> are different files than in the cifs-share.
>
> / # ls -l /var/lib/mysql/
> total 8
> prwx------    1 root     root             0 Feb 19 16:34
> 68e2851c2a83fa34d95ae7b37acdde7a0f8415d8e7eed25a826fd53feb365429-stdin
> prwx------    1 root     root             0 Feb 19 16:34
> 68e2851c2a83fa34d95ae7b37acdde7a0f8415d8e7eed25a826fd53feb365429-stdout
> -rw-r--r--    1 root     root          5986 Feb 19 16:33 config.json
> prwx------    1 root     root             0 Feb 19 16:33 init-stderr
> prwx------    1 root     root             0 Feb 19 16:33 init-stdin
> prwx------    1 root     root             0 Feb 19 16:33 init-stdout
>
> / # mount | grep var/lib/mysql
> tmpfs on /var/lib/mysql type tmpfs (rw,seclabel,nosuid,nodev,mode=755)
>
> I am using kubelet 1.9.2 and docker 1.12.6 on centos 7.4. How can I fix
> this?
>
> Thanks, Marcus
>
> pv.yaml:
>
> apiVersion: v1
> kind: PersistentVolume
> metadata:
>   name: pv0003
> spec:
>   capacity:
>     storage: 1Gi
>   volumeMode: Filesystem
>   accessModes:
>     - ReadWriteOnce
>   persistentVolumeReclaimPolicy: Retain
>   flexVolume:
>     driver: "fnordian/cv"
>     readOnly: false
>     options:
>       source: "//192.168.121.82/kubvolumes"
>       mountOptions: "dir_mode=0700,file_mode=0600"
>       cifsuser: "nobody"
>       cifspass: "nobody"
>
> pod.yaml:
>
> apiVersion: v1
> kind: Pod
> metadata:
>   name: busybox
>   namespace: default
> spec:
>   containers:
>   - image: busybox
>     command:
>       - sleep
>       - "3600"
>     imagePullPolicy: IfNotPresent
>     name: busybox
>     volumeMounts:
>             - name: mysql-pv
>               mountPath: /var/lib/mysql
>   restartPolicy: Always
>
>   volumes:
>   - name: mysql-pv
>     persistentVolumeClaim:
>       claimName: mysql-pv-claim
>
> ---
> apiVersion: v1
> kind: PersistentVolumeClaim
> metadata:
>   name: mysql-pv-claim
> spec:
>   accessModes:
>     - ReadWriteOnce
>   resources:
>     requests:
>       storage: 100Mi
>
> --
> You received this message because you are subscribed to the Google Groups
> "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to kubernetes-users+unsubscr...@googlegroups.com.
> To post to this group, send email to kubernetes-users@googlegroups.com.
> Visit this group at https://groups.google.com/group/kubernetes-users.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to