0
votes

I follow this example to create pod with volume , https://github.com/kubernetes/kubernetes/blob/master/examples/cephfs/cephfs.yaml, I guess someting wrong for me.

docker inspect:

"/mnt/cephfs": "/var/lib/kubelet/pods/7631bff0-7155-11e5-9e8a-000c29de7e43/volumes/kubernetes.io~empty-dir/cephfs"

and my yaml is:

apiVersion: v1
kind: Pod
metadata:
  name: cephfs
spec:
  containers:
  - name: cephfs-rw
    image: centosphpok
    volumeMounts:
    - mountPath: "/mnt/cephfs"
      name: cephfs
  volumes:
  - name: cephfs
    cephfs:
      monitors:
      - 10.0.0.206:6789
      user: admin
      secretFile: "/etc/ceph/admin.secret"
      readOnly: true
1
Can you look in /var/log/kubelet.log on your node and see if it prints an errors while trying to mount the volume? If you look in /etc/ceph/admin.secret inside your pod does it contain the correct information to mount the volume?Robert Bailey

1 Answers

0
votes

One thing you might try is to use both the secretFile attribute and creating a Kubernetes Secret object to use as well.

This is what my PersistentVolume looks like:

kind: PersistentVolume
apiVersion: v1
metadata:
  name: oracle
  labels:
    type: rbd
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  rbd:
    pool: rbd
    image: oracle
    user: admin
    keyring: "/etc/ceph/ceph.client.admin.keyring"
    secretRef:
      name: ceph-secret
    fsType: ext4
    readOnly: false
    monitors:
      - "23.23.23.48:6789"
      - "23.23.23.51:6789"
      - "23.23.23.56:6789"

And this is my Secret:

apiVersion: v1
kind: Secret
metadata:
    name: ceph-secret
    data:
        key: AQCChg1WULlLGRAAVB+ws+Uo5FslFPdy338KJg==